Skip to content

Commit

Permalink
Forward fields for message telegram object
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Muhandis committed Apr 29, 2020
1 parent fc1e13e commit 9a12478
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
6 changes: 6 additions & 0 deletions examples/LongPollingDesktop/LongPollingDesktop.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value="-dUseCThreads"/>
</Other>
</CompilerOptions>
</Item3>
</BuildModes>
Expand Down Expand Up @@ -141,6 +144,9 @@
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value="-dUseCThreads"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
Expand Down
14 changes: 7 additions & 7 deletions fp-telegram.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"Category" : "Networking, Other",
"CommunityDescription" : "Telegram bots API wrapper for freepascal",
"RepositoryFileName" : "fp-telegram.zip",
"RepositoryFileSize" : 436906,
"RepositoryFileHash" : "54f1fe3f9e151dd3721d2442bb3a460a",
"RepositoryDate" : 4.3874736219849539E+004,
"RepositoryFileSize" : 507146,
"RepositoryFileHash" : "884b5957ace91ded16b5a90a84cebc09",
"RepositoryDate" : 4.3950783826064813E+004,
"PackageBaseDir" : "fp-telegram\\/",
"HomePageURL" : "https://github.com/Al-Muhandis/fp-telegram",
"DownloadURL" : "https://raw.githubusercontent.com/Al-Muhandis/fp-telegram/master/update_FpTelegram.json",
Expand All @@ -20,10 +20,10 @@
"Author" : "Al-muhandis (Renat Suleymanov)",
"License" : "MIT License",
"RelativeFilePath" : "",
"VersionAsString" : "0.0.0.18",
"LazCompatibility" : "1.8.5, 2.0.0, 2.0.2, 2.0.4, 2.0.6, Trunk",
"FPCCompatibility" : "3.0.0, 3.0.2, 3.0.4, 3.2.0, Trunk",
"SupportedWidgetSet" : "gtk2, win32/win64",
"VersionAsString" : "0.0.0.21",
"LazCompatibility" : "1.6, 1.8, 2.0, Trunk",
"FPCCompatibility" : "2.6.4, 3.0.0, 3.0.2, 3.0.4",
"SupportedWidgetSet" : "win32/64, gtk2, carbon",
"PackageType" : 3,
"DependenciesAsString" : "FCL"
}
Expand Down
2 changes: 1 addition & 1 deletion fptelegram.lpk
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</CompilerOptions>
<Description Value="Telegram bots API library"/>
<License Value="MIT License"/>
<Version Build="20"/>
<Version Build="21"/>
<Files Count="6">
<Item1>
<Filename Value="tgsendertypes.pas"/>
Expand Down
4 changes: 2 additions & 2 deletions tgsendertypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1981,11 +1981,11 @@ procedure TTelegramSender.DoReceiveUpdate(AnUpdate: TTelegramUpdateObj);
case AnUpdate.UpdateType of
utMessage: DoReceiveMessageUpdate(AnUpdate.Message);
utEditedMessage: DoReceiveEditedMessage(AnUpdate.EditedMessage);
utCallbackQuery: DoReceiveCallbackQuery(AnUpdate.CallbackQuery);
utChannelPost: DoReceiveChannelPost(AnUpdate.ChannelPost);
utEditedChannelPost: DoReceiveEditedChannelPost(AnUpdate.EditedChannelPost);
utInlineQuery: DoReceiveInlineQuery(AnUpdate.InlineQuery);
utInlineQuery: DoReceiveInlineQuery(AnUpdate.InlineQuery);
utChosenInlineResult: DoReceiveChosenInlineResult(AnUpdate.ChosenInlineResult);
utCallbackQuery: DoReceiveCallbackQuery(AnUpdate.CallbackQuery);
utPreCheckoutQuery: DoReceivePreCheckoutQuery(AnUpdate.PreCheckoutQuery);
end;
if Assigned(FUpdateLogger) then
Expand Down
9 changes: 9 additions & 0 deletions tgtypes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ TTelegramMessageObj = class(TTelegramObj)
FCaption: String;
FChat: TTelegramChatObj;
FDocument: TTelegramDocument;
FForwardFrom: TTelegramUserObj;
FForwardFromChat: TTelegramChatObj;
FForwardFromMessageID: LongInt;
FFrom: TTelegramUserObj;
FLocation: TTelegramLocation;
fMessageId: Integer;
Expand Down Expand Up @@ -944,6 +947,10 @@ constructor TTelegramMessageObj.Create(JSONObject: TJSONObject);
FAudio := TTelegramAudio.CreateFromJSONObject(fJSON.Find('audio', jtObject) as TJSONObject) as TTelegramAudio;
FVoice := TTelegramVoice.CreateFromJSONObject(fJSON.Find('voice', jtObject) as TJSONObject) as TTelegramVoice;

FForwardFrom:=TTelegramUserObj.CreateFromJSONObject(fJSON.Find('forward_from', jtObject) as TJSONObject) as TTelegramUserObj;
FForwardFromChat:=TTelegramChatObj.CreateFromJSONObject(fJSON.Find('forward_from_chat', jtObject) as TJSONObject) as TTelegramChatObj;
FForwardFromMessageID:=fJSON.Integers['forward_from_message_id'];

FLocation:=TTelegramLocation.CreateFromJSONObject(fJSON.Find('location', jtObject) as TJSONObject) as TTelegramLocation;

FReplyToMessage:=
Expand All @@ -968,6 +975,8 @@ constructor TTelegramMessageObj.Create(JSONObject: TJSONObject);

destructor TTelegramMessageObj.Destroy;
begin
FForwardFrom.Free;
FForwardFromChat.Free;
FSuccessfulPayment.Free;
FFrom.Free;
FLocation.Free;
Expand Down

0 comments on commit 9a12478

Please sign in to comment.