From e24846ba9413cc653aed1c7589533e3cb4f92ecb Mon Sep 17 00:00:00 2001 From: Kristofer Berggren Date: Sun, 5 Jan 2025 17:24:51 +0800 Subject: [PATCH] update tdlib to 1.8.42 from tdlib/td@2be9e79 --- lib/common/src/version.h | 4 +- .../td/CMake/GetGitRevisionDescription.cmake | 2 +- lib/tgchat/ext/td/CMake/iOS.cmake | 2 +- lib/tgchat/ext/td/CMakeLists.txt | 35 +- lib/tgchat/ext/td/README.md | 2 +- lib/tgchat/ext/td/SplitSource.php | 17 +- lib/tgchat/ext/td/benchmark/bench_actor.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_crypto.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_db.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_empty.cpp | 2 +- .../ext/td/benchmark/bench_handshake.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_http.cpp | 2 +- .../ext/td/benchmark/bench_http_reader.cpp | 2 +- .../ext/td/benchmark/bench_http_server.cpp | 2 +- .../td/benchmark/bench_http_server_cheat.cpp | 2 +- .../td/benchmark/bench_http_server_fast.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_log.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_misc.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_queue.cpp | 2 +- lib/tgchat/ext/td/benchmark/bench_tddb.cpp | 2 +- lib/tgchat/ext/td/benchmark/check_proxy.cpp | 2 +- lib/tgchat/ext/td/benchmark/check_tls.cpp | 4 +- lib/tgchat/ext/td/benchmark/hashmap_build.cpp | 2 +- .../ext/td/benchmark/hashset_memory.cpp | 2 +- lib/tgchat/ext/td/benchmark/rmdir.cpp | 2 +- lib/tgchat/ext/td/benchmark/wget.cpp | 2 +- lib/tgchat/ext/td/example/cpp/CMakeLists.txt | 2 +- lib/tgchat/ext/td/example/cpp/td_example.cpp | 2 +- .../ext/td/example/cpp/tdjson_example.cpp | 2 +- lib/tgchat/ext/td/example/csharp/TdExample.cs | 2 +- .../ext/td/example/python/tdjson_example.py | 2 +- .../ext/td/example/swift/src/main.swift | 2 +- .../td/example/swift/src/td-Bridging-Header.h | 2 +- lib/tgchat/ext/td/example/uwp/SDKManifest.xml | 2 +- .../ext/td/example/uwp/Telegram.Td.UWP.nuspec | 2 +- lib/tgchat/ext/td/example/uwp/app/App.xaml.cs | 2 +- .../ext/td/example/uwp/app/MainPage.xaml.cs | 2 +- .../uwp/app/Properties/AssemblyInfo.cs | 2 +- lib/tgchat/ext/td/example/uwp/build.ps1 | 13 +- .../ext/td/example/uwp/extension.vsixmanifest | 2 +- lib/tgchat/ext/td/memprof/memprof.cpp | 4 +- lib/tgchat/ext/td/memprof/memprof.h | 2 +- lib/tgchat/ext/td/memprof/memprof_stat.cpp | 2 +- lib/tgchat/ext/td/memprof/memprof_stat.h | 2 +- lib/tgchat/ext/td/td/generate/generate_c.cpp | 2 +- .../ext/td/td/generate/generate_common.cpp | 2 +- .../ext/td/td/generate/generate_dotnet.cpp | 2 +- .../ext/td/td/generate/generate_java.cpp | 2 +- .../ext/td/td/generate/generate_json.cpp | 2 +- .../ext/td/td/generate/generate_mtproto.cpp | 2 +- .../td/td/generate/remove_documentation.cpp | 2 +- .../ext/td/td/generate/scheme/td_api.tl | 600 +++++-- .../ext/td/td/generate/scheme/telegram_api.tl | 108 +- .../ext/td/td/generate/tl_json_converter.cpp | 11 +- .../ext/td/td/generate/tl_json_converter.h | 2 +- lib/tgchat/ext/td/td/generate/tl_writer_c.h | 2 +- .../ext/td/td/generate/tl_writer_cpp.cpp | 2 +- lib/tgchat/ext/td/td/generate/tl_writer_cpp.h | 2 +- .../ext/td/td/generate/tl_writer_dotnet.h | 2 +- lib/tgchat/ext/td/td/generate/tl_writer_h.cpp | 2 +- lib/tgchat/ext/td/td/generate/tl_writer_h.h | 2 +- .../ext/td/td/generate/tl_writer_hpp.cpp | 2 +- lib/tgchat/ext/td/td/generate/tl_writer_hpp.h | 2 +- .../ext/td/td/generate/tl_writer_java.cpp | 2 +- .../ext/td/td/generate/tl_writer_java.h | 2 +- .../ext/td/td/generate/tl_writer_jni_cpp.cpp | 2 +- .../ext/td/td/generate/tl_writer_jni_cpp.h | 2 +- .../ext/td/td/generate/tl_writer_jni_h.cpp | 2 +- .../ext/td/td/generate/tl_writer_jni_h.h | 2 +- .../ext/td/td/generate/tl_writer_td.cpp | 2 +- lib/tgchat/ext/td/td/generate/tl_writer_td.h | 2 +- lib/tgchat/ext/td/td/mtproto/AuthData.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/AuthData.h | 2 +- lib/tgchat/ext/td/td/mtproto/AuthKey.h | 2 +- .../ext/td/td/mtproto/ConnectionManager.cpp | 2 +- .../ext/td/td/mtproto/ConnectionManager.h | 2 +- lib/tgchat/ext/td/td/mtproto/CryptoStorer.h | 2 +- lib/tgchat/ext/td/td/mtproto/DhCallback.h | 2 +- lib/tgchat/ext/td/td/mtproto/DhHandshake.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/DhHandshake.h | 2 +- lib/tgchat/ext/td/td/mtproto/Handshake.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/Handshake.h | 2 +- .../ext/td/td/mtproto/HandshakeActor.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/HandshakeActor.h | 2 +- .../ext/td/td/mtproto/HandshakeConnection.h | 2 +- .../ext/td/td/mtproto/HttpTransport.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/HttpTransport.h | 2 +- .../ext/td/td/mtproto/IStreamTransport.cpp | 2 +- .../ext/td/td/mtproto/IStreamTransport.h | 2 +- lib/tgchat/ext/td/td/mtproto/KDF.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/KDF.h | 2 +- lib/tgchat/ext/td/td/mtproto/MessageId.h | 2 +- lib/tgchat/ext/td/td/mtproto/MtprotoQuery.h | 2 +- lib/tgchat/ext/td/td/mtproto/NoCryptoStorer.h | 2 +- lib/tgchat/ext/td/td/mtproto/PacketInfo.h | 2 +- lib/tgchat/ext/td/td/mtproto/PacketStorer.h | 2 +- lib/tgchat/ext/td/td/mtproto/Ping.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/Ping.h | 2 +- .../ext/td/td/mtproto/PingConnection.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/PingConnection.h | 2 +- lib/tgchat/ext/td/td/mtproto/ProxySecret.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/ProxySecret.h | 2 +- lib/tgchat/ext/td/td/mtproto/RSA.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/RSA.h | 2 +- .../ext/td/td/mtproto/RawConnection.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/RawConnection.h | 2 +- .../ext/td/td/mtproto/SessionConnection.cpp | 4 +- .../ext/td/td/mtproto/SessionConnection.h | 2 +- lib/tgchat/ext/td/td/mtproto/TcpTransport.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/TcpTransport.h | 2 +- lib/tgchat/ext/td/td/mtproto/TlsInit.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/TlsInit.h | 2 +- .../ext/td/td/mtproto/TlsReaderByteFlow.cpp | 2 +- .../ext/td/td/mtproto/TlsReaderByteFlow.h | 2 +- lib/tgchat/ext/td/td/mtproto/Transport.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/Transport.h | 2 +- lib/tgchat/ext/td/td/mtproto/TransportType.h | 2 +- lib/tgchat/ext/td/td/mtproto/utils.cpp | 2 +- lib/tgchat/ext/td/td/mtproto/utils.h | 2 +- lib/tgchat/ext/td/td/telegram/AccentColorId.h | 2 +- lib/tgchat/ext/td/td/telegram/AccessRights.h | 2 +- .../ext/td/td/telegram/AccountManager.cpp | 2 +- .../ext/td/td/telegram/AccountManager.h | 2 +- .../ext/td/td/telegram/AffectedHistory.h | 2 +- .../ext/td/td/telegram/AffiliateType.cpp | 76 + lib/tgchat/ext/td/td/telegram/AffiliateType.h | 43 + .../ext/td/td/telegram/AlarmManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/AlarmManager.h | 2 +- .../ext/td/td/telegram/AnimationsManager.cpp | 6 +- .../ext/td/td/telegram/AnimationsManager.h | 2 +- .../ext/td/td/telegram/AnimationsManager.hpp | 2 +- lib/tgchat/ext/td/td/telegram/Application.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Application.h | 2 +- .../ext/td/td/telegram/AttachMenuManager.cpp | 6 +- .../ext/td/td/telegram/AttachMenuManager.h | 2 +- .../ext/td/td/telegram/AudiosManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/AudiosManager.h | 2 +- .../ext/td/td/telegram/AudiosManager.hpp | 2 +- lib/tgchat/ext/td/td/telegram/AuthManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/AuthManager.h | 4 +- lib/tgchat/ext/td/td/telegram/AuthManager.hpp | 2 +- .../td/td/telegram/AutoDownloadSettings.cpp | 2 +- .../ext/td/td/telegram/AutoDownloadSettings.h | 2 +- .../ext/td/td/telegram/AutosaveManager.cpp | 2 +- .../ext/td/td/telegram/AutosaveManager.h | 2 +- lib/tgchat/ext/td/td/telegram/BackgroundId.h | 2 +- .../ext/td/td/telegram/BackgroundInfo.cpp | 2 +- .../ext/td/td/telegram/BackgroundInfo.h | 2 +- .../ext/td/td/telegram/BackgroundInfo.hpp | 2 +- .../ext/td/td/telegram/BackgroundManager.cpp | 4 +- .../ext/td/td/telegram/BackgroundManager.h | 2 +- .../ext/td/td/telegram/BackgroundType.cpp | 2 +- .../ext/td/td/telegram/BackgroundType.h | 2 +- .../ext/td/td/telegram/BackgroundType.hpp | 2 +- lib/tgchat/ext/td/td/telegram/BaseTheme.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BaseTheme.h | 2 +- lib/tgchat/ext/td/td/telegram/Birthdate.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Birthdate.h | 2 +- lib/tgchat/ext/td/td/telegram/Birthdate.hpp | 2 +- lib/tgchat/ext/td/td/telegram/BlockListId.h | 2 +- .../ext/td/td/telegram/BoostManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BoostManager.h | 2 +- lib/tgchat/ext/td/td/telegram/BotCommand.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BotCommand.h | 2 +- .../ext/td/td/telegram/BotCommandScope.cpp | 2 +- .../ext/td/td/telegram/BotCommandScope.h | 2 +- .../ext/td/td/telegram/BotInfoManager.cpp | 101 +- .../ext/td/td/telegram/BotInfoManager.h | 8 +- .../ext/td/td/telegram/BotMenuButton.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BotMenuButton.h | 2 +- lib/tgchat/ext/td/td/telegram/BotQueries.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BotQueries.h | 2 +- .../ext/td/td/telegram/BotVerification.cpp | 75 + .../ext/td/td/telegram/BotVerification.h | 65 + .../ext/td/td/telegram/BotVerification.hpp | 33 + .../td/td/telegram/BotVerifierSettings.cpp | 76 + .../ext/td/td/telegram/BotVerifierSettings.h | 62 + .../td/td/telegram/BotVerifierSettings.hpp | 43 + .../td/td/telegram/BusinessAwayMessage.cpp | 2 +- .../ext/td/td/telegram/BusinessAwayMessage.h | 2 +- .../td/td/telegram/BusinessAwayMessage.hpp | 2 +- .../telegram/BusinessAwayMessageSchedule.cpp | 2 +- .../td/telegram/BusinessAwayMessageSchedule.h | 2 +- .../telegram/BusinessAwayMessageSchedule.hpp | 2 +- .../td/td/telegram/BusinessBotManageBar.cpp | 2 +- .../ext/td/td/telegram/BusinessBotManageBar.h | 2 +- .../ext/td/td/telegram/BusinessChatLink.cpp | 2 +- .../ext/td/td/telegram/BusinessChatLink.h | 2 +- .../td/td/telegram/BusinessConnectedBot.cpp | 4 +- .../ext/td/td/telegram/BusinessConnectedBot.h | 2 +- .../td/td/telegram/BusinessConnectedBot.hpp | 2 +- .../ext/td/td/telegram/BusinessConnectionId.h | 2 +- .../td/telegram/BusinessConnectionManager.cpp | 4 +- .../td/telegram/BusinessConnectionManager.h | 2 +- .../td/telegram/BusinessGreetingMessage.cpp | 2 +- .../td/td/telegram/BusinessGreetingMessage.h | 2 +- .../td/telegram/BusinessGreetingMessage.hpp | 2 +- .../ext/td/td/telegram/BusinessInfo.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BusinessInfo.h | 2 +- .../ext/td/td/telegram/BusinessInfo.hpp | 2 +- .../ext/td/td/telegram/BusinessIntro.cpp | 2 +- lib/tgchat/ext/td/td/telegram/BusinessIntro.h | 2 +- .../ext/td/td/telegram/BusinessIntro.hpp | 2 +- .../ext/td/td/telegram/BusinessManager.cpp | 2 +- .../ext/td/td/telegram/BusinessManager.h | 2 +- .../ext/td/td/telegram/BusinessRecipients.cpp | 2 +- .../ext/td/td/telegram/BusinessRecipients.h | 2 +- .../ext/td/td/telegram/BusinessRecipients.hpp | 2 +- .../ext/td/td/telegram/BusinessWorkHours.cpp | 2 +- .../ext/td/td/telegram/BusinessWorkHours.h | 2 +- .../ext/td/td/telegram/BusinessWorkHours.hpp | 2 +- lib/tgchat/ext/td/td/telegram/CallActor.cpp | 102 +- lib/tgchat/ext/td/td/telegram/CallActor.h | 30 +- .../ext/td/td/telegram/CallDiscardReason.cpp | 103 +- .../ext/td/td/telegram/CallDiscardReason.h | 23 +- lib/tgchat/ext/td/td/telegram/CallId.h | 2 +- lib/tgchat/ext/td/td/telegram/CallManager.cpp | 26 +- lib/tgchat/ext/td/td/telegram/CallManager.h | 14 +- .../td/td/telegram/CallbackQueriesManager.cpp | 2 +- .../td/td/telegram/CallbackQueriesManager.h | 2 +- lib/tgchat/ext/td/td/telegram/ChainId.h | 2 +- lib/tgchat/ext/td/td/telegram/ChannelId.h | 2 +- .../td/telegram/ChannelParticipantFilter.cpp | 2 +- .../td/td/telegram/ChannelParticipantFilter.h | 2 +- .../telegram/ChannelRecommendationManager.cpp | 2 +- .../telegram/ChannelRecommendationManager.h | 2 +- lib/tgchat/ext/td/td/telegram/ChannelType.h | 2 +- lib/tgchat/ext/td/td/telegram/ChatId.h | 2 +- lib/tgchat/ext/td/td/telegram/ChatManager.cpp | 104 +- lib/tgchat/ext/td/td/telegram/ChatManager.h | 14 +- .../ext/td/td/telegram/ChatReactions.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ChatReactions.h | 2 +- .../ext/td/td/telegram/ChatReactions.hpp | 2 +- lib/tgchat/ext/td/td/telegram/Client.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Client.h | 2 +- lib/tgchat/ext/td/td/telegram/ClientActor.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ClientActor.h | 2 +- .../ext/td/td/telegram/ClientDotNet.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ClientJson.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ClientJson.h | 2 +- .../td/td/telegram/CommonDialogManager.cpp | 2 +- .../ext/td/td/telegram/CommonDialogManager.h | 2 +- .../ext/td/td/telegram/ConfigManager.cpp | 137 +- lib/tgchat/ext/td/td/telegram/ConfigManager.h | 20 +- .../ext/td/td/telegram/ConnectionState.cpp | 2 +- .../ext/td/td/telegram/ConnectionState.h | 2 +- .../td/td/telegram/ConnectionStateManager.cpp | 2 +- .../td/td/telegram/ConnectionStateManager.h | 2 +- lib/tgchat/ext/td/td/telegram/Contact.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Contact.h | 2 +- .../ext/td/td/telegram/CountryInfoManager.cpp | 2 +- .../ext/td/td/telegram/CountryInfoManager.h | 2 +- lib/tgchat/ext/td/td/telegram/CustomEmojiId.h | 2 +- .../ext/td/td/telegram/DelayDispatcher.cpp | 2 +- .../ext/td/td/telegram/DelayDispatcher.h | 2 +- .../ext/td/td/telegram/Dependencies.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Dependencies.h | 2 +- .../ext/td/td/telegram/DeviceTokenManager.cpp | 2 +- .../ext/td/td/telegram/DeviceTokenManager.h | 2 +- lib/tgchat/ext/td/td/telegram/DhCache.cpp | 2 +- lib/tgchat/ext/td/td/telegram/DhCache.h | 2 +- lib/tgchat/ext/td/td/telegram/DhConfig.h | 2 +- .../ext/td/td/telegram/DialogAction.cpp | 3 +- lib/tgchat/ext/td/td/telegram/DialogAction.h | 2 +- .../ext/td/td/telegram/DialogActionBar.cpp | 2 +- .../ext/td/td/telegram/DialogActionBar.h | 2 +- .../td/td/telegram/DialogActionManager.cpp | 2 +- .../ext/td/td/telegram/DialogActionManager.h | 2 +- .../td/td/telegram/DialogAdministrator.cpp | 2 +- .../ext/td/td/telegram/DialogAdministrator.h | 2 +- .../ext/td/td/telegram/DialogBoostLinkInfo.h | 2 +- lib/tgchat/ext/td/td/telegram/DialogDate.h | 2 +- lib/tgchat/ext/td/td/telegram/DialogDb.cpp | 2 +- lib/tgchat/ext/td/td/telegram/DialogDb.h | 2 +- .../ext/td/td/telegram/DialogEventLog.cpp | 2 +- .../ext/td/td/telegram/DialogEventLog.h | 2 +- .../ext/td/td/telegram/DialogFilter.cpp | 63 +- lib/tgchat/ext/td/td/telegram/DialogFilter.h | 8 +- .../ext/td/td/telegram/DialogFilter.hpp | 19 +- .../td/td/telegram/DialogFilterDialogInfo.h | 2 +- .../ext/td/td/telegram/DialogFilterId.h | 2 +- .../td/td/telegram/DialogFilterInviteLink.cpp | 2 +- .../td/td/telegram/DialogFilterInviteLink.h | 2 +- .../td/td/telegram/DialogFilterManager.cpp | 11 +- .../ext/td/td/telegram/DialogFilterManager.h | 2 +- lib/tgchat/ext/td/td/telegram/DialogId.cpp | 2 +- lib/tgchat/ext/td/td/telegram/DialogId.h | 2 +- .../ext/td/td/telegram/DialogInviteLink.cpp | 2 +- .../ext/td/td/telegram/DialogInviteLink.h | 2 +- .../ext/td/td/telegram/DialogInviteLink.hpp | 2 +- .../td/telegram/DialogInviteLinkManager.cpp | 22 +- .../td/td/telegram/DialogInviteLinkManager.h | 4 +- lib/tgchat/ext/td/td/telegram/DialogListId.h | 2 +- .../ext/td/td/telegram/DialogLocation.cpp | 2 +- .../ext/td/td/telegram/DialogLocation.h | 2 +- .../ext/td/td/telegram/DialogManager.cpp | 878 +++++++++- lib/tgchat/ext/td/td/telegram/DialogManager.h | 50 +- .../telegram/DialogNotificationSettings.cpp | 2 +- .../td/telegram/DialogNotificationSettings.h | 2 +- .../telegram/DialogNotificationSettings.hpp | 2 +- .../ext/td/td/telegram/DialogParticipant.cpp | 2 +- .../ext/td/td/telegram/DialogParticipant.h | 2 +- .../td/telegram/DialogParticipantFilter.cpp | 2 +- .../td/td/telegram/DialogParticipantFilter.h | 2 +- .../td/telegram/DialogParticipantManager.cpp | 2 +- .../td/td/telegram/DialogParticipantManager.h | 2 +- .../ext/td/td/telegram/DialogSource.cpp | 2 +- lib/tgchat/ext/td/td/telegram/DialogSource.h | 2 +- lib/tgchat/ext/td/td/telegram/Dimensions.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Dimensions.h | 2 +- lib/tgchat/ext/td/td/telegram/Dimensions.hpp | 2 +- lib/tgchat/ext/td/td/telegram/Document.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Document.h | 2 +- lib/tgchat/ext/td/td/telegram/Document.hpp | 2 +- .../ext/td/td/telegram/DocumentsManager.cpp | 17 +- .../ext/td/td/telegram/DocumentsManager.h | 4 +- .../ext/td/td/telegram/DocumentsManager.hpp | 2 +- .../ext/td/td/telegram/DownloadManager.cpp | 7 +- .../ext/td/td/telegram/DownloadManager.h | 2 +- .../td/telegram/DownloadManagerCallback.cpp | 2 +- .../td/td/telegram/DownloadManagerCallback.h | 2 +- .../ext/td/td/telegram/DraftMessage.cpp | 2 +- lib/tgchat/ext/td/td/telegram/DraftMessage.h | 2 +- .../ext/td/td/telegram/DraftMessage.hpp | 2 +- .../ext/td/td/telegram/EmailVerification.cpp | 2 +- .../ext/td/td/telegram/EmailVerification.h | 2 +- lib/tgchat/ext/td/td/telegram/EmojiGroup.cpp | 2 +- lib/tgchat/ext/td/td/telegram/EmojiGroup.h | 2 +- lib/tgchat/ext/td/td/telegram/EmojiGroup.hpp | 2 +- .../ext/td/td/telegram/EmojiGroupType.cpp | 2 +- .../ext/td/td/telegram/EmojiGroupType.h | 2 +- lib/tgchat/ext/td/td/telegram/EmojiStatus.cpp | 2 +- lib/tgchat/ext/td/td/telegram/EmojiStatus.h | 2 +- lib/tgchat/ext/td/td/telegram/EncryptedFile.h | 2 +- lib/tgchat/ext/td/td/telegram/FactCheck.cpp | 2 +- lib/tgchat/ext/td/td/telegram/FactCheck.h | 2 +- lib/tgchat/ext/td/td/telegram/FactCheck.hpp | 2 +- .../td/td/telegram/FileReferenceManager.cpp | 2 +- .../ext/td/td/telegram/FileReferenceManager.h | 2 +- .../td/td/telegram/FileReferenceManager.hpp | 2 +- lib/tgchat/ext/td/td/telegram/FolderId.h | 2 +- lib/tgchat/ext/td/td/telegram/ForumTopic.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ForumTopic.h | 2 +- lib/tgchat/ext/td/td/telegram/ForumTopic.hpp | 2 +- .../td/td/telegram/ForumTopicEditedData.cpp | 2 +- .../ext/td/td/telegram/ForumTopicEditedData.h | 2 +- .../td/td/telegram/ForumTopicEditedData.hpp | 2 +- .../ext/td/td/telegram/ForumTopicIcon.cpp | 2 +- .../ext/td/td/telegram/ForumTopicIcon.h | 2 +- .../ext/td/td/telegram/ForumTopicIcon.hpp | 2 +- .../ext/td/td/telegram/ForumTopicInfo.cpp | 2 +- .../ext/td/td/telegram/ForumTopicInfo.h | 2 +- .../ext/td/td/telegram/ForumTopicInfo.hpp | 2 +- .../ext/td/td/telegram/ForumTopicManager.cpp | 2 +- .../ext/td/td/telegram/ForumTopicManager.h | 2 +- lib/tgchat/ext/td/td/telegram/Game.cpp | 6 +- lib/tgchat/ext/td/td/telegram/Game.h | 2 +- lib/tgchat/ext/td/td/telegram/Game.hpp | 2 +- lib/tgchat/ext/td/td/telegram/GameManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/GameManager.h | 2 +- .../ext/td/td/telegram/GitCommitHash.cpp.in | 2 +- lib/tgchat/ext/td/td/telegram/GitCommitHash.h | 2 +- .../ext/td/td/telegram/GiveawayParameters.cpp | 2 +- .../ext/td/td/telegram/GiveawayParameters.h | 2 +- .../ext/td/td/telegram/GiveawayParameters.hpp | 2 +- lib/tgchat/ext/td/td/telegram/Global.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Global.h | 33 +- .../td/td/telegram/GlobalPrivacySettings.cpp | 6 +- .../td/td/telegram/GlobalPrivacySettings.h | 2 +- lib/tgchat/ext/td/td/telegram/GroupCallId.h | 2 +- .../ext/td/td/telegram/GroupCallManager.cpp | 11 +- .../ext/td/td/telegram/GroupCallManager.h | 6 +- .../td/td/telegram/GroupCallParticipant.cpp | 4 +- .../ext/td/td/telegram/GroupCallParticipant.h | 2 +- .../td/telegram/GroupCallParticipantOrder.cpp | 2 +- .../td/telegram/GroupCallParticipantOrder.h | 2 +- .../td/td/telegram/GroupCallVideoPayload.cpp | 2 +- .../td/td/telegram/GroupCallVideoPayload.h | 2 +- .../ext/td/td/telegram/HashtagHints.cpp | 2 +- lib/tgchat/ext/td/td/telegram/HashtagHints.h | 2 +- .../td/td/telegram/InlineMessageManager.cpp | 2 +- .../ext/td/td/telegram/InlineMessageManager.h | 2 +- .../td/td/telegram/InlineQueriesManager.cpp | 56 +- .../ext/td/td/telegram/InlineQueriesManager.h | 7 +- .../td/td/telegram/InputBusinessChatLink.cpp | 2 +- .../td/td/telegram/InputBusinessChatLink.h | 2 +- .../ext/td/td/telegram/InputDialogId.cpp | 21 +- lib/tgchat/ext/td/td/telegram/InputDialogId.h | 4 +- .../ext/td/td/telegram/InputGroupCallId.cpp | 2 +- .../ext/td/td/telegram/InputGroupCallId.h | 2 +- .../ext/td/td/telegram/InputInvoice.cpp | 2 +- lib/tgchat/ext/td/td/telegram/InputInvoice.h | 2 +- .../ext/td/td/telegram/InputInvoice.hpp | 2 +- .../ext/td/td/telegram/InputMessageText.cpp | 2 +- .../ext/td/td/telegram/InputMessageText.h | 2 +- .../ext/td/td/telegram/InputMessageText.hpp | 2 +- lib/tgchat/ext/td/td/telegram/JsonValue.cpp | 2 +- lib/tgchat/ext/td/td/telegram/JsonValue.h | 2 +- .../ext/td/td/telegram/LabeledPricePart.h | 2 +- .../td/td/telegram/LanguagePackManager.cpp | 2 +- .../ext/td/td/telegram/LanguagePackManager.h | 2 +- lib/tgchat/ext/td/td/telegram/LinkManager.cpp | 66 +- lib/tgchat/ext/td/td/telegram/LinkManager.h | 3 +- lib/tgchat/ext/td/td/telegram/Location.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Location.h | 2 +- lib/tgchat/ext/td/td/telegram/Log.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Log.h | 2 +- lib/tgchat/ext/td/td/telegram/LogDotNet.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Logging.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Logging.h | 2 +- lib/tgchat/ext/td/td/telegram/MediaArea.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MediaArea.h | 2 +- lib/tgchat/ext/td/td/telegram/MediaArea.hpp | 2 +- .../td/td/telegram/MediaAreaCoordinates.cpp | 2 +- .../ext/td/td/telegram/MediaAreaCoordinates.h | 2 +- .../td/td/telegram/MediaAreaCoordinates.hpp | 2 +- .../ext/td/td/telegram/MessageContent.cpp | 318 +++- .../ext/td/td/telegram/MessageContent.h | 7 +- .../ext/td/td/telegram/MessageContentType.cpp | 94 +- .../ext/td/td/telegram/MessageContentType.h | 7 +- .../ext/td/td/telegram/MessageCopyOptions.h | 11 +- lib/tgchat/ext/td/td/telegram/MessageDb.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageDb.h | 2 +- .../ext/td/td/telegram/MessageEffectId.h | 2 +- .../ext/td/td/telegram/MessageEntity.cpp | 17 +- lib/tgchat/ext/td/td/telegram/MessageEntity.h | 4 +- .../ext/td/td/telegram/MessageEntity.hpp | 2 +- .../td/td/telegram/MessageExtendedMedia.cpp | 4 +- .../ext/td/td/telegram/MessageExtendedMedia.h | 6 +- .../td/td/telegram/MessageExtendedMedia.hpp | 2 +- .../ext/td/td/telegram/MessageForwardInfo.cpp | 2 +- .../ext/td/td/telegram/MessageForwardInfo.h | 2 +- .../ext/td/td/telegram/MessageForwardInfo.hpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageFullId.h | 6 +- lib/tgchat/ext/td/td/telegram/MessageId.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageId.h | 2 +- .../td/td/telegram/MessageImportManager.cpp | 2 +- .../ext/td/td/telegram/MessageImportManager.h | 2 +- .../td/td/telegram/MessageInputReplyTo.cpp | 2 +- .../ext/td/td/telegram/MessageInputReplyTo.h | 2 +- .../td/td/telegram/MessageInputReplyTo.hpp | 2 +- .../ext/td/td/telegram/MessageLinkInfo.h | 2 +- .../ext/td/td/telegram/MessageOrigin.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageOrigin.h | 2 +- .../ext/td/td/telegram/MessageOrigin.hpp | 2 +- .../td/td/telegram/MessageQueryManager.cpp | 550 ++++++ .../ext/td/td/telegram/MessageQueryManager.h | 74 + .../ext/td/td/telegram/MessageQuote.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageQuote.h | 2 +- .../ext/td/td/telegram/MessageQuote.hpp | 2 +- .../ext/td/td/telegram/MessageReaction.cpp | 2 +- .../ext/td/td/telegram/MessageReaction.h | 2 +- .../ext/td/td/telegram/MessageReaction.hpp | 2 +- .../ext/td/td/telegram/MessageReactor.cpp | 2 +- .../ext/td/td/telegram/MessageReactor.h | 2 +- .../ext/td/td/telegram/MessageReactor.hpp | 2 +- .../ext/td/td/telegram/MessageReplyHeader.cpp | 2 +- .../ext/td/td/telegram/MessageReplyHeader.h | 2 +- .../ext/td/td/telegram/MessageReplyInfo.cpp | 2 +- .../ext/td/td/telegram/MessageReplyInfo.h | 2 +- .../ext/td/td/telegram/MessageReplyInfo.hpp | 2 +- .../td/td/telegram/MessageSearchFilter.cpp | 2 +- .../ext/td/td/telegram/MessageSearchFilter.h | 2 +- .../td/td/telegram/MessageSearchOffset.cpp | 2 +- .../ext/td/td/telegram/MessageSearchOffset.h | 2 +- .../td/telegram/MessageSelfDestructType.cpp | 2 +- .../td/td/telegram/MessageSelfDestructType.h | 2 +- .../ext/td/td/telegram/MessageSender.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageSender.h | 2 +- .../ext/td/td/telegram/MessageSource.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageSource.h | 2 +- .../ext/td/td/telegram/MessageThreadDb.cpp | 2 +- .../ext/td/td/telegram/MessageThreadDb.h | 2 +- .../ext/td/td/telegram/MessageThreadInfo.h | 2 +- lib/tgchat/ext/td/td/telegram/MessageTtl.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageTtl.h | 2 +- .../ext/td/td/telegram/MessageViewer.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessageViewer.h | 2 +- .../ext/td/td/telegram/MessagesInfo.cpp | 2 +- lib/tgchat/ext/td/td/telegram/MessagesInfo.h | 2 +- .../ext/td/td/telegram/MessagesManager.cpp | 1505 +---------------- .../ext/td/td/telegram/MessagesManager.h | 105 +- lib/tgchat/ext/td/td/telegram/MinChannel.h | 2 +- lib/tgchat/ext/td/td/telegram/MinChannel.hpp | 2 +- .../ext/td/td/telegram/MissingInvitee.cpp | 2 +- .../ext/td/td/telegram/MissingInvitee.h | 2 +- .../ext/td/td/telegram/NewPasswordState.cpp | 2 +- .../ext/td/td/telegram/NewPasswordState.h | 2 +- lib/tgchat/ext/td/td/telegram/Notification.h | 2 +- .../telegram/NotificationGroupFromDatabase.h | 2 +- .../ext/td/td/telegram/NotificationGroupId.h | 2 +- .../td/td/telegram/NotificationGroupInfo.cpp | 2 +- .../td/td/telegram/NotificationGroupInfo.h | 2 +- .../td/td/telegram/NotificationGroupInfo.hpp | 2 +- .../ext/td/td/telegram/NotificationGroupKey.h | 2 +- .../td/td/telegram/NotificationGroupType.cpp | 2 +- .../td/td/telegram/NotificationGroupType.h | 2 +- .../ext/td/td/telegram/NotificationId.h | 2 +- .../td/td/telegram/NotificationManager.cpp | 362 +--- .../ext/td/td/telegram/NotificationManager.h | 2 +- .../td/td/telegram/NotificationObjectFullId.h | 2 +- .../ext/td/td/telegram/NotificationObjectId.h | 2 +- .../telegram/NotificationSettingsManager.cpp | 56 +- .../td/telegram/NotificationSettingsManager.h | 13 +- .../td/telegram/NotificationSettingsScope.cpp | 2 +- .../td/telegram/NotificationSettingsScope.h | 2 +- .../ext/td/td/telegram/NotificationSound.cpp | 2 +- .../ext/td/td/telegram/NotificationSound.h | 2 +- .../td/td/telegram/NotificationSoundType.h | 2 +- .../ext/td/td/telegram/NotificationType.cpp | 8 +- .../ext/td/td/telegram/NotificationType.h | 2 +- .../ext/td/td/telegram/OnlineManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/OnlineManager.h | 2 +- .../ext/td/td/telegram/OptionManager.cpp | 9 +- lib/tgchat/ext/td/td/telegram/OptionManager.h | 2 +- lib/tgchat/ext/td/td/telegram/OrderInfo.cpp | 2 +- lib/tgchat/ext/td/td/telegram/OrderInfo.h | 2 +- lib/tgchat/ext/td/td/telegram/OrderInfo.hpp | 2 +- .../ext/td/td/telegram/OrderedMessage.cpp | 2 +- .../ext/td/td/telegram/OrderedMessage.h | 2 +- lib/tgchat/ext/td/td/telegram/Outline.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Outline.h | 2 +- .../ext/td/td/telegram/PasswordManager.cpp | 16 +- .../ext/td/td/telegram/PasswordManager.h | 2 +- lib/tgchat/ext/td/td/telegram/Payments.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Payments.h | 2 +- lib/tgchat/ext/td/td/telegram/PeerColor.cpp | 2 +- lib/tgchat/ext/td/td/telegram/PeerColor.h | 2 +- .../td/td/telegram/PeopleNearbyManager.cpp | 2 +- .../ext/td/td/telegram/PeopleNearbyManager.h | 2 +- .../ext/td/td/telegram/PhoneNumberManager.cpp | 6 +- .../ext/td/td/telegram/PhoneNumberManager.h | 2 +- lib/tgchat/ext/td/td/telegram/Photo.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Photo.h | 2 +- lib/tgchat/ext/td/td/telegram/Photo.hpp | 2 +- lib/tgchat/ext/td/td/telegram/PhotoFormat.h | 2 +- lib/tgchat/ext/td/td/telegram/PhotoSize.cpp | 2 +- lib/tgchat/ext/td/td/telegram/PhotoSize.h | 2 +- lib/tgchat/ext/td/td/telegram/PhotoSize.hpp | 2 +- .../ext/td/td/telegram/PhotoSizeSource.cpp | 2 +- .../ext/td/td/telegram/PhotoSizeSource.h | 2 +- .../ext/td/td/telegram/PhotoSizeSource.hpp | 2 +- lib/tgchat/ext/td/td/telegram/PhotoSizeType.h | 2 +- .../ext/td/td/telegram/PhotoSizeType.hpp | 2 +- lib/tgchat/ext/td/td/telegram/PollId.h | 2 +- lib/tgchat/ext/td/td/telegram/PollId.hpp | 2 +- lib/tgchat/ext/td/td/telegram/PollManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/PollManager.h | 2 +- lib/tgchat/ext/td/td/telegram/PollManager.hpp | 2 +- lib/tgchat/ext/td/td/telegram/Premium.cpp | 6 +- lib/tgchat/ext/td/td/telegram/Premium.h | 2 +- .../ext/td/td/telegram/PremiumGiftOption.cpp | 2 +- .../ext/td/td/telegram/PremiumGiftOption.h | 2 +- .../ext/td/td/telegram/PremiumGiftOption.hpp | 2 +- .../ext/td/td/telegram/PrivacyManager.cpp | 2 +- .../ext/td/td/telegram/PrivacyManager.h | 2 +- .../ext/td/td/telegram/PromoDataManager.cpp | 56 +- .../ext/td/td/telegram/PromoDataManager.h | 7 +- lib/tgchat/ext/td/td/telegram/PtsManager.h | 2 +- .../ext/td/td/telegram/PublicDialogType.h | 2 +- .../ext/td/td/telegram/QueryCombiner.cpp | 2 +- lib/tgchat/ext/td/td/telegram/QueryCombiner.h | 2 +- lib/tgchat/ext/td/td/telegram/QueryMerger.cpp | 2 +- lib/tgchat/ext/td/td/telegram/QueryMerger.h | 2 +- .../ext/td/td/telegram/QuickReplyManager.cpp | 4 +- .../ext/td/td/telegram/QuickReplyManager.h | 2 +- .../td/td/telegram/QuickReplyMessageFullId.h | 2 +- .../ext/td/td/telegram/QuickReplyShortcutId.h | 2 +- .../ext/td/td/telegram/ReactionListType.cpp | 2 +- .../ext/td/td/telegram/ReactionListType.h | 2 +- .../ext/td/td/telegram/ReactionManager.cpp | 18 +- .../ext/td/td/telegram/ReactionManager.h | 6 +- .../ext/td/td/telegram/ReactionManager.hpp | 2 +- .../telegram/ReactionNotificationSettings.cpp | 2 +- .../telegram/ReactionNotificationSettings.h | 2 +- .../telegram/ReactionNotificationSettings.hpp | 2 +- .../td/telegram/ReactionNotificationsFrom.cpp | 2 +- .../td/telegram/ReactionNotificationsFrom.h | 2 +- .../td/telegram/ReactionNotificationsFrom.hpp | 2 +- .../ext/td/td/telegram/ReactionType.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ReactionType.h | 2 +- .../ext/td/td/telegram/ReactionType.hpp | 2 +- .../telegram/ReactionUnavailabilityReason.h | 2 +- .../ext/td/td/telegram/RecentDialogList.cpp | 2 +- .../ext/td/td/telegram/RecentDialogList.h | 2 +- .../td/td/telegram/ReferralProgramInfo.cpp | 45 + .../ext/td/td/telegram/ReferralProgramInfo.h | 58 + .../td/td/telegram/ReferralProgramInfo.hpp | 56 + .../td/td/telegram/ReferralProgramManager.cpp | 497 ++++++ .../td/td/telegram/ReferralProgramManager.h | 103 ++ .../td/telegram/ReferralProgramParameters.cpp | 44 + .../td/telegram/ReferralProgramParameters.h | 60 + .../td/telegram/ReferralProgramParameters.hpp | 43 + .../td/telegram/ReferralProgramSortOrder.cpp | 29 + .../td/td/telegram/ReferralProgramSortOrder.h | 21 + .../ext/td/td/telegram/RepliedMessageInfo.cpp | 2 +- .../ext/td/td/telegram/RepliedMessageInfo.h | 2 +- .../ext/td/td/telegram/RepliedMessageInfo.hpp | 2 +- lib/tgchat/ext/td/td/telegram/ReplyMarkup.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ReplyMarkup.h | 2 +- lib/tgchat/ext/td/td/telegram/ReplyMarkup.hpp | 2 +- .../ext/td/td/telegram/ReportReason.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ReportReason.h | 2 +- lib/tgchat/ext/td/td/telegram/RequestActor.h | 2 +- .../td/td/telegram/RequestedDialogType.cpp | 2 +- .../ext/td/td/telegram/RequestedDialogType.h | 2 +- .../td/td/telegram/RequestedDialogType.hpp | 2 +- lib/tgchat/ext/td/td/telegram/Requests.cpp | 159 +- lib/tgchat/ext/td/td/telegram/Requests.h | 32 +- .../ext/td/td/telegram/RestrictionReason.cpp | 2 +- .../ext/td/td/telegram/RestrictionReason.h | 2 +- .../td/td/telegram/SavedMessagesManager.cpp | 24 +- .../ext/td/td/telegram/SavedMessagesManager.h | 7 +- .../td/td/telegram/SavedMessagesTopicId.cpp | 4 +- .../ext/td/td/telegram/SavedMessagesTopicId.h | 2 +- .../td/td/telegram/ScheduledServerMessageId.h | 2 +- .../td/telegram/ScopeNotificationSettings.cpp | 2 +- .../td/telegram/ScopeNotificationSettings.h | 2 +- .../td/telegram/ScopeNotificationSettings.hpp | 2 +- .../ext/td/td/telegram/SecretChatActor.cpp | 4 +- .../ext/td/td/telegram/SecretChatActor.h | 4 +- .../ext/td/td/telegram/SecretChatDb.cpp | 2 +- lib/tgchat/ext/td/td/telegram/SecretChatDb.h | 2 +- lib/tgchat/ext/td/td/telegram/SecretChatId.h | 2 +- .../ext/td/td/telegram/SecretChatLayer.h | 2 +- .../ext/td/td/telegram/SecretChatsManager.cpp | 2 +- .../ext/td/td/telegram/SecretChatsManager.h | 2 +- .../ext/td/td/telegram/SecretInputMedia.cpp | 2 +- .../ext/td/td/telegram/SecretInputMedia.h | 2 +- .../ext/td/td/telegram/SecureManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/SecureManager.h | 2 +- .../ext/td/td/telegram/SecureStorage.cpp | 2 +- lib/tgchat/ext/td/td/telegram/SecureStorage.h | 2 +- lib/tgchat/ext/td/td/telegram/SecureValue.cpp | 2 +- lib/tgchat/ext/td/td/telegram/SecureValue.h | 2 +- lib/tgchat/ext/td/td/telegram/SecureValue.hpp | 2 +- .../ext/td/td/telegram/SendCodeHelper.cpp | 2 +- .../ext/td/td/telegram/SendCodeHelper.h | 2 +- .../ext/td/td/telegram/SendCodeHelper.hpp | 2 +- .../ext/td/td/telegram/SentEmailCode.cpp | 2 +- lib/tgchat/ext/td/td/telegram/SentEmailCode.h | 2 +- .../ext/td/td/telegram/SequenceDispatcher.cpp | 2 +- .../ext/td/td/telegram/SequenceDispatcher.h | 2 +- .../ext/td/td/telegram/ServerMessageId.h | 2 +- .../ext/td/td/telegram/SetWithPosition.h | 2 +- .../ext/td/td/telegram/SharedDialog.cpp | 2 +- lib/tgchat/ext/td/td/telegram/SharedDialog.h | 2 +- .../ext/td/td/telegram/SharedDialog.hpp | 2 +- .../td/td/telegram/SpecialStickerSetType.cpp | 2 +- .../td/td/telegram/SpecialStickerSetType.h | 2 +- .../td/telegram/SponsoredMessageManager.cpp | 2 +- .../td/td/telegram/SponsoredMessageManager.h | 2 +- lib/tgchat/ext/td/td/telegram/StarAmount.cpp | 49 + lib/tgchat/ext/td/td/telegram/StarAmount.h | 57 + lib/tgchat/ext/td/td/telegram/StarAmount.hpp | 28 + lib/tgchat/ext/td/td/telegram/StarGift.cpp | 112 +- lib/tgchat/ext/td/td/telegram/StarGift.h | 36 +- lib/tgchat/ext/td/td/telegram/StarGift.hpp | 65 +- .../ext/td/td/telegram/StarGiftAttribute.cpp | 102 ++ .../ext/td/td/telegram/StarGiftAttribute.h | 129 ++ .../ext/td/td/telegram/StarGiftAttribute.hpp | 102 ++ .../ext/td/td/telegram/StarGiftManager.cpp | 688 +++++++- .../ext/td/td/telegram/StarGiftManager.h | 60 +- lib/tgchat/ext/td/td/telegram/StarManager.cpp | 435 +++-- lib/tgchat/ext/td/td/telegram/StarManager.h | 9 +- .../ext/td/td/telegram/StarSubscription.cpp | 2 +- .../ext/td/td/telegram/StarSubscription.h | 2 +- .../td/telegram/StarSubscriptionPricing.cpp | 2 +- .../td/td/telegram/StarSubscriptionPricing.h | 2 +- .../td/telegram/StarSubscriptionPricing.hpp | 2 +- .../ext/td/td/telegram/StateManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StateManager.h | 2 +- .../ext/td/td/telegram/StatisticsManager.cpp | 2 +- .../ext/td/td/telegram/StatisticsManager.h | 2 +- .../ext/td/td/telegram/StickerFormat.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StickerFormat.h | 2 +- .../ext/td/td/telegram/StickerListType.cpp | 2 +- .../ext/td/td/telegram/StickerListType.h | 2 +- .../td/td/telegram/StickerMaskPosition.cpp | 2 +- .../ext/td/td/telegram/StickerMaskPosition.h | 2 +- .../td/td/telegram/StickerMaskPosition.hpp | 2 +- .../ext/td/td/telegram/StickerPhotoSize.cpp | 2 +- .../ext/td/td/telegram/StickerPhotoSize.h | 2 +- .../ext/td/td/telegram/StickerPhotoSize.hpp | 2 +- .../ext/td/td/telegram/StickerSetId.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StickerSetId.h | 2 +- lib/tgchat/ext/td/td/telegram/StickerType.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StickerType.h | 2 +- .../ext/td/td/telegram/StickersManager.cpp | 125 +- .../ext/td/td/telegram/StickersManager.h | 13 +- .../ext/td/td/telegram/StickersManager.hpp | 2 +- .../ext/td/td/telegram/StorageManager.cpp | 3 +- .../ext/td/td/telegram/StorageManager.h | 2 +- .../ext/td/td/telegram/StoryContent.cpp | 8 +- lib/tgchat/ext/td/td/telegram/StoryContent.h | 2 +- .../ext/td/td/telegram/StoryContentType.cpp | 2 +- .../ext/td/td/telegram/StoryContentType.h | 2 +- lib/tgchat/ext/td/td/telegram/StoryDb.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StoryDb.h | 2 +- .../ext/td/td/telegram/StoryForwardInfo.cpp | 2 +- .../ext/td/td/telegram/StoryForwardInfo.h | 2 +- .../ext/td/td/telegram/StoryForwardInfo.hpp | 2 +- lib/tgchat/ext/td/td/telegram/StoryFullId.h | 2 +- lib/tgchat/ext/td/td/telegram/StoryId.h | 2 +- .../td/td/telegram/StoryInteractionInfo.cpp | 2 +- .../ext/td/td/telegram/StoryInteractionInfo.h | 2 +- .../td/td/telegram/StoryInteractionInfo.hpp | 2 +- lib/tgchat/ext/td/td/telegram/StoryListId.h | 2 +- .../ext/td/td/telegram/StoryManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StoryManager.h | 2 +- .../td/telegram/StoryNotificationSettings.h | 2 +- .../ext/td/td/telegram/StoryStealthMode.cpp | 2 +- .../ext/td/td/telegram/StoryStealthMode.h | 2 +- .../ext/td/td/telegram/StoryStealthMode.hpp | 2 +- lib/tgchat/ext/td/td/telegram/StoryViewer.cpp | 2 +- lib/tgchat/ext/td/td/telegram/StoryViewer.h | 2 +- .../ext/td/td/telegram/SuggestedAction.cpp | 23 +- .../ext/td/td/telegram/SuggestedAction.h | 19 +- .../ext/td/td/telegram/SuggestedAction.hpp | 2 +- .../td/td/telegram/SuggestedActionManager.cpp | 236 +++ .../td/td/telegram/SuggestedActionManager.h | 61 + lib/tgchat/ext/td/td/telegram/Support.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Support.h | 2 +- .../td/td/telegram/SynchronousRequests.cpp | 5 +- .../ext/td/td/telegram/SynchronousRequests.h | 2 +- .../ext/td/td/telegram/TargetDialogTypes.cpp | 2 +- .../ext/td/td/telegram/TargetDialogTypes.h | 2 +- lib/tgchat/ext/td/td/telegram/Td.cpp | 32 +- lib/tgchat/ext/td/td/telegram/Td.h | 14 +- lib/tgchat/ext/td/td/telegram/TdCallback.h | 2 +- lib/tgchat/ext/td/td/telegram/TdDb.cpp | 18 +- lib/tgchat/ext/td/td/telegram/TdDb.h | 3 +- .../ext/td/td/telegram/TermsOfService.cpp | 2 +- .../ext/td/td/telegram/TermsOfService.h | 2 +- .../ext/td/td/telegram/TermsOfService.hpp | 2 +- .../td/td/telegram/TermsOfServiceManager.cpp | 2 +- .../td/td/telegram/TermsOfServiceManager.h | 2 +- .../ext/td/td/telegram/ThemeManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ThemeManager.h | 2 +- .../ext/td/td/telegram/ThemeSettings.cpp | 2 +- lib/tgchat/ext/td/td/telegram/ThemeSettings.h | 2 +- .../ext/td/td/telegram/ThemeSettings.hpp | 2 +- .../ext/td/td/telegram/TimeZoneManager.cpp | 2 +- .../ext/td/td/telegram/TimeZoneManager.h | 2 +- .../ext/td/td/telegram/TopDialogCategory.cpp | 2 +- .../ext/td/td/telegram/TopDialogCategory.h | 2 +- .../ext/td/td/telegram/TopDialogManager.cpp | 2 +- .../ext/td/td/telegram/TopDialogManager.h | 2 +- .../ext/td/td/telegram/TranscriptionInfo.cpp | 2 +- .../ext/td/td/telegram/TranscriptionInfo.h | 2 +- .../ext/td/td/telegram/TranscriptionInfo.hpp | 2 +- .../td/td/telegram/TranscriptionManager.cpp | 2 +- .../ext/td/td/telegram/TranscriptionManager.h | 2 +- .../ext/td/td/telegram/TranslationManager.cpp | 2 +- .../ext/td/td/telegram/TranslationManager.h | 2 +- lib/tgchat/ext/td/td/telegram/UniqueId.h | 2 +- .../ext/td/td/telegram/UpdatesManager.cpp | 12 +- .../ext/td/td/telegram/UpdatesManager.h | 2 +- lib/tgchat/ext/td/td/telegram/UserId.h | 2 +- lib/tgchat/ext/td/td/telegram/UserManager.cpp | 167 +- lib/tgchat/ext/td/td/telegram/UserManager.h | 22 +- .../ext/td/td/telegram/UserPrivacySetting.cpp | 2 +- .../ext/td/td/telegram/UserPrivacySetting.h | 2 +- .../td/td/telegram/UserPrivacySettingRule.cpp | 2 +- .../td/td/telegram/UserPrivacySettingRule.h | 2 +- .../ext/td/td/telegram/UserStarGift.cpp | 62 + lib/tgchat/ext/td/td/telegram/UserStarGift.h | 48 + lib/tgchat/ext/td/td/telegram/Usernames.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Usernames.h | 2 +- lib/tgchat/ext/td/td/telegram/Venue.cpp | 2 +- lib/tgchat/ext/td/td/telegram/Venue.h | 2 +- .../ext/td/td/telegram/VerificationStatus.cpp | 20 + .../ext/td/td/telegram/VerificationStatus.h | 19 + lib/tgchat/ext/td/td/telegram/Version.h | 4 +- .../ext/td/td/telegram/VideoNotesManager.cpp | 2 +- .../ext/td/td/telegram/VideoNotesManager.h | 2 +- .../ext/td/td/telegram/VideoNotesManager.hpp | 2 +- .../ext/td/td/telegram/VideosManager.cpp | 2 +- lib/tgchat/ext/td/td/telegram/VideosManager.h | 2 +- .../ext/td/td/telegram/VideosManager.hpp | 2 +- .../ext/td/td/telegram/VoiceNotesManager.cpp | 2 +- .../ext/td/td/telegram/VoiceNotesManager.h | 2 +- .../ext/td/td/telegram/VoiceNotesManager.hpp | 2 +- lib/tgchat/ext/td/td/telegram/WebApp.cpp | 4 +- lib/tgchat/ext/td/td/telegram/WebApp.h | 2 +- lib/tgchat/ext/td/td/telegram/WebApp.hpp | 2 +- .../ext/td/td/telegram/WebAppManager.cpp | 6 +- lib/tgchat/ext/td/td/telegram/WebAppManager.h | 2 +- .../td/td/telegram/WebAppOpenParameters.cpp | 2 +- .../ext/td/td/telegram/WebAppOpenParameters.h | 2 +- .../ext/td/td/telegram/WebPageBlock.cpp | 2 +- lib/tgchat/ext/td/td/telegram/WebPageBlock.h | 2 +- lib/tgchat/ext/td/td/telegram/WebPageId.h | 2 +- .../ext/td/td/telegram/WebPagesManager.cpp | 8 +- .../ext/td/td/telegram/WebPagesManager.h | 2 +- lib/tgchat/ext/td/td/telegram/cli.cpp | 163 +- .../ext/td/td/telegram/files/FileBitmask.cpp | 2 +- .../ext/td/td/telegram/files/FileBitmask.h | 2 +- .../ext/td/td/telegram/files/FileData.h | 2 +- .../ext/td/td/telegram/files/FileData.hpp | 2 +- .../ext/td/td/telegram/files/FileDb.cpp | 2 +- lib/tgchat/ext/td/td/telegram/files/FileDb.h | 2 +- .../ext/td/td/telegram/files/FileDbId.h | 2 +- .../td/telegram/files/FileDownloadManager.cpp | 2 +- .../td/telegram/files/FileDownloadManager.h | 2 +- .../td/td/telegram/files/FileDownloader.cpp | 10 +- .../ext/td/td/telegram/files/FileDownloader.h | 2 +- .../td/telegram/files/FileEncryptionKey.cpp | 2 +- .../td/td/telegram/files/FileEncryptionKey.h | 2 +- .../td/td/telegram/files/FileFromBytes.cpp | 2 +- .../ext/td/td/telegram/files/FileFromBytes.h | 2 +- .../td/td/telegram/files/FileGcParameters.cpp | 2 +- .../td/td/telegram/files/FileGcParameters.h | 2 +- .../ext/td/td/telegram/files/FileGcWorker.cpp | 12 +- .../ext/td/td/telegram/files/FileGcWorker.h | 7 +- .../td/telegram/files/FileGenerateManager.cpp | 2 +- .../td/telegram/files/FileGenerateManager.h | 2 +- .../td/td/telegram/files/FileHashUploader.cpp | 2 +- .../td/td/telegram/files/FileHashUploader.h | 2 +- lib/tgchat/ext/td/td/telegram/files/FileId.h | 2 +- .../ext/td/td/telegram/files/FileId.hpp | 2 +- .../td/td/telegram/files/FileLoadManager.cpp | 2 +- .../td/td/telegram/files/FileLoadManager.h | 2 +- .../td/td/telegram/files/FileLoaderActor.h | 2 +- .../td/td/telegram/files/FileLoaderUtils.cpp | 4 +- .../td/td/telegram/files/FileLoaderUtils.h | 2 +- .../ext/td/td/telegram/files/FileLocation.h | 3 +- .../ext/td/td/telegram/files/FileLocation.hpp | 5 +- .../ext/td/td/telegram/files/FileManager.cpp | 10 +- .../ext/td/td/telegram/files/FileManager.h | 2 +- .../ext/td/td/telegram/files/FileManager.hpp | 2 +- .../ext/td/td/telegram/files/FileSourceId.h | 2 +- .../ext/td/td/telegram/files/FileSourceId.hpp | 2 +- .../ext/td/td/telegram/files/FileStats.cpp | 2 +- .../ext/td/td/telegram/files/FileStats.h | 2 +- .../td/td/telegram/files/FileStatsWorker.cpp | 2 +- .../td/td/telegram/files/FileStatsWorker.h | 2 +- .../ext/td/td/telegram/files/FileType.cpp | 42 +- .../ext/td/td/telegram/files/FileType.h | 6 +- .../ext/td/td/telegram/files/FileUploadId.h | 2 +- .../td/telegram/files/FileUploadManager.cpp | 2 +- .../td/td/telegram/files/FileUploadManager.h | 2 +- .../ext/td/td/telegram/files/FileUploader.cpp | 2 +- .../ext/td/td/telegram/files/FileUploader.h | 2 +- .../ext/td/td/telegram/files/PartsManager.cpp | 76 +- .../ext/td/td/telegram/files/PartsManager.h | 7 +- .../td/td/telegram/files/ResourceManager.cpp | 2 +- .../td/td/telegram/files/ResourceManager.h | 2 +- .../td/td/telegram/files/ResourceState.cpp | 90 + .../ext/td/td/telegram/files/ResourceState.h | 82 +- .../ext/td/td/telegram/logevent/LogEvent.h | 2 +- .../td/telegram/logevent/LogEventHelper.cpp | 2 +- .../td/td/telegram/logevent/LogEventHelper.h | 2 +- .../td/td/telegram/logevent/SecretChatEvent.h | 2 +- lib/tgchat/ext/td/td/telegram/misc.cpp | 2 +- lib/tgchat/ext/td/td/telegram/misc.h | 2 +- .../ext/td/td/telegram/net/AuthDataShared.cpp | 2 +- .../ext/td/td/telegram/net/AuthDataShared.h | 2 +- .../ext/td/td/telegram/net/AuthKeyState.h | 2 +- .../td/td/telegram/net/ConnectionCreator.cpp | 7 +- .../td/td/telegram/net/ConnectionCreator.h | 2 +- .../ext/td/td/telegram/net/DcAuthManager.cpp | 2 +- .../ext/td/td/telegram/net/DcAuthManager.h | 2 +- lib/tgchat/ext/td/td/telegram/net/DcId.h | 2 +- lib/tgchat/ext/td/td/telegram/net/DcOptions.h | 2 +- .../ext/td/td/telegram/net/DcOptionsSet.cpp | 2 +- .../ext/td/td/telegram/net/DcOptionsSet.h | 2 +- .../ext/td/td/telegram/net/MtprotoHeader.cpp | 2 +- .../ext/td/td/telegram/net/MtprotoHeader.h | 2 +- .../ext/td/td/telegram/net/NetActor.cpp | 2 +- lib/tgchat/ext/td/td/telegram/net/NetActor.h | 2 +- .../ext/td/td/telegram/net/NetQuery.cpp | 2 +- lib/tgchat/ext/td/td/telegram/net/NetQuery.h | 2 +- .../ext/td/td/telegram/net/NetQueryCounter.h | 2 +- .../td/td/telegram/net/NetQueryCreator.cpp | 2 +- .../ext/td/td/telegram/net/NetQueryCreator.h | 2 +- .../td/td/telegram/net/NetQueryDelayer.cpp | 2 +- .../ext/td/td/telegram/net/NetQueryDelayer.h | 2 +- .../td/td/telegram/net/NetQueryDispatcher.cpp | 15 +- .../td/td/telegram/net/NetQueryDispatcher.h | 3 +- .../ext/td/td/telegram/net/NetQueryStats.cpp | 2 +- .../ext/td/td/telegram/net/NetQueryStats.h | 2 +- .../td/td/telegram/net/NetQueryVerifier.cpp | 2 +- .../ext/td/td/telegram/net/NetQueryVerifier.h | 2 +- .../td/td/telegram/net/NetStatsManager.cpp | 2 +- .../ext/td/td/telegram/net/NetStatsManager.h | 2 +- lib/tgchat/ext/td/td/telegram/net/NetType.h | 2 +- lib/tgchat/ext/td/td/telegram/net/Proxy.cpp | 2 +- lib/tgchat/ext/td/td/telegram/net/Proxy.h | 2 +- .../td/telegram/net/PublicRsaKeySharedCdn.cpp | 2 +- .../td/telegram/net/PublicRsaKeySharedCdn.h | 2 +- .../telegram/net/PublicRsaKeySharedMain.cpp | 2 +- .../td/telegram/net/PublicRsaKeySharedMain.h | 2 +- .../td/telegram/net/PublicRsaKeyWatchdog.cpp | 2 +- .../td/td/telegram/net/PublicRsaKeyWatchdog.h | 2 +- lib/tgchat/ext/td/td/telegram/net/Session.cpp | 2 +- lib/tgchat/ext/td/td/telegram/net/Session.h | 2 +- .../td/td/telegram/net/SessionMultiProxy.cpp | 2 +- .../td/td/telegram/net/SessionMultiProxy.h | 2 +- .../ext/td/td/telegram/net/SessionProxy.cpp | 2 +- .../ext/td/td/telegram/net/SessionProxy.h | 2 +- .../td/td/telegram/net/TempAuthKeyWatchdog.h | 2 +- lib/tgchat/ext/td/td/telegram/td_c_client.cpp | 2 +- lib/tgchat/ext/td/td/telegram/td_c_client.h | 2 +- .../ext/td/td/telegram/td_emscripten.cpp | 2 +- .../ext/td/td/telegram/td_json_client.cpp | 2 +- .../ext/td/td/telegram/td_json_client.h | 2 +- lib/tgchat/ext/td/td/telegram/td_log.cpp | 2 +- lib/tgchat/ext/td/td/telegram/td_log.h | 2 +- lib/tgchat/ext/td/td/tl/TlObject.h | 2 +- lib/tgchat/ext/td/td/tl/tl_dotnet_object.h | 2 +- lib/tgchat/ext/td/td/tl/tl_jni_object.cpp | 2 +- lib/tgchat/ext/td/td/tl/tl_jni_object.h | 2 +- lib/tgchat/ext/td/td/tl/tl_json.h | 26 +- lib/tgchat/ext/td/td/tl/tl_object_parse.h | 2 +- lib/tgchat/ext/td/td/tl/tl_object_store.h | 2 +- lib/tgchat/ext/td/tdactor/example/example.cpp | 2 +- .../tdactor/td/actor/ConcurrentScheduler.cpp | 2 +- .../td/tdactor/td/actor/ConcurrentScheduler.h | 2 +- .../ext/td/tdactor/td/actor/MultiPromise.cpp | 2 +- .../ext/td/tdactor/td/actor/MultiPromise.h | 2 +- .../ext/td/tdactor/td/actor/MultiTimeout.cpp | 2 +- .../ext/td/tdactor/td/actor/MultiTimeout.h | 2 +- .../ext/td/tdactor/td/actor/PromiseFuture.h | 2 +- .../tdactor/td/actor/SchedulerLocalStorage.h | 2 +- .../ext/td/tdactor/td/actor/SignalSlot.h | 2 +- .../ext/td/tdactor/td/actor/SleepActor.h | 2 +- lib/tgchat/ext/td/tdactor/td/actor/Timeout.h | 2 +- lib/tgchat/ext/td/tdactor/td/actor/actor.h | 2 +- .../ext/td/tdactor/td/actor/impl/Actor-decl.h | 2 +- .../ext/td/tdactor/td/actor/impl/Actor.h | 2 +- .../td/tdactor/td/actor/impl/ActorId-decl.h | 2 +- .../ext/td/tdactor/td/actor/impl/ActorId.h | 2 +- .../td/tdactor/td/actor/impl/ActorInfo-decl.h | 2 +- .../ext/td/tdactor/td/actor/impl/ActorInfo.h | 2 +- .../ext/td/tdactor/td/actor/impl/Event.h | 4 +- .../td/tdactor/td/actor/impl/EventFull-decl.h | 2 +- .../ext/td/tdactor/td/actor/impl/EventFull.h | 2 +- .../td/tdactor/td/actor/impl/Scheduler-decl.h | 2 +- .../td/tdactor/td/actor/impl/Scheduler.cpp | 2 +- .../ext/td/tdactor/td/actor/impl/Scheduler.h | 2 +- .../ext/td/tdactor/test/actors_bugs.cpp | 2 +- .../ext/td/tdactor/test/actors_main.cpp | 2 +- .../ext/td/tdactor/test/actors_simple.cpp | 2 +- .../ext/td/tdactor/test/actors_workers.cpp | 2 +- lib/tgchat/ext/td/tddb/td/db/BinlogKeyValue.h | 2 +- lib/tgchat/ext/td/tddb/td/db/DbKey.h | 2 +- .../ext/td/tddb/td/db/KeyValueSyncInterface.h | 2 +- lib/tgchat/ext/td/tddb/td/db/SeqKeyValue.h | 2 +- .../td/tddb/td/db/SqliteConnectionSafe.cpp | 2 +- .../ext/td/tddb/td/db/SqliteConnectionSafe.h | 2 +- lib/tgchat/ext/td/tddb/td/db/SqliteDb.cpp | 2 +- lib/tgchat/ext/td/tddb/td/db/SqliteDb.h | 2 +- .../ext/td/tddb/td/db/SqliteKeyValue.cpp | 2 +- lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.h | 2 +- .../ext/td/tddb/td/db/SqliteKeyValueAsync.cpp | 2 +- .../ext/td/tddb/td/db/SqliteKeyValueAsync.h | 2 +- .../ext/td/tddb/td/db/SqliteKeyValueSafe.h | 2 +- .../ext/td/tddb/td/db/SqliteStatement.cpp | 2 +- .../ext/td/tddb/td/db/SqliteStatement.h | 2 +- lib/tgchat/ext/td/tddb/td/db/TQueue.cpp | 2 +- lib/tgchat/ext/td/tddb/td/db/TQueue.h | 2 +- lib/tgchat/ext/td/tddb/td/db/TsSeqKeyValue.h | 2 +- .../ext/td/tddb/td/db/binlog/Binlog.cpp | 2 +- lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.h | 2 +- .../ext/td/tddb/td/db/binlog/BinlogEvent.cpp | 2 +- .../ext/td/tddb/td/db/binlog/BinlogEvent.h | 2 +- .../ext/td/tddb/td/db/binlog/BinlogHelper.h | 2 +- .../td/tddb/td/db/binlog/BinlogInterface.h | 2 +- .../td/tddb/td/db/binlog/ConcurrentBinlog.cpp | 2 +- .../td/tddb/td/db/binlog/ConcurrentBinlog.h | 2 +- .../ext/td/tddb/td/db/binlog/binlog_dump.cpp | 2 +- .../db/binlog/detail/BinlogEventsBuffer.cpp | 2 +- .../td/db/binlog/detail/BinlogEventsBuffer.h | 2 +- .../binlog/detail/BinlogEventsProcessor.cpp | 2 +- .../db/binlog/detail/BinlogEventsProcessor.h | 2 +- .../ext/td/tddb/td/db/detail/RawSqliteDb.cpp | 2 +- .../ext/td/tddb/td/db/detail/RawSqliteDb.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.mm | 2 +- .../td/tdnet/td/net/GetHostByNameActor.cpp | 2 +- .../ext/td/tdnet/td/net/GetHostByNameActor.h | 2 +- .../td/tdnet/td/net/HttpChunkedByteFlow.cpp | 2 +- .../ext/td/tdnet/td/net/HttpChunkedByteFlow.h | 2 +- .../td/tdnet/td/net/HttpConnectionBase.cpp | 2 +- .../ext/td/tdnet/td/net/HttpConnectionBase.h | 2 +- .../td/net/HttpContentLengthByteFlow.cpp | 2 +- .../tdnet/td/net/HttpContentLengthByteFlow.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpFile.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpFile.h | 2 +- .../ext/td/tdnet/td/net/HttpHeaderCreator.h | 2 +- .../td/tdnet/td/net/HttpInboundConnection.cpp | 2 +- .../td/tdnet/td/net/HttpInboundConnection.h | 2 +- .../tdnet/td/net/HttpOutboundConnection.cpp | 2 +- .../td/tdnet/td/net/HttpOutboundConnection.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpProxy.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpProxy.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpQuery.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpQuery.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpReader.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/HttpReader.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/NetStats.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/Socks5.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/Socks5.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/SslCtx.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/SslCtx.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/SslStream.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/SslStream.h | 2 +- .../ext/td/tdnet/td/net/TcpListener.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/TcpListener.h | 2 +- .../ext/td/tdnet/td/net/TransparentProxy.cpp | 2 +- .../ext/td/tdnet/td/net/TransparentProxy.h | 2 +- lib/tgchat/ext/td/tdnet/td/net/Wget.cpp | 2 +- lib/tgchat/ext/td/tdnet/td/net/Wget.h | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_config.cpp | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_config.h | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_core.cpp | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_core.h | 2 +- .../ext/td/tdtl/td/tl/tl_file_outputer.cpp | 2 +- .../ext/td/tdtl/td/tl/tl_file_outputer.h | 2 +- .../ext/td/tdtl/td/tl/tl_file_utils.cpp | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.h | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_generate.cpp | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_generate.h | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.cpp | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.h | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_simple.h | 2 +- .../ext/td/tdtl/td/tl/tl_simple_parser.h | 2 +- .../ext/td/tdtl/td/tl/tl_string_outputer.cpp | 2 +- .../ext/td/tdtl/td/tl/tl_string_outputer.h | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_writer.cpp | 2 +- lib/tgchat/ext/td/tdtl/td/tl/tl_writer.h | 2 +- .../generate/generate_mime_types_gperf.cpp | 2 +- .../ext/td/tdutils/td/utils/AesCtrByteFlow.h | 2 +- .../ext/td/tdutils/td/utils/AsyncFileLog.cpp | 2 +- .../ext/td/tdutils/td/utils/AsyncFileLog.h | 2 +- .../ext/td/tdutils/td/utils/AtomicRead.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/BigNum.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/BigNum.h | 2 +- .../ext/td/tdutils/td/utils/BufferedFd.h | 2 +- .../ext/td/tdutils/td/utils/BufferedReader.h | 2 +- .../ext/td/tdutils/td/utils/BufferedUdp.cpp | 2 +- .../ext/td/tdutils/td/utils/BufferedUdp.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/ByteFlow.h | 2 +- .../td/tdutils/td/utils/CancellationToken.h | 2 +- .../ext/td/tdutils/td/utils/ChainScheduler.h | 2 +- .../td/tdutils/td/utils/ChangesProcessor.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Closure.h | 2 +- .../ext/td/tdutils/td/utils/CombinedLog.h | 2 +- .../td/tdutils/td/utils/ConcurrentHashTable.h | 2 +- .../ext/td/tdutils/td/utils/Container.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Context.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/DecTree.h | 2 +- .../ext/td/tdutils/td/utils/Destructor.h | 2 +- .../ext/td/tdutils/td/utils/Enumerator.h | 2 +- .../td/utils/EpochBasedMemoryReclamation.h | 2 +- .../ext/td/tdutils/td/utils/ExitGuard.cpp | 2 +- .../ext/td/tdutils/td/utils/ExitGuard.h | 2 +- .../ext/td/tdutils/td/utils/FileLog.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/FileLog.h | 2 +- .../ext/td/tdutils/td/utils/FlatHashMap.h | 2 +- .../td/tdutils/td/utils/FlatHashMapChunks.h | 2 +- .../ext/td/tdutils/td/utils/FlatHashSet.h | 2 +- .../ext/td/tdutils/td/utils/FlatHashTable.cpp | 2 +- .../ext/td/tdutils/td/utils/FlatHashTable.h | 2 +- .../td/tdutils/td/utils/FloodControlFast.h | 2 +- .../tdutils/td/utils/FloodControlGlobal.cpp | 2 +- .../td/tdutils/td/utils/FloodControlGlobal.h | 2 +- .../td/tdutils/td/utils/FloodControlStrict.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Gzip.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Gzip.h | 2 +- .../ext/td/tdutils/td/utils/GzipByteFlow.cpp | 2 +- .../ext/td/tdutils/td/utils/GzipByteFlow.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Hash.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/HashMap.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/HashSet.h | 2 +- .../ext/td/tdutils/td/utils/HashTableUtils.h | 2 +- .../ext/td/tdutils/td/utils/HazardPointers.h | 4 +- lib/tgchat/ext/td/tdutils/td/utils/Heap.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Hints.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Hints.h | 2 +- .../ext/td/tdutils/td/utils/HttpDate.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/HttpDate.h | 2 +- .../ext/td/tdutils/td/utils/HttpUrl.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.h | 2 +- .../ext/td/tdutils/td/utils/JsonBuilder.cpp | 2 +- .../ext/td/tdutils/td/utils/JsonBuilder.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/List.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/MapNode.h | 2 +- .../ext/td/tdutils/td/utils/MemoryLog.h | 2 +- .../ext/td/tdutils/td/utils/MimeType.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/MimeType.h | 2 +- .../ext/td/tdutils/td/utils/MovableValue.h | 2 +- .../ext/td/tdutils/td/utils/MpmcQueue.cpp | 2 +- .../ext/td/tdutils/td/utils/MpmcQueue.h | 2 +- .../ext/td/tdutils/td/utils/MpmcWaiter.h | 4 +- .../ext/td/tdutils/td/utils/MpscLinkQueue.h | 2 +- .../td/tdutils/td/utils/MpscPollableQueue.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Named.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/NullLog.h | 2 +- .../ext/td/tdutils/td/utils/ObjectPool.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Observer.h | 2 +- .../ext/td/tdutils/td/utils/OptionParser.cpp | 2 +- .../ext/td/tdutils/td/utils/OptionParser.h | 2 +- .../tdutils/td/utils/OrderedEventsProcessor.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Parser.h | 2 +- .../ext/td/tdutils/td/utils/PathView.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/PathView.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Promise.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Random.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Random.h | 2 +- .../ext/td/tdutils/td/utils/ScopeGuard.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/SetNode.h | 2 +- .../td/tdutils/td/utils/SharedObjectPool.h | 2 +- .../ext/td/tdutils/td/utils/SharedSlice.cpp | 2 +- .../ext/td/tdutils/td/utils/SharedSlice.h | 2 +- .../ext/td/tdutils/td/utils/Slice-decl.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Slice.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Slice.h | 2 +- .../ext/td/tdutils/td/utils/SliceBuilder.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Span.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/SpinLock.h | 2 +- .../td/tdutils/td/utils/StackAllocator.cpp | 2 +- .../ext/td/tdutils/td/utils/StackAllocator.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Status.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Status.h | 2 +- .../ext/td/tdutils/td/utils/StealingQueue.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Storer.h | 2 +- .../ext/td/tdutils/td/utils/StorerBase.h | 2 +- .../ext/td/tdutils/td/utils/StringBuilder.cpp | 2 +- .../ext/td/tdutils/td/utils/StringBuilder.h | 2 +- .../td/tdutils/td/utils/ThreadLocalStorage.h | 2 +- .../td/tdutils/td/utils/ThreadSafeCounter.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Time.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Time.h | 2 +- .../ext/td/tdutils/td/utils/TimedStat.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Timer.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Timer.h | 2 +- .../td/tdutils/td/utils/TlDowncastHelper.h | 2 +- .../td/tdutils/td/utils/TlStorerToString.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/TsCerr.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/TsCerr.h | 2 +- .../ext/td/tdutils/td/utils/TsFileLog.cpp | 2 +- .../ext/td/tdutils/td/utils/TsFileLog.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/TsList.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/TsLog.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/TsLog.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/UInt.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/Variant.h | 2 +- .../ext/td/tdutils/td/utils/VectorQueue.h | 2 +- .../ext/td/tdutils/td/utils/WaitFreeHashMap.h | 2 +- .../ext/td/tdutils/td/utils/WaitFreeHashSet.h | 2 +- .../ext/td/tdutils/td/utils/WaitFreeVector.h | 2 +- .../ext/td/tdutils/td/utils/algorithm.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/as.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/base64.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/base64.h | 2 +- .../ext/td/tdutils/td/utils/benchmark.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/bits.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/buffer.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/buffer.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/check.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/check.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/common.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/crypto.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/crypto.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/emoji.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/emoji.h | 2 +- .../ext/td/tdutils/td/utils/filesystem.cpp | 2 +- .../ext/td/tdutils/td/utils/filesystem.h | 2 +- .../ext/td/tdutils/td/utils/find_boundary.cpp | 2 +- .../ext/td/tdutils/td/utils/find_boundary.h | 2 +- .../ext/td/tdutils/td/utils/fixed_vector.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/format.h | 2 +- .../ext/td/tdutils/td/utils/int_types.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/invoke.h | 2 +- .../ext/td/tdutils/td/utils/logging.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/logging.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/misc.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/misc.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/optional.h | 2 +- .../ext/td/tdutils/td/utils/overloaded.h | 2 +- .../ext/td/tdutils/td/utils/port/Clocks.cpp | 2 +- .../ext/td/tdutils/td/utils/port/Clocks.h | 2 +- .../ext/td/tdutils/td/utils/port/CxCli.h | 2 +- .../ext/td/tdutils/td/utils/port/EventFd.h | 2 +- .../td/tdutils/td/utils/port/EventFdBase.h | 2 +- .../ext/td/tdutils/td/utils/port/FileFd.cpp | 2 +- .../ext/td/tdutils/td/utils/port/FileFd.h | 2 +- .../ext/td/tdutils/td/utils/port/FromApp.h | 2 +- .../td/tdutils/td/utils/port/IPAddress.cpp | 2 +- .../ext/td/tdutils/td/utils/port/IPAddress.h | 2 +- .../ext/td/tdutils/td/utils/port/IoSlice.h | 2 +- .../tdutils/td/utils/port/MemoryMapping.cpp | 2 +- .../td/tdutils/td/utils/port/MemoryMapping.h | 2 +- .../ext/td/tdutils/td/utils/port/Mutex.h | 2 +- .../ext/td/tdutils/td/utils/port/Poll.h | 2 +- .../ext/td/tdutils/td/utils/port/PollBase.h | 2 +- .../td/tdutils/td/utils/port/PollFlags.cpp | 2 +- .../ext/td/tdutils/td/utils/port/PollFlags.h | 2 +- .../ext/td/tdutils/td/utils/port/RwMutex.h | 2 +- .../tdutils/td/utils/port/ServerSocketFd.cpp | 2 +- .../td/tdutils/td/utils/port/ServerSocketFd.h | 2 +- .../ext/td/tdutils/td/utils/port/SocketFd.cpp | 2 +- .../ext/td/tdutils/td/utils/port/SocketFd.h | 2 +- .../ext/td/tdutils/td/utils/port/Stat.cpp | 26 +- .../ext/td/tdutils/td/utils/port/Stat.h | 2 +- .../td/tdutils/td/utils/port/StdStreams.cpp | 2 +- .../ext/td/tdutils/td/utils/port/StdStreams.h | 2 +- .../td/tdutils/td/utils/port/UdpSocketFd.cpp | 2 +- .../td/tdutils/td/utils/port/UdpSocketFd.h | 2 +- .../ext/td/tdutils/td/utils/port/config.h | 2 +- .../td/tdutils/td/utils/port/detail/Epoll.cpp | 2 +- .../td/tdutils/td/utils/port/detail/Epoll.h | 2 +- .../td/utils/port/detail/EventFdBsd.cpp | 2 +- .../tdutils/td/utils/port/detail/EventFdBsd.h | 2 +- .../td/utils/port/detail/EventFdLinux.cpp | 2 +- .../td/utils/port/detail/EventFdLinux.h | 2 +- .../td/utils/port/detail/EventFdWindows.cpp | 2 +- .../td/utils/port/detail/EventFdWindows.h | 2 +- .../td/tdutils/td/utils/port/detail/Iocp.cpp | 2 +- .../td/tdutils/td/utils/port/detail/Iocp.h | 2 +- .../tdutils/td/utils/port/detail/KQueue.cpp | 2 +- .../td/tdutils/td/utils/port/detail/KQueue.h | 2 +- .../tdutils/td/utils/port/detail/NativeFd.cpp | 2 +- .../tdutils/td/utils/port/detail/NativeFd.h | 2 +- .../td/tdutils/td/utils/port/detail/Poll.cpp | 2 +- .../td/tdutils/td/utils/port/detail/Poll.h | 2 +- .../tdutils/td/utils/port/detail/PollableFd.h | 2 +- .../tdutils/td/utils/port/detail/Select.cpp | 2 +- .../td/tdutils/td/utils/port/detail/Select.h | 2 +- .../td/utils/port/detail/ThreadIdGuard.cpp | 2 +- .../td/utils/port/detail/ThreadIdGuard.h | 2 +- .../td/utils/port/detail/ThreadPthread.cpp | 2 +- .../td/utils/port/detail/ThreadPthread.h | 2 +- .../tdutils/td/utils/port/detail/ThreadStl.h | 2 +- .../td/utils/port/detail/WineventPoll.cpp | 2 +- .../td/utils/port/detail/WineventPoll.h | 2 +- .../tdutils/td/utils/port/detail/skip_eintr.h | 2 +- .../ext/td/tdutils/td/utils/port/path.cpp | 2 +- .../ext/td/tdutils/td/utils/port/path.h | 2 +- .../ext/td/tdutils/td/utils/port/platform.cpp | 2 +- .../ext/td/tdutils/td/utils/port/platform.h | 2 +- .../ext/td/tdutils/td/utils/port/rlimit.cpp | 2 +- .../ext/td/tdutils/td/utils/port/rlimit.h | 2 +- .../ext/td/tdutils/td/utils/port/signals.cpp | 2 +- .../ext/td/tdutils/td/utils/port/signals.h | 2 +- .../ext/td/tdutils/td/utils/port/sleep.cpp | 2 +- .../ext/td/tdutils/td/utils/port/sleep.h | 2 +- .../td/tdutils/td/utils/port/stacktrace.cpp | 2 +- .../ext/td/tdutils/td/utils/port/stacktrace.h | 2 +- .../ext/td/tdutils/td/utils/port/thread.h | 2 +- .../td/tdutils/td/utils/port/thread_local.cpp | 4 +- .../td/tdutils/td/utils/port/thread_local.h | 2 +- .../ext/td/tdutils/td/utils/port/uname.cpp | 2 +- .../ext/td/tdutils/td/utils/port/uname.h | 2 +- .../ext/td/tdutils/td/utils/port/user.cpp | 2 +- .../ext/td/tdutils/td/utils/port/user.h | 2 +- .../tdutils/td/utils/port/wstring_convert.cpp | 2 +- .../tdutils/td/utils/port/wstring_convert.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/queue.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/tests.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/tests.h | 2 +- .../ext/td/tdutils/td/utils/tl_helpers.h | 2 +- .../ext/td/tdutils/td/utils/tl_parsers.cpp | 2 +- .../ext/td/tdutils/td/utils/tl_parsers.h | 2 +- .../ext/td/tdutils/td/utils/tl_storers.h | 2 +- .../ext/td/tdutils/td/utils/translit.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/translit.h | 2 +- .../ext/td/tdutils/td/utils/type_traits.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/uint128.h | 2 +- .../ext/td/tdutils/td/utils/unicode.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/unicode.h | 2 +- .../ext/td/tdutils/td/utils/unique_ptr.h | 2 +- .../td/tdutils/td/utils/unique_value_ptr.h | 2 +- lib/tgchat/ext/td/tdutils/td/utils/utf8.cpp | 2 +- lib/tgchat/ext/td/tdutils/td/utils/utf8.h | 2 +- .../ext/td/tdutils/test/ChainScheduler.cpp | 2 +- .../ext/td/tdutils/test/ConcurrentHashMap.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/Enumerator.cpp | 2 +- .../test/EpochBasedMemoryReclamation.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/HashSet.cpp | 2 +- .../ext/td/tdutils/test/HazardPointers.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/HttpUrl.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/List.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/MpmcQueue.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/MpmcWaiter.cpp | 2 +- .../ext/td/tdutils/test/MpscLinkQueue.cpp | 2 +- .../ext/td/tdutils/test/OptionParser.cpp | 2 +- .../tdutils/test/OrderedEventsProcessor.cpp | 2 +- .../ext/td/tdutils/test/SharedObjectPool.cpp | 2 +- .../ext/td/tdutils/test/SharedSlice.cpp | 2 +- .../ext/td/tdutils/test/StealingQueue.cpp | 2 +- .../ext/td/tdutils/test/WaitFreeHashMap.cpp | 2 +- .../ext/td/tdutils/test/WaitFreeHashSet.cpp | 2 +- .../ext/td/tdutils/test/WaitFreeVector.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/bitmask.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/buffer.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/crypto.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/emoji.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/filesystem.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/gzip.cpp | 2 +- .../ext/td/tdutils/test/hashset_benchmark.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/heap.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/json.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/log.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/misc.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/port.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/pq.cpp | 2 +- lib/tgchat/ext/td/tdutils/test/variant.cpp | 2 +- lib/tgchat/ext/td/test/country_info.cpp | 2 +- lib/tgchat/ext/td/test/crypto.cpp | 2 +- lib/tgchat/ext/td/test/data.cpp | 2 +- lib/tgchat/ext/td/test/data.h | 2 +- lib/tgchat/ext/td/test/db.cpp | 2 +- lib/tgchat/ext/td/test/fuzz_url.cpp | 2 +- lib/tgchat/ext/td/test/http.cpp | 2 +- lib/tgchat/ext/td/test/link.cpp | 22 +- lib/tgchat/ext/td/test/main.cpp | 2 +- lib/tgchat/ext/td/test/message_entities.cpp | 14 +- lib/tgchat/ext/td/test/mtproto.cpp | 2 +- lib/tgchat/ext/td/test/online.cpp | 2 +- lib/tgchat/ext/td/test/poll.cpp | 2 +- lib/tgchat/ext/td/test/query_merger.cpp | 2 +- lib/tgchat/ext/td/test/secret.cpp | 2 +- lib/tgchat/ext/td/test/secure_storage.cpp | 2 +- lib/tgchat/ext/td/test/set_with_position.cpp | 2 +- lib/tgchat/ext/td/test/string_cleaning.cpp | 2 +- lib/tgchat/ext/td/test/tdclient.cpp | 2 +- lib/tgchat/ext/td/test/tqueue.cpp | 2 +- lib/tgchat/src/tgchat.cpp | 4 +- src/nchat.1 | 2 +- 1332 files changed, 9333 insertions(+), 4208 deletions(-) create mode 100644 lib/tgchat/ext/td/td/telegram/AffiliateType.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/AffiliateType.h create mode 100644 lib/tgchat/ext/td/td/telegram/BotVerification.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/BotVerification.h create mode 100644 lib/tgchat/ext/td/td/telegram/BotVerification.hpp create mode 100644 lib/tgchat/ext/td/td/telegram/BotVerifierSettings.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/BotVerifierSettings.h create mode 100644 lib/tgchat/ext/td/td/telegram/BotVerifierSettings.hpp create mode 100644 lib/tgchat/ext/td/td/telegram/MessageQueryManager.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/MessageQueryManager.h create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.h create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.hpp create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramManager.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramManager.h create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.h create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.hpp create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.h create mode 100644 lib/tgchat/ext/td/td/telegram/StarAmount.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/StarAmount.h create mode 100644 lib/tgchat/ext/td/td/telegram/StarAmount.hpp create mode 100644 lib/tgchat/ext/td/td/telegram/StarGiftAttribute.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/StarGiftAttribute.h create mode 100644 lib/tgchat/ext/td/td/telegram/StarGiftAttribute.hpp create mode 100644 lib/tgchat/ext/td/td/telegram/SuggestedActionManager.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/SuggestedActionManager.h create mode 100644 lib/tgchat/ext/td/td/telegram/UserStarGift.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/UserStarGift.h create mode 100644 lib/tgchat/ext/td/td/telegram/VerificationStatus.cpp create mode 100644 lib/tgchat/ext/td/td/telegram/VerificationStatus.h create mode 100644 lib/tgchat/ext/td/td/telegram/files/ResourceState.cpp diff --git a/lib/common/src/version.h b/lib/common/src/version.h index db19d2e3..b771e271 100644 --- a/lib/common/src/version.h +++ b/lib/common/src/version.h @@ -1,10 +1,10 @@ // version.h // -// Copyright (c) 2022-2024 Kristofer Berggren +// Copyright (c) 2022-2025 Kristofer Berggren // All rights reserved. // // nchat is distributed under the MIT license, see LICENSE for details. #pragma once -#define NCHAT_VERSION "5.5.1" +#define NCHAT_VERSION "5.5.2" diff --git a/lib/tgchat/ext/td/CMake/GetGitRevisionDescription.cmake b/lib/tgchat/ext/td/CMake/GetGitRevisionDescription.cmake index 724d0782..746c29d5 100644 --- a/lib/tgchat/ext/td/CMake/GetGitRevisionDescription.cmake +++ b/lib/tgchat/ext/td/CMake/GetGitRevisionDescription.cmake @@ -35,7 +35,7 @@ get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) # function returns an empty string via _git_dir_var. # # Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and -# neither foo nor bar contain a file/directory .git. This wil return +# neither foo nor bar contain a file/directory .git. This will return # C:/bla/.git # function(_git_find_closest_git_dir _start_dir _git_dir_var) diff --git a/lib/tgchat/ext/td/CMake/iOS.cmake b/lib/tgchat/ext/td/CMake/iOS.cmake index 4ef76bd0..0bdbe750 100644 --- a/lib/tgchat/ext/td/CMake/iOS.cmake +++ b/lib/tgchat/ext/td/CMake/iOS.cmake @@ -154,7 +154,7 @@ endif() set (CMAKE_SHARED_LINKER_FLAGS_INIT "-fapplication-extension") set (CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS}") -# Hidden visibilty is required for cxx on iOS +# Hidden visibility is required for cxx on iOS set (CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility-inlines-hidden") set (CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fapplication-extension -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") diff --git a/lib/tgchat/ext/td/CMakeLists.txt b/lib/tgchat/ext/td/CMakeLists.txt index a379f2b2..823968f6 100644 --- a/lib/tgchat/ext/td/CMakeLists.txt +++ b/lib/tgchat/ext/td/CMakeLists.txt @@ -6,7 +6,7 @@ if (POLICY CMP0065) cmake_policy(SET CMP0065 NEW) endif() -project(TDLib VERSION 1.8.40 LANGUAGES CXX C) +project(TDLib VERSION 1.8.42 LANGUAGES CXX C) if (NOT DEFINED CMAKE_MODULE_PATH) set(CMAKE_MODULE_PATH "") @@ -342,6 +342,7 @@ set(TD_MTPROTO_SOURCE set(TDLIB_SOURCE_PART1 td/telegram/AccountManager.cpp + td/telegram/AffiliateType.cpp td/telegram/AlarmManager.cpp td/telegram/AnimationsManager.cpp td/telegram/Application.cpp @@ -361,6 +362,8 @@ set(TDLIB_SOURCE_PART1 td/telegram/BotInfoManager.cpp td/telegram/BotMenuButton.cpp td/telegram/BotQueries.cpp + td/telegram/BotVerification.cpp + td/telegram/BotVerifierSettings.cpp td/telegram/BusinessAwayMessage.cpp td/telegram/BusinessAwayMessageSchedule.cpp td/telegram/BusinessBotManageBar.cpp @@ -443,6 +446,7 @@ set(TDLIB_SOURCE_PART1 td/telegram/files/FileUploadManager.cpp td/telegram/files/PartsManager.cpp td/telegram/files/ResourceManager.cpp + td/telegram/files/ResourceState.cpp td/telegram/ForumTopic.cpp td/telegram/ForumTopicEditedData.cpp td/telegram/ForumTopicIcon.cpp @@ -483,6 +487,7 @@ set(TDLIB_SOURCE_PART1 td/telegram/MessageImportManager.cpp td/telegram/MessageInputReplyTo.cpp td/telegram/MessageOrigin.cpp + td/telegram/MessageQueryManager.cpp td/telegram/MessageQuote.cpp td/telegram/MessageReaction.cpp td/telegram/MessageReactor.cpp @@ -557,6 +562,10 @@ set(TDLIB_SOURCE_PART2 td/telegram/ReactionNotificationsFrom.cpp td/telegram/ReactionType.cpp td/telegram/RecentDialogList.cpp + td/telegram/ReferralProgramInfo.cpp + td/telegram/ReferralProgramManager.cpp + td/telegram/ReferralProgramParameters.cpp + td/telegram/ReferralProgramSortOrder.cpp td/telegram/RepliedMessageInfo.cpp td/telegram/ReplyMarkup.cpp td/telegram/ReportReason.cpp @@ -579,7 +588,9 @@ set(TDLIB_SOURCE_PART2 td/telegram/SharedDialog.cpp td/telegram/SpecialStickerSetType.cpp td/telegram/SponsoredMessageManager.cpp + td/telegram/StarAmount.cpp td/telegram/StarGift.cpp + td/telegram/StarGiftAttribute.cpp td/telegram/StarGiftManager.cpp td/telegram/StarManager.cpp td/telegram/StarSubscription.cpp @@ -603,6 +614,7 @@ set(TDLIB_SOURCE_PART2 td/telegram/StoryStealthMode.cpp td/telegram/StoryViewer.cpp td/telegram/SuggestedAction.cpp + td/telegram/SuggestedActionManager.cpp td/telegram/Support.cpp td/telegram/SynchronousRequests.cpp td/telegram/TargetDialogTypes.cpp @@ -623,7 +635,9 @@ set(TDLIB_SOURCE_PART2 td/telegram/Usernames.cpp td/telegram/UserPrivacySetting.cpp td/telegram/UserPrivacySettingRule.cpp + td/telegram/UserStarGift.cpp td/telegram/Venue.cpp + td/telegram/VerificationStatus.cpp td/telegram/VideoNotesManager.cpp td/telegram/VideosManager.cpp td/telegram/VoiceNotesManager.cpp @@ -637,6 +651,7 @@ set(TDLIB_SOURCE_PART2 td/telegram/AccessRights.h td/telegram/AccountManager.h td/telegram/AffectedHistory.h + td/telegram/AffiliateType.h td/telegram/AlarmManager.h td/telegram/AnimationsManager.h td/telegram/Application.h @@ -651,6 +666,8 @@ set(TDLIB_SOURCE_PART2 td/telegram/BackgroundType.h td/telegram/BaseTheme.h td/telegram/Birthdate.h + td/telegram/BotVerification.h + td/telegram/BotVerifierSettings.h td/telegram/BlockListId.h td/telegram/BoostManager.h td/telegram/BotCommand.h @@ -812,6 +829,7 @@ set(TDLIB_SOURCE_PART2 td/telegram/MessageInputReplyTo.h td/telegram/MessageLinkInfo.h td/telegram/MessageOrigin.h + td/telegram/MessageQueryManager.h td/telegram/MessageQuote.h td/telegram/MessageReaction.h td/telegram/MessageReactor.h @@ -908,6 +926,10 @@ set(TDLIB_SOURCE_PART2 td/telegram/ReactionType.h td/telegram/ReactionUnavailabilityReason.h td/telegram/RecentDialogList.h + td/telegram/ReferralProgramInfo.h + td/telegram/ReferralProgramManager.h + td/telegram/ReferralProgramParameters.h + td/telegram/ReferralProgramSortOrder.h td/telegram/RepliedMessageInfo.h td/telegram/ReplyMarkup.h td/telegram/ReportReason.h @@ -936,7 +958,9 @@ set(TDLIB_SOURCE_PART2 td/telegram/SharedDialog.h td/telegram/SpecialStickerSetType.h td/telegram/SponsoredMessageManager.h + td/telegram/StarAmount.h td/telegram/StarGift.h + td/telegram/StarGiftAttribute.h td/telegram/StarGiftManager.h td/telegram/StarManager.h td/telegram/StarSubscription.h @@ -964,6 +988,7 @@ set(TDLIB_SOURCE_PART2 td/telegram/StoryStealthMode.h td/telegram/StoryViewer.h td/telegram/SuggestedAction.h + td/telegram/SuggestedActionManager.h td/telegram/Support.h td/telegram/SynchronousRequests.h td/telegram/TargetDialogTypes.h @@ -987,7 +1012,9 @@ set(TDLIB_SOURCE_PART2 td/telegram/Usernames.h td/telegram/UserPrivacySetting.h td/telegram/UserPrivacySettingRule.h + td/telegram/UserStarGift.h td/telegram/Venue.h + td/telegram/VerificationStatus.h td/telegram/Version.h td/telegram/VideoNotesManager.h td/telegram/VideosManager.h @@ -1005,6 +1032,8 @@ set(TDLIB_SOURCE_PART2 td/telegram/BackgroundInfo.hpp td/telegram/BackgroundType.hpp td/telegram/Birthdate.hpp + td/telegram/BotVerification.hpp + td/telegram/BotVerifierSettings.hpp td/telegram/BusinessAwayMessage.hpp td/telegram/BusinessAwayMessageSchedule.hpp td/telegram/BusinessConnectedBot.hpp @@ -1062,6 +1091,8 @@ set(TDLIB_SOURCE_PART2 td/telegram/ReactionNotificationSettings.hpp td/telegram/ReactionNotificationsFrom.hpp td/telegram/ReactionType.hpp + td/telegram/ReferralProgramInfo.hpp + td/telegram/ReferralProgramParameters.hpp td/telegram/RepliedMessageInfo.hpp td/telegram/ReplyMarkup.hpp td/telegram/RequestedDialogType.hpp @@ -1069,7 +1100,9 @@ set(TDLIB_SOURCE_PART2 td/telegram/SecureValue.hpp td/telegram/SendCodeHelper.hpp td/telegram/SharedDialog.hpp + td/telegram/StarAmount.hpp td/telegram/StarGift.hpp + td/telegram/StarGiftAttribute.hpp td/telegram/StarSubscriptionPricing.hpp td/telegram/StickerMaskPosition.hpp td/telegram/StickerPhotoSize.hpp diff --git a/lib/tgchat/ext/td/README.md b/lib/tgchat/ext/td/README.md index 2b3e0cd5..956f24ef 100644 --- a/lib/tgchat/ext/td/README.md +++ b/lib/tgchat/ext/td/README.md @@ -103,7 +103,7 @@ target_link_libraries(YourTarget PRIVATE Td::TdStatic) Or you could install `TDLib` and then reference it in your CMakeLists.txt like this: ``` -find_package(Td 1.8.40 REQUIRED) +find_package(Td 1.8.42 REQUIRED) target_link_libraries(YourTarget PRIVATE Td::TdStatic) ``` See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/blob/master/example/cpp/CMakeLists.txt). diff --git a/lib/tgchat/ext/td/SplitSource.php b/lib/tgchat/ext/td/SplitSource.php index b811a030..8ed213e2 100644 --- a/lib/tgchat/ext/td/SplitSource.php +++ b/lib/tgchat/ext/td/SplitSource.php @@ -296,6 +296,7 @@ function ($matches) use ($needed_std_headers) { $td_methods = array( 'AccentColorId' => 'AccentColorId', 'account_manager[_(-](?![.]get[(][)])|AccountManager[^;>]' => 'AccountManager', + 'AffiliateType' => 'AffiliateType', 'alarm_manager[_(-](?![.]get[(][)])|AlarmManager' => 'AlarmManager', 'animations_manager[_(-](?![.]get[(][)])|AnimationsManager[^;>]' => 'AnimationsManager', 'attach_menu_manager[_(-](?![.]get[(][)])|AttachMenuManager[^;>]' => 'AttachMenuManager', @@ -307,10 +308,12 @@ function ($matches) use ($needed_std_headers) { 'background_manager[_(-](?![.]get[(][)])|BackgroundManager' => 'BackgroundManager', 'BackgroundType' => 'BackgroundType', 'Birthdate' => 'Birthdate', - 'BotMenuButton|[a-z_]*_menu_button' => 'BotMenuButton', - 'send_bot_custom_query|answer_bot_custom_query|set_bot_updates_status' => 'BotQueries', 'boost_manager[_(-](?![.]get[(][)])|BoostManager' => 'BoostManager', 'bot_info_manager[_(-](?![.]get[(][)])|BotInfoManager' => 'BotInfoManager', + 'BotMenuButton|[a-z_]*_menu_button' => 'BotMenuButton', + 'send_bot_custom_query|answer_bot_custom_query|set_bot_updates_status' => 'BotQueries', + 'BotVerification' => 'BotVerification', + 'BotVerifierSettings' => 'BotVerifierSettings', 'BusinessAwayMessage' => 'BusinessAwayMessage', 'BusinessChatLink' => 'BusinessChatLink', 'BusinessConnectedBot' => 'BusinessConnectedBot', @@ -376,6 +379,7 @@ function ($matches) use ($needed_std_headers) { 'MessageFullId' => 'MessageFullId', 'MessageId' => 'MessageId', 'message_import_manager[_(-](?![.]get[(][)])|MessageImportManager' => 'MessageImportManager', + 'message_query_manager[_(-](?![.]get[(][)])|MessageQueryManager' => 'MessageQueryManager', 'MessageLinkInfo' => 'MessageLinkInfo', 'MessageQuote' => 'MessageQuote', 'MessageReaction|UnreadMessageReaction|[a-z_]*message[a-z_]*reaction|reload_paid_reaction_privacy|get_chosen_tags' => 'MessageReaction', @@ -404,6 +408,9 @@ function ($matches) use ($needed_std_headers) { 'ReactionNotificationSettings' => 'ReactionNotificationSettings', 'ReactionNotificationsFrom' => 'ReactionNotificationsFrom', 'ReactionType|[a-z_]*_reaction_type' => 'ReactionType', + 'ReferralProgramInfo' => 'ReferralProgramInfo', + 'referral_program_manager[_(-](?![.]get[(][)])|ReferralProgramManager' => 'ReferralProgramManager', + 'ReferralProgramParameters' => 'ReferralProgramParameters', 'RequestActor|RequestOnceActor' => 'RequestActor', 'saved_messages_manager[_(-](?![.]get[(][)])|SavedMessagesManager' => 'SavedMessagesManager', 'ScopeNotificationSettings|[a-z_]*_scope_notification_settings' => 'ScopeNotificationSettings', @@ -413,7 +420,9 @@ function ($matches) use ($needed_std_headers) { 'SentEmailCode' => 'SentEmailCode', 'SharedDialog' => 'SharedDialog', 'sponsored_message_manager[_(-](?![.]get[(][)])|SponsoredMessageManager' => 'SponsoredMessageManager', - 'StarGift[^M]' => 'StarGift', + 'StarAmount' => 'StarAmount', + 'StarGift[^AM]' => 'StarGift', + 'StarGift[^Attribute]' => 'StarGiftAttribute', 'star_gift_manager[_(-](?![.]get[(][)])|StarGiftManager' => 'StarGiftManager', 'star_manager[_(-](?![.]get[(][)])|StarManager' => 'StarManager', 'StarSubscription[^P]' => 'StarSubscription', @@ -427,6 +436,7 @@ function ($matches) use ($needed_std_headers) { 'StoryListId' => 'StoryListId', 'story_manager[_(-](?![.]get[(][)])|StoryManager' => 'StoryManager', 'SuggestedAction|[a-z_]*_suggested_action' => 'SuggestedAction', + 'suggested_action_manager[_(-](?![.]get[(][)])|SuggestedActionManager' => 'SuggestedActionManager', 'SynchronousRequests' => 'SynchronousRequests', 'TargetDialogTypes' => 'TargetDialogTypes', 'td_api' => 'td_api', @@ -443,6 +453,7 @@ function ($matches) use ($needed_std_headers) { 'updates_manager[_(-](?![.]get[(][)])|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager', 'UserId' => 'UserId', 'user_manager[_(-](?![.]get[(][)])|UserManager([^ ;.]| [^*])' => 'UserManager', + 'UserStarGift' => 'UserStarGift', 'video_notes_manager[_(-](?![.]get[(][)])|VideoNotesManager' => 'VideoNotesManager', 'videos_manager[_(-](?![.]get[(][)])|VideosManager' => 'VideosManager', 'voice_notes_manager[_(-](?![.]get[(][)])|VoiceNotesManager' => 'VoiceNotesManager', diff --git a/lib/tgchat/ext/td/benchmark/bench_actor.cpp b/lib/tgchat/ext/td/benchmark/bench_actor.cpp index c336547b..d2a575e7 100644 --- a/lib/tgchat/ext/td/benchmark/bench_actor.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_actor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_crypto.cpp b/lib/tgchat/ext/td/benchmark/bench_crypto.cpp index 307254c9..115d6489 100644 --- a/lib/tgchat/ext/td/benchmark/bench_crypto.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_crypto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_db.cpp b/lib/tgchat/ext/td/benchmark/bench_db.cpp index e4a1d617..16816611 100644 --- a/lib/tgchat/ext/td/benchmark/bench_db.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_db.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_empty.cpp b/lib/tgchat/ext/td/benchmark/bench_empty.cpp index 1d2aeff9..8b4e2c4c 100644 --- a/lib/tgchat/ext/td/benchmark/bench_empty.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_empty.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_handshake.cpp b/lib/tgchat/ext/td/benchmark/bench_handshake.cpp index cf7bcb0b..ce3a872e 100644 --- a/lib/tgchat/ext/td/benchmark/bench_handshake.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_handshake.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_http.cpp b/lib/tgchat/ext/td/benchmark/bench_http.cpp index cf281eea..bac4e712 100644 --- a/lib/tgchat/ext/td/benchmark/bench_http.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_http.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_http_reader.cpp b/lib/tgchat/ext/td/benchmark/bench_http_reader.cpp index fcf72390..29e9e0f7 100644 --- a/lib/tgchat/ext/td/benchmark/bench_http_reader.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_http_reader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_http_server.cpp b/lib/tgchat/ext/td/benchmark/bench_http_server.cpp index 9eeecc95..4e87dbd8 100644 --- a/lib/tgchat/ext/td/benchmark/bench_http_server.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_http_server.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_http_server_cheat.cpp b/lib/tgchat/ext/td/benchmark/bench_http_server_cheat.cpp index 327549bc..3061d34c 100644 --- a/lib/tgchat/ext/td/benchmark/bench_http_server_cheat.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_http_server_cheat.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_http_server_fast.cpp b/lib/tgchat/ext/td/benchmark/bench_http_server_fast.cpp index 1b9373b2..c788255b 100644 --- a/lib/tgchat/ext/td/benchmark/bench_http_server_fast.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_http_server_fast.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_log.cpp b/lib/tgchat/ext/td/benchmark/bench_log.cpp index d031bd65..be0b8ed0 100644 --- a/lib/tgchat/ext/td/benchmark/bench_log.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_log.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_misc.cpp b/lib/tgchat/ext/td/benchmark/bench_misc.cpp index bfde3ab7..24550c6f 100644 --- a/lib/tgchat/ext/td/benchmark/bench_misc.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_misc.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_queue.cpp b/lib/tgchat/ext/td/benchmark/bench_queue.cpp index 30571fd6..9c94c857 100644 --- a/lib/tgchat/ext/td/benchmark/bench_queue.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_queue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/bench_tddb.cpp b/lib/tgchat/ext/td/benchmark/bench_tddb.cpp index b5958957..8150840b 100644 --- a/lib/tgchat/ext/td/benchmark/bench_tddb.cpp +++ b/lib/tgchat/ext/td/benchmark/bench_tddb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/check_proxy.cpp b/lib/tgchat/ext/td/benchmark/check_proxy.cpp index 72893c50..55aa9efa 100644 --- a/lib/tgchat/ext/td/benchmark/check_proxy.cpp +++ b/lib/tgchat/ext/td/benchmark/check_proxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/check_tls.cpp b/lib/tgchat/ext/td/benchmark/check_tls.cpp index 9586df07..bc404788 100644 --- a/lib/tgchat/ext/td/benchmark/check_tls.cpp +++ b/lib/tgchat/ext/td/benchmark/check_tls.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -199,7 +199,7 @@ td::Result test_tls(const td::string &url) { if (random_id == "\xcf\x21\xad\x74\xe5\x9a\x61\x11\xbe\x1d\x8c\x02\x1e\x65\xb8\x91\xc2\xa2\x11\x16\x7a\xbb\x8c\x5e\x07" "\x9e\x09\xe2\xc8\xa8\x33\x9c") { - return td::Status::Error("TLS 1.3 servers returning HelloRetryRequest are not supprted"); + return td::Status::Error("TLS 1.3 servers returning HelloRetryRequest are not supported"); } if (result[43] == '\x00') { return td::Status::Error("TLS <= 1.2: empty session_id"); diff --git a/lib/tgchat/ext/td/benchmark/hashmap_build.cpp b/lib/tgchat/ext/td/benchmark/hashmap_build.cpp index 9953c3ce..70f676a1 100644 --- a/lib/tgchat/ext/td/benchmark/hashmap_build.cpp +++ b/lib/tgchat/ext/td/benchmark/hashmap_build.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/hashset_memory.cpp b/lib/tgchat/ext/td/benchmark/hashset_memory.cpp index fbd3a972..4e60a493 100644 --- a/lib/tgchat/ext/td/benchmark/hashset_memory.cpp +++ b/lib/tgchat/ext/td/benchmark/hashset_memory.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/rmdir.cpp b/lib/tgchat/ext/td/benchmark/rmdir.cpp index 0ae93bfe..3039cead 100644 --- a/lib/tgchat/ext/td/benchmark/rmdir.cpp +++ b/lib/tgchat/ext/td/benchmark/rmdir.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/benchmark/wget.cpp b/lib/tgchat/ext/td/benchmark/wget.cpp index a5aae5fb..62ce6bb1 100644 --- a/lib/tgchat/ext/td/benchmark/wget.cpp +++ b/lib/tgchat/ext/td/benchmark/wget.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/cpp/CMakeLists.txt b/lib/tgchat/ext/td/example/cpp/CMakeLists.txt index dd91afce..1864853a 100644 --- a/lib/tgchat/ext/td/example/cpp/CMakeLists.txt +++ b/lib/tgchat/ext/td/example/cpp/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(TdExample VERSION 1.0 LANGUAGES CXX) -find_package(Td 1.8.40 REQUIRED) +find_package(Td 1.8.42 REQUIRED) add_executable(tdjson_example tdjson_example.cpp) target_link_libraries(tdjson_example PRIVATE Td::TdJson) diff --git a/lib/tgchat/ext/td/example/cpp/td_example.cpp b/lib/tgchat/ext/td/example/cpp/td_example.cpp index 3f806d7b..bae735fc 100644 --- a/lib/tgchat/ext/td/example/cpp/td_example.cpp +++ b/lib/tgchat/ext/td/example/cpp/td_example.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/cpp/tdjson_example.cpp b/lib/tgchat/ext/td/example/cpp/tdjson_example.cpp index 7f307e1f..3c67be6a 100644 --- a/lib/tgchat/ext/td/example/cpp/tdjson_example.cpp +++ b/lib/tgchat/ext/td/example/cpp/tdjson_example.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/csharp/TdExample.cs b/lib/tgchat/ext/td/example/csharp/TdExample.cs index 48a08ee0..a912d980 100644 --- a/lib/tgchat/ext/td/example/csharp/TdExample.cs +++ b/lib/tgchat/ext/td/example/csharp/TdExample.cs @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/python/tdjson_example.py b/lib/tgchat/ext/td/example/python/tdjson_example.py index a8aa0d5c..82a7f3c0 100644 --- a/lib/tgchat/ext/td/example/python/tdjson_example.py +++ b/lib/tgchat/ext/td/example/python/tdjson_example.py @@ -1,6 +1,6 @@ # # Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com), -# Pellegrino Prevete (pellegrinoprevete@gmail.com) 2014-2024 +# Pellegrino Prevete (pellegrinoprevete@gmail.com) 2014-2025 # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/swift/src/main.swift b/lib/tgchat/ext/td/example/swift/src/main.swift index e1e40499..cc477ff7 100644 --- a/lib/tgchat/ext/td/example/swift/src/main.swift +++ b/lib/tgchat/ext/td/example/swift/src/main.swift @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/swift/src/td-Bridging-Header.h b/lib/tgchat/ext/td/example/swift/src/td-Bridging-Header.h index 740b23e9..981300ad 100644 --- a/lib/tgchat/ext/td/example/swift/src/td-Bridging-Header.h +++ b/lib/tgchat/ext/td/example/swift/src/td-Bridging-Header.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/uwp/SDKManifest.xml b/lib/tgchat/ext/td/example/uwp/SDKManifest.xml index d6896fcb..e46a8a0d 100644 --- a/lib/tgchat/ext/td/example/uwp/SDKManifest.xml +++ b/lib/tgchat/ext/td/example/uwp/SDKManifest.xml @@ -7,6 +7,6 @@ AppliesTo="WindowsAppContainer" DependsOn="Microsoft.VCLibs, version=14.0" SupportsMultipleVersions="Error" - SupportedArchitectures="x86;x64;ARM"> + SupportedArchitectures="x86;x64;ARM;ARM64"> diff --git a/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec b/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec index 0c9b2b4e..01f9a30d 100644 --- a/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec +++ b/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec @@ -2,7 +2,7 @@ Telegram.Td.UWP - 1.8.40 + 1.8.42 TDLib for Universal Windows Platform Telegram Telegram diff --git a/lib/tgchat/ext/td/example/uwp/app/App.xaml.cs b/lib/tgchat/ext/td/example/uwp/app/App.xaml.cs index aec21165..7b253843 100644 --- a/lib/tgchat/ext/td/example/uwp/app/App.xaml.cs +++ b/lib/tgchat/ext/td/example/uwp/app/App.xaml.cs @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/uwp/app/MainPage.xaml.cs b/lib/tgchat/ext/td/example/uwp/app/MainPage.xaml.cs index 74f69bca..abca8a32 100644 --- a/lib/tgchat/ext/td/example/uwp/app/MainPage.xaml.cs +++ b/lib/tgchat/ext/td/example/uwp/app/MainPage.xaml.cs @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/example/uwp/app/Properties/AssemblyInfo.cs b/lib/tgchat/ext/td/example/uwp/app/Properties/AssemblyInfo.cs index b55a5f62..e79a4b16 100644 --- a/lib/tgchat/ext/td/example/uwp/app/Properties/AssemblyInfo.cs +++ b/lib/tgchat/ext/td/example/uwp/app/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("App2")] -[assembly: AssemblyCopyright("Copyright © 2015-2024")] +[assembly: AssemblyCopyright("Copyright © 2015-2025")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/lib/tgchat/ext/td/example/uwp/build.ps1 b/lib/tgchat/ext/td/example/uwp/build.ps1 index e0127057..2c53e408 100644 --- a/lib/tgchat/ext/td/example/uwp/build.ps1 +++ b/lib/tgchat/ext/td/example/uwp/build.ps1 @@ -1,6 +1,7 @@ param ( [string]$vcpkg_root = $(throw "-vcpkg_root= is required"), - [string]$arch = "", + [ValidateSet('x86', 'x64', 'ARM', 'ARM64', IgnoreCase = $false)] + [string[]]$arch = @( "x86", "x64", "ARM", "ARM64" ), [string]$mode = "all", [string]$compress = "7z", [switch]$release_only = $false, @@ -11,10 +12,7 @@ $ErrorActionPreference = "Stop" $vcpkg_root = Resolve-Path $vcpkg_root $vcpkg_cmake="${vcpkg_root}\scripts\buildsystems\vcpkg.cmake" -$arch_list = @( "x86", "x64", "ARM", "ARM64" ) -if ($arch) { - $arch_list = @(, $arch) -} +$arch_list = $arch $config_list = @( "Debug", "Release" ) if ($release_only -or $nupkg) { $config_list = @(, "RelWithDebInfo") @@ -130,11 +128,12 @@ function export-nupkg { cp ../Telegram.Td.UWP.targets nupkg/build/native ForEach ($arch in $arch_list) { - New-Item -ItemType Directory -Force -Path nupkg/runtimes/win10-${arch}/native + $fixed_arch = $arch.ToLower(); + New-Item -ItemType Directory -Force -Path nupkg/runtimes/win10-${fixed_arch}/native New-Item -ItemType Directory -Force -Path nupkg/lib/uap10.0 ForEach ($config in $config_list) { - cp ${arch}/${config}/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*","Telegram.Td.pdb","Telegram.Td.pri","Telegram.Td.dll" nupkg/runtimes/win10-${arch}/native + cp ${arch}/${config}/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*","Telegram.Td.pdb","Telegram.Td.pri","Telegram.Td.dll" nupkg/runtimes/win10-${fixed_arch}/native cp ${arch}/${config}/* -include "Telegram.Td.winmd","Telegram.Td.xml" nupkg/lib/uap10.0 } } diff --git a/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest b/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest index d1720c4d..1935246c 100644 --- a/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest +++ b/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest @@ -1,6 +1,6 @@ - + TDLib for Universal Windows Platform TDLib is a library for building Telegram clients https://core.telegram.org/tdlib diff --git a/lib/tgchat/ext/td/memprof/memprof.cpp b/lib/tgchat/ext/td/memprof/memprof.cpp index e6564e66..92c20f44 100644 --- a/lib/tgchat/ext/td/memprof/memprof.cpp +++ b/lib/tgchat/ext/td/memprof/memprof.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -285,7 +285,7 @@ void *realloc(void *ptr, std::size_t size) { return new_ptr; } -void *memalign(std::size_t aligment, std::size_t size) { +void *memalign(std::size_t alignment, std::size_t size) { my_assert(false && "Memalign is unsupported"); return nullptr; } diff --git a/lib/tgchat/ext/td/memprof/memprof.h b/lib/tgchat/ext/td/memprof/memprof.h index a4729abc..40d55128 100644 --- a/lib/tgchat/ext/td/memprof/memprof.h +++ b/lib/tgchat/ext/td/memprof/memprof.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/memprof/memprof_stat.cpp b/lib/tgchat/ext/td/memprof/memprof_stat.cpp index 6bed0262..fe7be2ea 100644 --- a/lib/tgchat/ext/td/memprof/memprof_stat.cpp +++ b/lib/tgchat/ext/td/memprof/memprof_stat.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/memprof/memprof_stat.h b/lib/tgchat/ext/td/memprof/memprof_stat.h index cfcbd4c9..7328fa74 100644 --- a/lib/tgchat/ext/td/memprof/memprof_stat.h +++ b/lib/tgchat/ext/td/memprof/memprof_stat.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/generate_c.cpp b/lib/tgchat/ext/td/td/generate/generate_c.cpp index 83590fc7..3b5228a5 100644 --- a/lib/tgchat/ext/td/td/generate/generate_c.cpp +++ b/lib/tgchat/ext/td/td/generate/generate_c.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/generate_common.cpp b/lib/tgchat/ext/td/td/generate/generate_common.cpp index 4fdc2688..03a1e8ad 100644 --- a/lib/tgchat/ext/td/td/generate/generate_common.cpp +++ b/lib/tgchat/ext/td/td/generate/generate_common.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/generate_dotnet.cpp b/lib/tgchat/ext/td/td/generate/generate_dotnet.cpp index 31940642..e2af8e3e 100644 --- a/lib/tgchat/ext/td/td/generate/generate_dotnet.cpp +++ b/lib/tgchat/ext/td/td/generate/generate_dotnet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/generate_java.cpp b/lib/tgchat/ext/td/td/generate/generate_java.cpp index 80468f56..d9edbf08 100644 --- a/lib/tgchat/ext/td/td/generate/generate_java.cpp +++ b/lib/tgchat/ext/td/td/generate/generate_java.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/generate_json.cpp b/lib/tgchat/ext/td/td/generate/generate_json.cpp index cf4383de..3168655a 100644 --- a/lib/tgchat/ext/td/td/generate/generate_json.cpp +++ b/lib/tgchat/ext/td/td/generate/generate_json.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/generate_mtproto.cpp b/lib/tgchat/ext/td/td/generate/generate_mtproto.cpp index e7d90909..bb082109 100644 --- a/lib/tgchat/ext/td/td/generate/generate_mtproto.cpp +++ b/lib/tgchat/ext/td/td/generate/generate_mtproto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/remove_documentation.cpp b/lib/tgchat/ext/td/td/generate/remove_documentation.cpp index ad500654..18a5c655 100644 --- a/lib/tgchat/ext/td/td/generate/remove_documentation.cpp +++ b/lib/tgchat/ext/td/td/generate/remove_documentation.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/scheme/td_api.tl b/lib/tgchat/ext/td/td/generate/scheme/td_api.tl index ecf3383f..5ef79f25 100644 --- a/lib/tgchat/ext/td/td/generate/scheme/td_api.tl +++ b/lib/tgchat/ext/td/td/generate/scheme/td_api.tl @@ -607,6 +607,27 @@ botCommands bot_user_id:int53 commands:vector = BotCommands; botMenuButton text:string url:string = BotMenuButton; +//@description Describes parameters of verification that is provided by a bot +//@icon_custom_emoji_id Identifier of the custom emoji that is used as the verification sign +//@organization_name Name of the organization that provides verification +//@default_custom_description Default custom description of verification reason to be used as placeholder in setMessageSenderBotVerification; may be null if none +//@can_set_custom_description True, if the bot is allowed to provide custom description for verified entities +botVerificationParameters icon_custom_emoji_id:int64 organization_name:string default_custom_description:formattedText can_set_custom_description:Bool = BotVerificationParameters; + +//@description Describes verification status provided by a bot +//@bot_user_id Identifier of the bot that provided the verification +//@icon_custom_emoji_id Identifier of the custom emoji that is used as the verification sign +//@custom_description Custom description of verification reason set by the bot +botVerification bot_user_id:int53 icon_custom_emoji_id:int64 custom_description:formattedText = BotVerification; + +//@description Contains information about verification status of a chat or a user +//@is_verified True, if the chat or the user is verified by Telegram +//@is_scam True, if the chat or the user is marked as scam by Telegram +//@is_fake True, if the chat or the user is marked as fake by Telegram +//@bot_verification_icon_custom_emoji_id Identifier of the custom emoji to be shown as verification sign provided by a bot for the user; 0 if none +verificationStatus is_verified:Bool is_scam:Bool is_fake:Bool bot_verification_icon_custom_emoji_id:int64 = VerificationStatus; + + //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner chatLocation location:location address:string = ChatLocation; @@ -809,6 +830,12 @@ chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_docum chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights; +//@description Describes a possibly non-integer amount of Telegram Stars +//@star_count The integer amount of Telegram Stars rounded to 0 +//@nanostar_count The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999 +starAmount star_count:int53 nanostar_count:int32 = StarAmount; + + //@class StarSubscriptionType @description Describes type of subscription paid in Telegram Stars //@description Describes a subscription to a channel chat @@ -840,11 +867,82 @@ starSubscriptionPricing period:int32 star_count:int53 = StarSubscriptionPricing; starSubscription id:string chat_id:int53 expiration_date:int32 is_canceled:Bool is_expiring:Bool pricing:starSubscriptionPricing type:StarSubscriptionType = StarSubscription; //@description Represents a list of Telegram Star subscriptions -//@star_count The amount of owned Telegram Stars +//@star_amount The amount of owned Telegram Stars //@subscriptions List of subscriptions for Telegram Stars //@required_star_count The number of Telegram Stars required to buy to extend subscriptions expiring soon //@next_offset The offset for the next request. If empty, then there are no more results -starSubscriptions star_count:int53 subscriptions:vector required_star_count:int53 next_offset:string = StarSubscriptions; +starSubscriptions star_amount:starAmount subscriptions:vector required_star_count:int53 next_offset:string = StarSubscriptions; + + +//@class AffiliateType @description Describes type of affiliate for an affiliate program + +//@description The affiliate is the current user +affiliateTypeCurrentUser = AffiliateType; + +//@description The affiliate is a bot owned by the current user @user_id User identifier of the bot +affiliateTypeBot user_id:int53 = AffiliateType; + +//@description The affiliate is a channel chat where the current user has can_post_messages administrator right @chat_id Identifier of the channel chat +affiliateTypeChannel chat_id:int53 = AffiliateType; + + +//@class AffiliateProgramSortOrder @description Describes the order of the found affiliate programs + +//@description The affiliate programs must be sorted by the profitability +affiliateProgramSortOrderProfitability = AffiliateProgramSortOrder; + +//@description The affiliate programs must be sorted by creation date +affiliateProgramSortOrderCreationDate = AffiliateProgramSortOrder; + +//@description The affiliate programs must be sorted by the expected revenue +affiliateProgramSortOrderRevenue = AffiliateProgramSortOrder; + + +//@description Describes parameters of an affiliate program +//@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner; +//-getOption("affiliate_program_commission_per_mille_min")-getOption("affiliate_program_commission_per_mille_max") +//@month_count Number of months the program will be active; 0-36. If 0, then the program is eternal +affiliateProgramParameters commission_per_mille:int32 month_count:int32 = AffiliateProgramParameters; + +//@description Contains information about an active affiliate program +//@parameters Parameters of the affiliate program +//@end_date Point in time (Unix timestamp) when the affiliate program will be closed; 0 if the affiliate program isn't scheduled to be closed. +//-If positive, then the program can't be connected using connectAffiliateProgram, but active connections will work until the date +//@daily_revenue_per_user_amount The amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program +affiliateProgramInfo parameters:affiliateProgramParameters end_date:int32 daily_revenue_per_user_amount:starAmount = AffiliateProgramInfo; + +//@description Contains information about an affiliate that received commission from a Telegram Star transaction +//@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner +//@affiliate_chat_id Identifier of the chat which received the commission +//@star_amount The amount of Telegram Stars that were received by the affiliate; can be negative for refunds +affiliateInfo commission_per_mille:int32 affiliate_chat_id:int53 star_amount:starAmount = AffiliateInfo; + +//@description Describes a found affiliate program +//@bot_user_id User identifier of the bot created the program +//@info Information about the affiliate program +foundAffiliateProgram bot_user_id:int53 info:affiliateProgramInfo = FoundAffiliateProgram; + +//@description Represents a list of found affiliate programs +//@total_count The total number of found affiliate programs +//@programs The list of affiliate programs +//@next_offset The offset for the next request. If empty, then there are no more results +foundAffiliatePrograms total_count:int32 programs:vector next_offset:string = FoundAffiliatePrograms; + +//@description Describes an affiliate program that was connected to an affiliate +//@url The link that can be used to refer users if the program is still active +//@bot_user_id User identifier of the bot created the program +//@parameters The parameters of the affiliate program +//@connection_date Point in time (Unix timestamp) when the affiliate program was connected +//@is_disconnected True, if the program was canceled by the bot, or disconnected by the chat owner and isn't available anymore +//@user_count The number of users that used the affiliate program +//@revenue_star_count The number of Telegram Stars that were earned by the affiliate program +connectedAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int64 = ConnectedAffiliateProgram; + +//@description Represents a list of affiliate programs that were connected to an affiliate +//@total_count The total number of affiliate programs that were connected to the affiliate +//@programs The list of connected affiliate programs +//@next_offset The offset for the next request. If empty, then there are no more results +connectedAffiliatePrograms total_count:int32 programs:vector next_offset:string = ConnectedAffiliatePrograms; //@description Contains information about a product that can be paid with invoice @@ -925,31 +1023,98 @@ starGiveawayPaymentOption currency:string amount:int53 star_count:int53 store_pr //@description Contains a list of options for creating Telegram Star giveaway @options The list of options starGiveawayPaymentOptions options:vector = StarGiveawayPaymentOptions; + +//@description Describes a model of an upgraded gift +//@name Name of the model +//@sticker The sticker representing the upgraded gift +//@rarity_per_mille The number of upgraded gift that receive this model for each 1000 gifts upgraded +upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftModel; + +//@description Describes a symbol shown on the pattern of an upgraded gift +//@name Name of the symbol +//@sticker The sticker representing the upgraded gift +//@rarity_per_mille The number of upgraded gift that receive this symbol for each 1000 gifts upgraded +upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol; + +//@description Describes a backdrop of an upgraded gift +//@name Name of the backdrop +//@center_color A color in the center of the backdrop in the RGB format +//@edge_color A color on the edges of the backdrop in the RGB format +//@symbol_color A color to be applied for the symbol in the RGB format +//@text_color A color for the text on the backdrop in the RGB format +//@rarity_per_mille The number of upgraded gift that receive this backdrop for each 1000 gifts upgraded +upgradedGiftBackdrop name:string center_color:int32 edge_color:int32 symbol_color:int32 text_color:int32 rarity_per_mille:int32 = UpgradedGiftBackdrop; + +//@description Describes the original details about the gift +//@sender_user_id Identifier of the user that sent the gift; 0 if the gift was private +//@receiver_user_id Identifier of the user that received the gift +//@text Message added to the gift +//@date Point in time (Unix timestamp) when the gift was sent +upgradedGiftOriginalDetails sender_user_id:int53 receiver_user_id:int53 text:formattedText date:int32 = UpgradedGiftOriginalDetails; + //@description Describes a gift that can be sent to another user //@id Unique identifier of the gift //@sticker The sticker representing the gift //@star_count Number of Telegram Stars that must be paid for the gift -//@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed +//@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed +//@upgrade_star_count Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible //@is_for_birthday True, if the gift is a birthday gift //@remaining_count Number of remaining times the gift can be purchased by all users; 0 if not limited or the gift was sold out //@total_count Number of total times the gift can be purchased by all users; 0 if not limited //@first_send_date Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only //@last_send_date Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only -gift id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 is_for_birthday:Bool remaining_count:int32 total_count:int32 first_send_date:int32 last_send_date:int32 = Gift; +gift id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 is_for_birthday:Bool remaining_count:int32 total_count:int32 first_send_date:int32 last_send_date:int32 = Gift; //@description Contains a list of gifts that can be sent to another user @gifts The list of gifts gifts gifts:vector = Gifts; +//@description Describes an upgraded gift that can be gifted to another user or transferred to TON blockchain as an NFT +//@id Unique identifier of the gift +//@title The title of the upgraded gift +//@number Unique number of the upgraded gift among gifts upgraded from the same gift +//@total_upgraded_count Total number of gifts that were upgraded from the same gift +//@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift +//@owner_user_id User identifier of the user that owns the upgraded gift; 0 if none +//@model Model of the upgraded gift +//@symbol Symbol of the upgraded gift +//@backdrop Backdrop of the upgraded gift +//@original_details Information about the originally sent gift; may be null if unknown +upgradedGift id:int64 title:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 owner_user_id:int53 model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails = UpgradedGift; + +//@description Contains result of gift upgrading +//@gift The upgraded gift +//@is_saved True, if the gift is displayed on the user's profile page +//@can_be_transferred True, if the gift can be transferred to another user +//@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift +//@export_date Point in time (Unix timestamp) when the gift can be transferred to TON blockchain as an NFT +upgradeGiftResult gift:upgradedGift is_saved:Bool can_be_transferred:Bool transfer_star_count:int53 export_date:int32 = UpgradeGiftResult; + + +//@class SentGift @description Represents a gift received by a user + +//@description Regular gift @gift The gift +sentGiftRegular gift:gift = SentGift; + +//@description Upgraded gift @gift The gift +sentGiftUpgraded gift:upgradedGift = SentGift; + + //@description Represents a gift received by a user //@sender_user_id Identifier of the user that sent the gift; 0 if unknown //@text Message added to the gift //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them -//@is_saved True, if the gift is displayed on the user's profile page; may be false only for the receiver of the gift +//@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift +//@can_be_upgraded True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift +//@can_be_transferred True, if the gift is an upgraded gift that can be transferred to another user; only for the receiver of the gift +//@was_refunded True, if the gift was refunded and isn't available anymore //@date Point in time (Unix timestamp) when the gift was sent //@gift The gift -//@message_id Identifier of the message with the gift in the chat with the sender of the gift; can be 0 or an identifier of a deleted message; only for the gift receiver -//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift; 0 if the gift can't be sold by the current user -userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool date:int32 gift:gift message_id:int53 sell_star_count:int53 = UserGift; +//@message_id Identifier of the message with the gift in the chat with the sender of the gift; can be 0 or an identifier of a deleted message; only for the receiver of the gift +//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the current user +//@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift +//@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift +//@export_date Point in time (Unix timestamp) when the upgraded gift can be transferred to TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift +userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool can_be_upgraded:Bool can_be_transferred:Bool was_refunded:Bool date:int32 gift:SentGift message_id:int53 sell_star_count:int53 prepaid_upgrade_star_count:int53 transfer_star_count:int53 export_date:int32 = UserGift; //@description Represents a list of gifts received by a user //@total_count The total number of received gifts @@ -957,6 +1122,12 @@ userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool d //@next_offset The offset for the next request. If empty, then there are no more results userGifts total_count:int32 gifts:vector next_offset:string = UserGifts; +//@description Contains examples of possible upgraded gifts for the given regular gift +//@models Examples of possible models that can be chosen for the gift after upgrade +//@symbols Examples of possible symbols that can be chosen for the gift after upgrade +//@backdrops Examples of possible backdrops that can be chosen for the gift after upgrade +giftUpgradePreview models:vector symbols:vector backdrops:vector = GiftUpgradePreview; + //@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars @@ -967,103 +1138,143 @@ starTransactionDirectionIncoming = StarTransactionDirection; starTransactionDirectionOutgoing = StarTransactionDirection; -//@class BotTransactionPurpose @description Describes purpose of a transaction with a bot +//@class StarTransactionType @description Describes type of transaction with Telegram Stars -//@description Paid media were bought @media The bought media if the transaction wasn't refunded @payload Bot-provided payload; for bots only -botTransactionPurposePaidMedia media:vector payload:string = BotTransactionPurpose; +//@description The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only +starTransactionTypePremiumBotDeposit = StarTransactionType; -//@description User bought a product from the bot -//@product_info Information about the bought product; may be null if not applicable -//@invoice_payload Invoice payload; for bots only -botTransactionPurposeInvoicePayment product_info:productInfo invoice_payload:bytes = BotTransactionPurpose; +//@description The transaction is a deposit of Telegram Stars from App Store; for regular users only +starTransactionTypeAppStoreDeposit = StarTransactionType; -//@description User bought a subscription in a bot or a business account -//@period The number of seconds between consecutive Telegram Star debiting -//@product_info Information about the bought subscription; may be null if not applicable -//@invoice_payload Invoice payload; for bots only -botTransactionPurposeSubscription period:int32 product_info:productInfo invoice_payload:bytes = BotTransactionPurpose; +//@description The transaction is a deposit of Telegram Stars from Google Play; for regular users only +starTransactionTypeGooglePlayDeposit = StarTransactionType; +//@description The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only +starTransactionTypeFragmentDeposit = StarTransactionType; -//@class ChatTransactionPurpose @description Describes purpose of a transaction with a supergroup or a channel +//@description The transaction is a deposit of Telegram Stars by another user; for regular users only +//@user_id Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous +//@sticker The sticker to be shown in the transaction information; may be null if unknown +starTransactionTypeUserDeposit user_id:int53 sticker:sticker = StarTransactionType; -//@description Paid media were bought -//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message -//@media The bought media if the transaction wasn't refunded -chatTransactionPurposePaidMedia message_id:int53 media:vector = ChatTransactionPurpose; +//@description The transaction is a deposit of Telegram Stars from a giveaway; for regular users only +//@chat_id Identifier of a supergroup or a channel chat that created the giveaway +//@giveaway_message_id Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message +starTransactionTypeGiveawayDeposit chat_id:int53 giveaway_message_id:int53 = StarTransactionType; -//@description User joined the channel and subscribed to regular payments in Telegram Stars -//@period The number of seconds between consecutive Telegram Star debiting -chatTransactionPurposeJoin period:int32 = ChatTransactionPurpose; - -//@description User paid for a reaction -//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message -chatTransactionPurposeReaction message_id:int53 = ChatTransactionPurpose; +//@description The transaction is a withdrawal of earned Telegram Stars to Fragment; for bots and channel chats only @withdrawal_state State of the withdrawal; may be null for refunds from Fragment +starTransactionTypeFragmentWithdrawal withdrawal_state:RevenueWithdrawalState = StarTransactionType; -//@description User received Telegram Stars from a giveaway @giveaway_message_id Identifier of the message with giveaway; can be 0 or an identifier of a deleted message -chatTransactionPurposeGiveaway giveaway_message_id:int53 = ChatTransactionPurpose; +//@description The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only +starTransactionTypeTelegramAdsWithdrawal = StarTransactionType; +//@description The transaction is a payment for Telegram API usage; for bots only @request_count The number of billed requests +starTransactionTypeTelegramApiUsage request_count:int32 = StarTransactionType; -//@class UserTransactionPurpose @description Describes purpose of a transaction with a user - -//@description A user gifted Telegram Stars @sticker A sticker to be shown in the transaction information; may be null if unknown -userTransactionPurposeGiftedStars sticker:sticker = UserTransactionPurpose; +//@description The transaction is a purchase of paid media from a bot or a business account by the current user; for regular users only +//@user_id Identifier of the bot or the business account user that sent the paid media +//@media The bought media if the transaction wasn't refunded +starTransactionTypeBotPaidMediaPurchase user_id:int53 media:vector = StarTransactionType; -//@description The user sold a gift received from another user or bot @gift The gift -userTransactionPurposeGiftSell gift:gift = UserTransactionPurpose; +//@description The transaction is a sale of paid media by the bot or a business account managed by the bot; for bots only +//@user_id Identifier of the user that bought the media +//@media The bought media +//@payload Bot-provided payload +//@affiliate Information about the affiliate which received commission from the transaction; may be null if none +starTransactionTypeBotPaidMediaSale user_id:int53 media:vector payload:string affiliate:affiliateInfo = StarTransactionType; -//@description The user or the bot sent a gift to a user @gift The gift -userTransactionPurposeGiftSend gift:gift = UserTransactionPurpose; +//@description The transaction is a purchase of paid media from a channel by the current user; for regular users only +//@chat_id Identifier of the channel chat that sent the paid media +//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@media The bought media if the transaction wasn't refunded +starTransactionTypeChannelPaidMediaPurchase chat_id:int53 message_id:int53 media:vector = StarTransactionType; +//@description The transaction is a sale of paid media by the channel chat; for channel chats only +//@user_id Identifier of the user that bought the media +//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@media The bought media +starTransactionTypeChannelPaidMediaSale user_id:int53 message_id:int53 media:vector = StarTransactionType; -//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram Stars +//@description The transaction is a purchase of a product from a bot or a business account by the current user; for regular users only +//@user_id Identifier of the bot or the business account user that created the invoice +//@product_info Information about the bought product +starTransactionTypeBotInvoicePurchase user_id:int53 product_info:productInfo = StarTransactionType; -//@description The transaction is a transaction with Telegram through a bot -starTransactionPartnerTelegram = StarTransactionPartner; +//@description The transaction is a sale of a product by the bot; for bots only +//@user_id Identifier of the user that bought the product +//@product_info Information about the bought product +//@invoice_payload Invoice payload +//@affiliate Information about the affiliate which received commission from the transaction; may be null if none +starTransactionTypeBotInvoiceSale user_id:int53 product_info:productInfo invoice_payload:bytes affiliate:affiliateInfo = StarTransactionType; + +//@description The transaction is a purchase of a subscription from a bot or a business account by the current user; for regular users only +//@user_id Identifier of the bot or the business account user that created the subscription link +//@subscription_period The number of seconds between consecutive Telegram Star debitings +//@product_info Information about the bought subscription +starTransactionTypeBotSubscriptionPurchase user_id:int53 subscription_period:int32 product_info:productInfo = StarTransactionType; + +//@description The transaction is a sale of a subscription by the bot; for bots only +//@user_id Identifier of the user that bought the subscription +//@subscription_period The number of seconds between consecutive Telegram Star debitings +//@product_info Information about the bought subscription +//@invoice_payload Invoice payload +//@affiliate Information about the affiliate which received commission from the transaction; may be null if none +starTransactionTypeBotSubscriptionSale user_id:int53 subscription_period:int32 product_info:productInfo invoice_payload:bytes affiliate:affiliateInfo = StarTransactionType; -//@description The transaction is a transaction with App Store -starTransactionPartnerAppStore = StarTransactionPartner; +//@description The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only +//@chat_id Identifier of the channel chat that created the subscription +//@subscription_period The number of seconds between consecutive Telegram Star debitings +starTransactionTypeChannelSubscriptionPurchase chat_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a transaction with Google Play -starTransactionPartnerGooglePlay = StarTransactionPartner; +//@description The transaction is a sale of a subscription by the channel chat; for channel chats only +//@user_id Identifier of the user that bought the subscription +//@subscription_period The number of seconds between consecutive Telegram Star debitings +starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a transaction with Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment or for Telegram Stars bought on Fragment -starTransactionPartnerFragment withdrawal_state:RevenueWithdrawalState = StarTransactionPartner; +//@description The transaction is a purchase of a regular gift to another user; for regular users and bots only @user_id Identifier of the user that received the gift @gift The gift +starTransactionTypeGiftPurchase user_id:int53 gift:gift = StarTransactionType; -//@description The transaction is a transaction with Telegram Ad platform -starTransactionPartnerTelegramAds = StarTransactionPartner; +//@description The transaction is a transfer of an upgraded gift to another user; for regular users only @user_id Identifier of the user that received the gift @gift The gift +starTransactionTypeGiftTransfer user_id:int53 gift:upgradedGift = StarTransactionType; -//@description The transaction is a transaction with Telegram for API usage @request_count The number of billed requests -starTransactionPartnerTelegramApi request_count:int32 = StarTransactionPartner; +//@description The transaction is a sale of a gift received from another user or bot; for regular users only @user_id Identifier of the user that sent the gift @gift The gift +starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType; -//@description The transaction is a transaction with a bot @user_id Identifier of the bot @purpose Purpose of the transaction -starTransactionPartnerBot user_id:int53 purpose:BotTransactionPurpose = StarTransactionPartner; +//@description The transaction is an upgrade of a gift; for regular users only @gift The upgraded gift +starTransactionTypeGiftUpgrade gift:upgradedGift = StarTransactionType; -//@description The transaction is a transaction with a business account @user_id Identifier of the business account user @media The bought media if the transaction wasn't refunded -starTransactionPartnerBusiness user_id:int53 media:vector = StarTransactionPartner; +//@description The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only +//@chat_id Identifier of the channel chat +//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +starTransactionTypeChannelPaidReactionSend chat_id:int53 message_id:int53 = StarTransactionType; -//@description The transaction is a transaction with a supergroup or a channel chat @chat_id Identifier of the chat @purpose Purpose of the transaction -starTransactionPartnerChat chat_id:int53 purpose:ChatTransactionPurpose = StarTransactionPartner; +//@description The transaction is a receiving of a paid reaction to a message by the channel chat; for channel chats only +//@user_id Identifier of the user that added the paid reaction +//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +starTransactionTypeChannelPaidReactionReceive user_id:int53 message_id:int53 = StarTransactionType; -//@description The transaction is a transaction with another user @user_id Identifier of the user; 0 if the user was anonymous @purpose Purpose of the transaction -starTransactionPartnerUser user_id:int53 purpose:UserTransactionPurpose = StarTransactionPartner; +//@description The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only +//@chat_id Identifier of the chat that created the affiliate program +//@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner +starTransactionTypeAffiliateProgramCommission chat_id:int53 commission_per_mille:int32 = StarTransactionType; -//@description The transaction is a transaction with unknown partner -starTransactionPartnerUnsupported = StarTransactionPartner; +//@description The transaction is a transaction of an unsupported type +starTransactionTypeUnsupported = StarTransactionType; //@description Represents a transaction changing the amount of owned Telegram Stars //@id Unique identifier of the transaction -//@star_count The amount of added owned Telegram Stars; negative for outgoing transactions +//@star_amount The amount of added owned Telegram Stars; negative for outgoing transactions //@is_refund True, if the transaction is a refund of a previous transaction //@date Point in time (Unix timestamp) when the transaction was completed -//@partner Source of the incoming transaction, or its recipient for outgoing transactions -starTransaction id:string star_count:int53 is_refund:Bool date:int32 partner:StarTransactionPartner = StarTransaction; +//@type Type of the transaction +starTransaction id:string star_amount:starAmount is_refund:Bool date:int32 type:StarTransactionType = StarTransaction; //@description Represents a list of Telegram Star transactions -//@star_count The amount of owned Telegram Stars +//@star_amount The amount of owned Telegram Stars //@transactions List of transactions with Telegram Stars //@next_offset The offset for the next request. If empty, then there are no more results -starTransactions star_count:int53 transactions:vector next_offset:string = StarTransactions; +starTransactions star_amount:starAmount transactions:vector next_offset:string = StarTransactions; //@class GiveawayParticipantStatus @description Contains information about status of a user in a giveaway @@ -1160,20 +1371,18 @@ usernames active_usernames:vector disabled_usernames:vector edit //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null -//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only -//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only -//@profile_accent_color_id Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only -//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only -//@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only +//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none +//@profile_accent_color_id Identifier of the accent color for the user's profile; -1 if none +//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none +//@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user //@is_close_friend The user is a close friend of the current user; implies that the user is a contact -//@is_verified True, if the user is verified +//@verification_status Information about verification status of the user; may be null if none //@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted -//@is_scam True, if many users reported this user as a scam -//@is_fake True, if many users reported this user as a fake account //@has_active_stories True, if the user has non-expired stories available to the current user //@has_unread_active_stories True, if the user has unread non-expired stories available to the current user //@restricts_new_chats True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them @@ -1181,7 +1390,7 @@ usernames active_usernames:vector disabled_usernames:vector edit //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool verification_status:verificationStatus is_premium:Bool is_support:Bool restriction_reason:string has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -1194,10 +1403,12 @@ user id:int53 first_name:string last_name:string usernames:usernames phone_numbe //@privacy_policy_url The HTTP link to the privacy policy of the bot. If empty, then /privacy command must be used if supported by the bot. If the command isn't supported, then https://telegram.org/privacy-tpa must be opened //@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@affiliate_program Information about the affiliate program of the bot; may be null if none //@web_app_background_light_color Default light background color for bot Web Apps; -1 if not specified //@web_app_background_dark_color Default dark background color for bot Web Apps; -1 if not specified //@web_app_header_light_color Default light header color for bot Web Apps; -1 if not specified //@web_app_header_dark_color Default dark header color for bot Web Apps; -1 if not specified +//@verification_parameters Parameters of the verification that can be provided by the bot; may be null if none or the current user isn't the owner of the bot //@can_get_revenue_statistics True, if the bot's revenue statistics are available to the current user //@can_manage_emoji_status True, if the bot can manage emoji status of the current user //@has_media_previews True, if the bot has media previews @@ -1205,7 +1416,7 @@ user id:int53 first_name:string last_name:string usernames:usernames phone_numbe //@edit_description_link The internal link, which can be used to edit bot description; may be null //@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null //@edit_settings_link The internal link, which can be used to edit bot settings; may be null -botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; +botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights affiliate_program:affiliateProgramInfo web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 verification_parameters:botVerificationParameters can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; //@description Contains full information about a user //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -1229,9 +1440,10 @@ botInfo short_description:string description:string photo:photo animation:animat //@personal_chat_id Identifier of the personal chat of the user; 0 if none //@gift_count Number of gifts saved to profile by the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user +//@bot_verification Information about verification status of the user provided by a bot; may be null if none or unknown //@business_info Information about business settings for Telegram Business accounts; may be null if none //@bot_info For bots, information about the bot; may be null if the user isn't a bot -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo; +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 bot_verification:botVerification business_info:businessInfo bot_info:botInfo = UserFullInfo; //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -1413,10 +1625,8 @@ chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing can_reuse:Bool fo //@subscription_info Information about subscription plan that must be paid by the user to use the link; may be null if the link doesn't require subscription //@creates_join_request True, if the link only creates join request //@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup -//@is_verified True, if the chat is verified -//@is_scam True, if many users reported this chat as a scam -//@is_fake True, if many users reported this chat as a fake account -chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; +//@verification_status Information about verification status of the chat; may be null if none +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool verification_status:verificationStatus = ChatInviteLinkInfo; //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user @@ -1471,14 +1681,12 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members //@is_forum True, if the supergroup is a forum with topics -//@is_verified True, if the supergroup or channel is verified +//@verification_status Information about verification status of the supergroup or channel; may be null if none //@has_sensitive_content True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted -//@is_scam True, if many users reported this supergroup or channel as a scam -//@is_fake True, if many users reported this supergroup or channel as a fake account //@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user //@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user -supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool has_sensitive_content:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool verification_status:verificationStatus has_sensitive_content:Bool restriction_reason:string has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -1513,9 +1721,10 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe //@location Location to which the supergroup is connected; may be null if none //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@bot_commands List of commands of bots in the group +//@bot_verification Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector bot_verification:botVerification upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -2033,8 +2242,13 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" chatFolderIcon name:string = ChatFolderIcon; +//@description Describes name of a chat folder +//@text The text of the chat folder name; 1-12 characters without line feeds. May contain only CustomEmoji entities +//@animate_custom_emoji True, if custom emoji in the name must be animated +chatFolderName text:formattedText animate_custom_emoji:Bool = ChatFolderName; + //@description Represents a folder for user chats -//@title The title of the folder; 1-12 characters without line feeds +//@name The name of the folder //@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder //@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription //@is_shareable True, if at least one link has been created for the folder @@ -2049,16 +2263,16 @@ chatFolderIcon name:string = ChatFolderIcon; //@include_bots True, if bots need to be included //@include_groups True, if basic groups and supergroups need to be included //@include_channels True, if channels need to be included -chatFolder title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; +chatFolder name:chatFolderName icon:chatFolderIcon color_id:int32 is_shareable:Bool pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; //@description Contains basic information about a chat folder //@id Unique chat folder identifier -//@title The title of the folder; 1-12 characters without line feeds +//@name The name of the folder //@icon The chosen or default icon for the chat folder //@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled //@is_shareable True, if at least one link has been created for the folder //@has_my_invite_links True, if the chat folder has invite links created by the current user -chatFolderInfo id:int32 title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; +chatFolderInfo id:int32 name:chatFolderName icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; //@description Contains a chat folder invite link //@invite_link The chat folder invite link @@ -3783,14 +3997,33 @@ messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string a //@sticker A sticker to be shown in the message; may be null if unknown messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent; -//@description A gift was received or sent by the current user +//@description A regular gift was received or sent by the current user //@gift The gift //@text Message added to the gift -//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift; 0 if the gift can't be sold by the receiver +//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver +//@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them //@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift +//@can_be_upgraded True, if the gift can be upgraded to a unique gift; only for the receiver of the gift //@was_converted True, if the gift was converted to Telegram Stars; only for the receiver of the gift -messageGift gift:gift text:formattedText sell_star_count:int53 is_private:Bool is_saved:Bool was_converted:Bool = MessageContent; +//@was_upgraded True, if the gift was upgraded to a unique gift +//@was_refunded True, if the gift was refunded and isn't available anymore +//@upgrade_message_id Identifier of the service message messageUpgradedGift or messageRefundedUpgradedGift with upgraded version of the gift; can be 0 if none or an identifier of a deleted message. +//-Use getUserGift to get information about the gift +messageGift gift:gift text:formattedText sell_star_count:int53 prepaid_upgrade_star_count:int53 is_private:Bool is_saved:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgrade_message_id:int53 = MessageContent; + +//@description An upgraded gift was received or sent by the current user +//@gift The gift +//@is_upgrade True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift +//@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift +//@can_be_transferred True, if the gift can be transferred to another user; only for the receiver of the gift +//@was_transferred True, if the gift was transferred to another user; only for the receiver of the gift +//@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift +//@export_date Point in time (Unix timestamp) when the gift can be transferred to TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift +messageUpgradedGift gift:upgradedGift is_upgrade:Bool is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 export_date:int32 = MessageContent; + +//@description A gift which purchase, upgrade or transfer were refunded @gift The gift @is_upgrade True, if the gift was obtained by upgrading of a previously received gift +messageRefundedUpgradedGift gift:gift is_upgrade:Bool = MessageContent; //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -4201,6 +4434,18 @@ searchMessagesFilterFailedToSend = SearchMessagesFilter; searchMessagesFilterPinned = SearchMessagesFilter; +//@class SearchMessagesChatTypeFilter @description Represents a filter for type of the chats in which to search messages + +//@description Returns only messages in private chats +searchMessagesChatTypeFilterPrivate = SearchMessagesChatTypeFilter; + +//@description Returns only messages in basic group and supergroup chats +searchMessagesChatTypeFilterGroup = SearchMessagesChatTypeFilter; + +//@description Returns only messages in channel chats +searchMessagesChatTypeFilterChannel = SearchMessagesChatTypeFilter; + + //@class ChatAction @description Describes the different types of activity in a chat //@description The user is typing a message @@ -4791,6 +5036,10 @@ callDiscardReasonDisconnected = CallDiscardReason; //@description The call was ended because one of the parties hung up callDiscardReasonHungUp = CallDiscardReason; +//@description The call was ended because it has been used successfully to transfer private encryption key for the associated group call +//@encrypted_group_call_key Encrypted using the call private key encryption key for the associated group call +callDiscardReasonAllowGroupCall encrypted_group_call_key:bytes = CallDiscardReason; + //@description Specifies the supported call protocols //@udp_p2p True, if UDP peer-to-peer connections are supported @@ -4981,7 +5230,8 @@ callProblemPixelatedVideo = CallProblem; //@is_outgoing True, if the call is outgoing //@is_video True, if the call is a video call //@state Call state -call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call; +//@group_call_id Identifier of the group call associated with the call; 0 if the group call isn't created yet. The group call can be received through the method getGroupCall +call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState group_call_id:int32 = Call; //@class FirebaseAuthenticationSettings @description Contains settings for Firebase Authentication in the official applications @@ -5161,7 +5411,7 @@ targetChatTypes allow_user_chats:Bool allow_bot_chats:Bool allow_group_chats:Boo //@class TargetChat @description Describes the target chat to be opened -//@description The currently opened chat needs to be kept +//@description The currently opened chat and forum topic must be kept targetChatCurrent = TargetChat; //@description The chat needs to be chosen by the user among chats of the specified types @types Allowed types for the chat @@ -5190,7 +5440,6 @@ inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thum //@description Represents a link to an article or web page //@id Unique identifier of the query result //@url URL of the result, if it exists -//@hide_url True, if the URL must be not shown //@title Title of the result //@param_description A short description of the result //@thumbnail_url URL of the result thumbnail, if it exists @@ -5198,7 +5447,7 @@ inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thum //@thumbnail_height Thumbnail height, if known //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact -inputInlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; +inputInlineQueryResultArticle id:string url:string title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; //@description Represents a link to an MP3 audio file //@id Unique identifier of the query result @@ -5312,11 +5561,10 @@ inputInlineQueryResultVoiceNote id:string title:string voice_note_url:string voi //@description Represents a link to an article or web page //@id Unique identifier of the query result //@url URL of the result, if it exists -//@hide_url True, if the URL must be not shown //@title Title of the result //@param_description A short description of the result //@thumbnail Result thumbnail in JPEG format; may be null -inlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail:thumbnail = InlineQueryResult; +inlineQueryResultArticle id:string url:string title:string description:string thumbnail:thumbnail = InlineQueryResult; //@description Represents a user contact //@id Unique identifier of the query result @@ -6282,6 +6530,10 @@ pushMessageContentGiveaway winner_count:int32 prize:GiveawayPrize is_pinned:Bool //@description A message with a gift @star_count Number of Telegram Stars that sender paid for the gift pushMessageContentGift star_count:int53 = PushMessageContent; +//@description A message with an upgraded gift +//@is_upgrade True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift +pushMessageContentUpgradedGift is_upgrade:Bool = PushMessageContent; + //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken = PushMessageContent; @@ -6809,6 +7061,11 @@ internalLinkTypeBuyStars star_count:int53 purpose:string = InternalLinkType; //@description The link is a link to the change phone number section of the application internalLinkTypeChangePhoneNumber = InternalLinkType; +//@description The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link +//@username Username to be passed to searchChatAffiliateProgram +//@referrer Referrer to be passed to searchChatAffiliateProgram +internalLinkTypeChatAffiliateProgram username:string referrer:string = InternalLinkType; + //@description The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. //-If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. //-If the user wants to boost the chat and the chat can be boosted, then call boostChat @@ -7054,6 +7311,18 @@ fileTypeSecretThumbnail = FileType; //@description The file is a file from Secure storage used for storing Telegram Passport files fileTypeSecure = FileType; +//@description The file is a self-destructing photo in a private chat +fileTypeSelfDestructingPhoto = FileType; + +//@description The file is a self-destructing video in a private chat +fileTypeSelfDestructingVideo = FileType; + +//@description The file is a self-destructing video note in a private chat +fileTypeSelfDestructingVideoNote = FileType; + +//@description The file is a self-destructing voice note in a private chat +fileTypeSelfDestructingVoiceNote = FileType; + //@description The file is a sticker fileTypeSticker = FileType; @@ -7311,6 +7580,9 @@ suggestedActionGiftPremiumForChristmas = SuggestedAction; //@description Suggests the user to set birthdate suggestedActionSetBirthdate = SuggestedAction; +//@description Suggests the user to set profile photo +suggestedActionSetProfilePhoto = SuggestedAction; + //@description Suggests the user to extend their expiring Telegram Premium subscription @manage_premium_subscription_url A URL for managing Telegram Premium subscription suggestedActionExtendPremium manage_premium_subscription_url:string = SuggestedAction; @@ -7552,12 +7824,12 @@ chatRevenueTransactions total_count:int32 transactions:vector = Update; //@description The list of supported accent colors has changed //@colors Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported //-and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme -//@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order +//@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specified order updateAccentColors colors:vector available_accent_color_ids:vector = Update; //@description The list of supported accent colors for user profiles has changed //@colors Information about supported colors -//@available_accent_color_ids The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specififed order +//@available_accent_color_ids The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specified order updateProfileAccentColors colors:vector available_accent_color_ids:vector = Update; //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings; empty if all strings have changed @@ -8091,8 +8363,8 @@ updateSavedMessagesTags saved_messages_topic_id:int53 tags:savedMessagesTags = U //@messages The list of messages with active live locations updateActiveLiveLocationMessages messages:vector = Update; -//@description The number of Telegram Stars owned by the current user has changed @star_count The new number of Telegram Stars owned -updateOwnedStarCount star_count:int53 = Update; +//@description The number of Telegram Stars owned by the current user has changed @star_amount The new amount of owned Telegram Stars +updateOwnedStarCount star_amount:starAmount = Update; //@description The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions //@chat_id Identifier of the chat @@ -8743,14 +9015,14 @@ searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_messa //@description Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). //-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported -//@only_in_channels Pass true to search only for messages in channels //@query Query to search for //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function +//@chat_type_filter Additional filter for type of the chat of the searched messages; pass null to search for messages in all chats //@min_date If not 0, the minimum date of the messages to return //@max_date If not 0, the maximum date of the messages to return -searchMessages chat_list:ChatList only_in_channels:Bool query:string offset:string limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = FoundMessages; +searchMessages chat_list:ChatList query:string offset:string limit:int32 filter:SearchMessagesFilter chat_type_filter:SearchMessagesChatTypeFilter min_date:int32 max_date:int32 = FoundMessages; //@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats @@ -9536,7 +9808,7 @@ answerInlineQuery inline_query_id:int64 is_personal:Bool button:inlineQueryResul //@chat_types Types of the chats to which the message can be sent savePreparedInlineMessage user_id:int53 result:InputInlineQueryResult chat_types:targetChatTypes = PreparedInlineMessageId; -//@description Saves an inline message to be sent by the given user; for bots only +//@description Saves an inline message to be sent by the given user //@bot_user_id Identifier of the bot that created the message //@prepared_message_id Identifier of the prepared message getPreparedInlineMessage bot_user_id:int53 prepared_message_id:string = PreparedInlineMessage; @@ -10111,7 +10383,7 @@ editStoryCover story_sender_chat_id:int53 story_id:int32 cover_frame_timestamp:d //@description Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true //@story_id Identifier of the story -//@privacy_settings The new privacy settigs for the story +//@privacy_settings The new privacy settings for the story setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; //@description Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_posted_to_chat_page == true @@ -10498,8 +10770,12 @@ processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok; processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok; -//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video Pass true to create a video call -createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId; +//@description Creates a new call +//@user_id Identifier of the user to be called +//@protocol The call protocols supported by the application +//@is_video Pass true to create a video call +//@group_call_id Identifier of the group call to which the user will be added after exchanging private key via the call; pass 0 if none; currently, ignored +createCall user_id:int53 protocol:callProtocol is_video:Bool group_call_id:int32 = CallId; //@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application acceptCall call_id:int32 protocol:callProtocol = Ok; @@ -10539,9 +10815,12 @@ setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSende //@chat_id Identifier of a chat in which the video chat will be created //@title Group call title; if empty, chat title will be used //@start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future -//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges +//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId; +//@description Creates a group call from a one-to-one call @call_id Call identifier +createGroupCall call_id:int32 = Ok; + //@description Returns RTMP URL for streaming to the chat; requires can_manage_video_chats administrator right @chat_id Chat identifier getVideoChatRtmpUrl chat_id:int53 = RtmpUrl; @@ -10769,9 +11048,12 @@ getAllStickerEmojis sticker_type:StickerType query:string chat_id:int53 return_o //@description Searches for stickers from public sticker sets that correspond to any of the given emoji //@sticker_type Type of the stickers to return -//@emojis Space-separated list of emojis to search for; must be non-empty +//@emojis Space-separated list of emojis to search for +//@query Query to search for; may be empty to search for emoji only +//@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown +//@offset The offset from which to return the stickers; must be non-negative //@limit The maximum number of stickers to be returned; 0-100 -searchStickers sticker_type:StickerType emojis:string limit:int32 = Stickers; +searchStickers sticker_type:StickerType emojis:string query:string input_language_codes:vector offset:int32 limit:int32 = Stickers; //@description Returns greeting stickers from regular sticker sets that can be used for the start page of other users getGreetingStickers = Stickers; @@ -10901,6 +11183,9 @@ removeSavedAnimation animation:InputFile = Ok; //@description Returns up to 20 recently used inline bots in the order of their last usage getRecentInlineBots = Users; +//@description Returns the list of bots owned by the current user +getOwnedBots = Users; + //@description Searches for recently used hashtags by their prefix @prefix Hashtag prefix to search for @limit The maximum number of hashtags to be returned searchHashtags prefix:string limit:int32 = Hashtags; @@ -11172,6 +11457,19 @@ setBotInfoShortDescription bot_user_id:int53 language_code:string short_descript getBotInfoShortDescription bot_user_id:int53 language_code:string = Text; +//@description Changes the verification status of a user or a chat by an owned bot +//@bot_user_id Identifier of the owned bot, which will verify the user or the chat +//@verified_id Identifier of the user or the supergroup or channel chat, which will be verified by the bot +//@custom_description Custom description of verification reason; 0-getOption("bot_verification_custom_description_length_max"). +//-If empty, then "was verified by organization "organization_name"" will be used as description. Can be specified only if the bot is allowed to provide custom description +setMessageSenderBotVerification bot_user_id:int53 verified_id:MessageSender custom_description:string = Ok; + +//@description Removes the verification status of a user or a chat by an owned bot +//@bot_user_id Identifier of the owned bot, which verified the user or the chat +//@verified_id Identifier of the user or the supergroup or channel chat, which verification is removed +removeMessageSenderBotVerification bot_user_id:int53 verified_id:MessageSender = Ok; + + //@description Returns all active sessions of the current user getActiveSessions = Sessions; @@ -11354,7 +11652,8 @@ getAvailableGifts = Gifts; //@user_id Identifier of the user that will receive the gift //@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed //@is_private Pass true to show the current user as sender and gift text only to the gift receiver; otherwise, everyone will be able to see them -sendGift gift_id:int64 user_id:int53 text:formattedText is_private:Bool = Ok; +//@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free +sendGift gift_id:int64 user_id:int53 text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok; //@description Sells a gift received by the current user for Telegram Stars //@sender_user_id Identifier of the user that sent the gift @@ -11367,12 +11666,31 @@ sellGift sender_user_id:int53 message_id:int53 = Ok; //@is_saved Pass true to display the gift on the user's profile page; pass false to remove it from the profile page toggleGiftIsSaved sender_user_id:int53 message_id:int53 is_saved:Bool = Ok; +//@description Returns examples of possible upgraded gifts for a regular gift @gift_id Identifier of the gift +getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview; + +//@description Upgrades a gift received by the current user. Unless the gift has prepaid_upgrade_star_count > 0, the user must pay gift.upgrade_star_count Telegram Stars for the upgrade +//@sender_user_id Identifier of the user that sent the gift +//@message_id Identifier of the message with the gift in the chat with the user +//@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift +upgradeGift sender_user_id:int53 message_id:int53 keep_original_details:Bool = UpgradeGiftResult; + +//@description Sends a gift upgraded by the current user to another user +//@sender_user_id Identifier of the user that sent the gift +//@message_id Identifier of the message with the upgraded gift in the chat with the user +//@receiver_user_id Identifier of the user that will receive the gift +//@star_count The amount of Telegram Stars required for the transfer +transferGift sender_user_id:int53 message_id:int53 receiver_user_id:int53 star_count:int53 = Ok; + //@description Returns gifts saved to profile by the given user //@user_id Identifier of the user //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit getUserGifts user_id:int53 offset:string limit:int32 = UserGifts; +//@description Returns information about a gift received or sent by the current user @message_id Identifier of the message with the gift +getUserGift message_id:int53 = UserGift; + //@description Creates a link for the given invoice; for bots only //@business_connection_id Unique identifier of business connection on behalf of which to send the request @@ -11899,6 +12217,46 @@ editUserStarSubscription user_id:int53 telegram_payment_charge_id:string is_canc reuseStarSubscription subscription_id:string = Ok; +//@description Changes affiliate program for a bot +//@chat_id Identifier of the chat with an owned bot for which affiliate program is changed +//@parameters Parameters of the affiliate program; pass null to close the currently active program. If there is an active program, then commission and program duration can only be increased. +//-If the active program is scheduled to be closed, then it can't be changed anymore +setChatAffiliateProgram chat_id:int53 parameters:affiliateProgramParameters = Ok; + +//@description Searches a chat with an affiliate program. Returns the chat if found and the program is active +//@username Username of the chat +//@referrer The referrer from an internalLinkTypeChatAffiliateProgram link +searchChatAffiliateProgram username:string referrer:string = Chat; + +//@description Searches affiliate programs that can be connected to the given affiliate +//@affiliate The affiliate for which affiliate programs are searched for +//@sort_order Sort order for the results +//@offset Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of affiliate programs to return +searchAffiliatePrograms affiliate:AffiliateType sort_order:AffiliateProgramSortOrder offset:string limit:int32 = FoundAffiliatePrograms; + +//@description Connects an affiliate program to the given affiliate. Returns information about the connected affiliate program +//@affiliate The affiliate to which the affiliate program will be connected +//@bot_user_id Identifier of the bot, which affiliate program is connected +connectAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAffiliateProgram; + +//@description Disconnects an affiliate program from the given affiliate and immediately deactivates its referral link. Returns updated information about the disconnected affiliate program +//@affiliate The affiliate to which the affiliate program is connected +//@url The referral link of the affiliate program +disconnectAffiliateProgram affiliate:AffiliateType url:string = ConnectedAffiliateProgram; + +//@description Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program +//@affiliate The affiliate to which the affiliate program will be connected +//@bot_user_id Identifier of the bot that created the program +getConnectedAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAffiliateProgram; + +//@description Returns affiliate programs that were connected to the given affiliate +//@affiliate The affiliate to which the affiliate program were connected +//@offset Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of affiliate programs to return +getConnectedAffiliatePrograms affiliate:AffiliateType offset:string limit:int32 = ConnectedAffiliatePrograms; + + //@description Returns information about features, available to Business users @source Source of the request; pass null if the method is called from settings or some non-standard source getBusinessFeatures source:BusinessFeature = BusinessFeatures; diff --git a/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl b/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl index d988db13..94f88fba 100644 --- a/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl +++ b/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl @@ -108,7 +108,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#83314fca flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int = User; +user#4b46c37e flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -123,11 +123,11 @@ userStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus; chatEmpty#29562865 id:long = Chat; chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; chatForbidden#6592a1a7 id:long title:string = Chat; -channel#fe4478bd flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int = Chat; +channel#e00998b7 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull; -channelFull#bbab348d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet = ChatFull; +channelFull#9ff3b858 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification = ChatFull; chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant; chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant; @@ -140,8 +140,8 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto; messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message; -message#94345242 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck = Message; -messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message; +message#96fdbbe9 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int = Message; +messageService#d3d28540 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message; messageMediaEmpty#3ded6320 = MessageMedia; messageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia; @@ -207,7 +207,8 @@ messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int = UserFull; +userFull#4d975bbc flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification = UserFull; contact#145ade0b user_id:long mutual:Bool = Contact; @@ -395,7 +396,7 @@ updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vec updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector pts:int pts_count:int = Update; updateChat#f89a6a4e chat_id:long = Update; updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update; -updateGroupCall#14b24500 chat_id:long call:GroupCall = Update; +updateGroupCall#97d64341 flags:# chat_id:flags.0?long call:GroupCall = Update; updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update; updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update; updateChannelParticipant#985d3abb flags:# via_chatlist:flags.3?true channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update; @@ -445,7 +446,7 @@ updateBotEditBusinessMessage#7df587c flags:# connection_id:string message:Messag updateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:Vector qts:int = Update; updateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update; updateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = Update; -updateStarsBalance#fb85198 balance:long = Update; +updateStarsBalance#4e80a379 balance:StarsAmount = Update; updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update; updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update; updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; @@ -643,7 +644,7 @@ chatInviteExported#a22cbd96 flags:# revoked:flags.0?true permanent:flags.5?true chatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite; chatInviteAlready#5a686d7c chat:Chat = ChatInvite; -chatInvite#fe65389d flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true verified:flags.7?true scam:flags.8?true fake:flags.9?true can_refulfill_subscription:flags.11?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector color:int subscription_pricing:flags.10?StarsSubscriptionPricing subscription_form_id:flags.12?long = ChatInvite; +chatInvite#5c9d3702 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true verified:flags.7?true scam:flags.8?true fake:flags.9?true can_refulfill_subscription:flags.11?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector color:int subscription_pricing:flags.10?StarsSubscriptionPricing subscription_form_id:flags.12?long bot_verification:flags.13?BotVerification = ChatInvite; chatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite; inputStickerSetEmpty#ffb62b95 = InputStickerSet; @@ -665,7 +666,7 @@ messages.stickerSetNotModified#d3f924eb = messages.StickerSet; botCommand#c27ac8c7 command:string description:string = BotCommand; -botInfo#36607333 flags:# has_preview_medias:flags.6?true user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector menu_button:flags.3?BotMenuButton privacy_policy_url:flags.7?string app_settings:flags.8?BotAppSettings = BotInfo; +botInfo#4d8a0299 flags:# has_preview_medias:flags.6?true user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector menu_button:flags.3?BotMenuButton privacy_policy_url:flags.7?string app_settings:flags.8?BotAppSettings verifier_settings:flags.9?BotVerifierSettings = BotInfo; keyboardButton#a2fa4880 text:string = KeyboardButton; keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton; @@ -918,6 +919,7 @@ phoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason; phoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason; phoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason; phoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason; +phoneCallDiscardReasonAllowGroupCall#afe2b839 encrypted_key:bytes = PhoneCallDiscardReason; dataJSON#7d748d04 data:string = DataJSON; @@ -972,11 +974,11 @@ inputStickerSetItem#32da9e9c flags:# document:InputDocument emoji:string mask_co inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall; phoneCallEmpty#5366c915 id:long = PhoneCall; -phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall; -phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall; -phoneCall#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int custom_parameters:flags.7?DataJSON = PhoneCall; -phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall; +phoneCallWaiting#eed42858 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int conference_call:flags.8?InputGroupCall = PhoneCall; +phoneCallRequested#45361c63 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall; +phoneCallAccepted#22fd7181 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall; +phoneCall#3ba5940c flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int custom_parameters:flags.7?DataJSON conference_call:flags.8?InputGroupCall = PhoneCall; +phoneCallDiscarded#f9d25503 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int conference_call:flags.8?InputGroupCall = PhoneCall; phoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection; phoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection; @@ -1297,9 +1299,9 @@ bankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl; payments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData; -dialogFilter#5fb5523b flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string color:flags.27?int pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter; +dialogFilter#aa472651 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true title_noanimate:flags.28?true id:int title:TextWithEntities emoticon:flags.25?string color:flags.27?int pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter; dialogFilterDefault#363293ae = DialogFilter; -dialogFilterChatlist#9fe28ea4 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string color:flags.27?int pinned_peers:Vector include_peers:Vector = DialogFilter; +dialogFilterChatlist#96537bd7 flags:# has_my_invites:flags.26?true title_noanimate:flags.28?true id:int title:TextWithEntities emoticon:flags.25?string color:flags.27?int pinned_peers:Vector include_peers:Vector = DialogFilter; dialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested; @@ -1355,7 +1357,7 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; -groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall; +groupCall#cdf8d3e3 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int conference_from_call:flags.14?long = GroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; @@ -1496,7 +1498,9 @@ inputInvoiceSlug#c326caef slug:string = InputInvoice; inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice; inputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice; inputInvoiceChatInviteSubscription#34e793f1 hash:string = InputInvoice; -inputInvoiceStarGift#25d8c1d8 flags:# hide_name:flags.0?true user_id:InputUser gift_id:long message:flags.1?TextWithEntities = InputInvoice; +inputInvoiceStarGift#25d8c1d8 flags:# hide_name:flags.0?true include_upgrade:flags.2?true user_id:InputUser gift_id:long message:flags.1?TextWithEntities = InputInvoice; +inputInvoiceStarGiftUpgrade#5ebe7262 flags:# keep_original_details:flags.0?true msg_id:int = InputInvoice; +inputInvoiceStarGiftTransfer#ae3ba9ed msg_id:int to_id:InputUser = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; @@ -1614,7 +1618,7 @@ chatlists.exportedChatlistInvite#10e6e3a6 filter:DialogFilter invite:ExportedCha chatlists.exportedInvites#10ab6dc7 invites:Vector chats:Vector users:Vector = chatlists.ExportedInvites; chatlists.chatlistInviteAlready#fa87f659 filter_id:int missing_peers:Vector already_peers:Vector chats:Vector users:Vector = chatlists.ChatlistInvite; -chatlists.chatlistInvite#1dcd839d flags:# title:string emoticon:flags.0?string peers:Vector chats:Vector users:Vector = chatlists.ChatlistInvite; +chatlists.chatlistInvite#f10ece2f flags:# title_noanimate:flags.1?true title:TextWithEntities emoticon:flags.0?string peers:Vector chats:Vector users:Vector = chatlists.ChatlistInvite; chatlists.chatlistUpdates#93bd878d missing_peers:Vector chats:Vector users:Vector = chatlists.ChatlistUpdates; @@ -1855,9 +1859,9 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#35d4f276 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int = StarsTransaction; +starsTransaction#64dfc926 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount = StarsTransaction; -payments.starsStatus#bbfa316c flags:# balance:long subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; +payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; foundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory; @@ -1865,7 +1869,7 @@ stories.foundStories#e2de7737 flags:# count:int stories:Vector next_ geoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:flags.1?string street:flags.2?string = GeoPointAddress; -starsRevenueStatus#79342946 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long next_withdrawal_at:flags.1?int = StarsRevenueStatus; +starsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus; payments.starsRevenueStats#c92bb73b revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats; @@ -1893,12 +1897,13 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; -starGift#49c577cd flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int = StarGift; +starGift#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift; +starGiftUnique#6a1407cd id:long title:string num:int owner_id:long attributes:Vector availability_issued:int availability_total:int = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#901689ea hash:int gifts:Vector = payments.StarGifts; -userStarGift#eea49a6e flags:# name_hidden:flags.0?true unsaved:flags.5?true from_id:flags.1?long date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int convert_stars:flags.4?long = UserStarGift; +userStarGift#325835e1 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true from_id:flags.1?long date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long = UserStarGift; payments.userStarGifts#6b65b517 flags:# count:int gifts:Vector next_offset:flags.0?string users:Vector = payments.UserStarGifts; @@ -1914,6 +1919,30 @@ messages.preparedInlineMessage#ff57708d query_id:long result:BotInlineResult pee botAppSettings#c99b1950 flags:# placeholder_path:flags.0?bytes background_color:flags.1?int background_dark_color:flags.2?int header_color:flags.3?int header_dark_color:flags.4?int = BotAppSettings; +starRefProgram#dd0c66f2 flags:# bot_id:long commission_permille:int duration_months:flags.0?int end_date:flags.1?int daily_revenue_per_user:flags.2?StarsAmount = StarRefProgram; + +connectedBotStarRef#19a13f71 flags:# revoked:flags.1?true url:string date:int bot_id:long commission_permille:int duration_months:flags.0?int participants:long revenue:long = ConnectedBotStarRef; + +payments.connectedStarRefBots#98d5ea1d count:int connected_bots:Vector users:Vector = payments.ConnectedStarRefBots; + +payments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector users:Vector next_offset:flags.0?string = payments.SuggestedStarRefBots; + +starsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount; + +messages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers; +messages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector = messages.FoundStickers; + +botVerifierSettings#b0cd6617 flags:# can_modify_custom_description:flags.1?true icon:long company:string custom_description:flags.0?string = BotVerifierSettings; + +botVerification#f93cd45c bot_id:long icon:long description:string = BotVerification; + +starGiftAttributeModel#39d99013 name:string document:Document rarity_permille:int = StarGiftAttribute; +starGiftAttributePattern#13acff19 name:string document:Document rarity_permille:int = StarGiftAttribute; +starGiftAttributeBackdrop#94271762 name:string center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; +starGiftAttributeOriginalDetails#c02c4f4b flags:# sender_id:flags.0?long recipient_id:long date:int message:flags.1?TextWithEntities = StarGiftAttribute; + +payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector = payments.StarGiftUpgradePreview; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2079,7 +2108,7 @@ contacts.block#2e2e8734 flags:# my_stories_from:flags.0?true id:InputPeer = Bool contacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bool; contacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked; contacts.search#11f812d8 q:string limit:int = contacts.Found; -contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer; +contacts.resolveUsername#725afbbc flags:# username:string referer:flags.0?string = contacts.ResolvedPeer; contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true offset:int limit:int hash:long = contacts.TopPeers; contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool; contacts.resetSaved#879537f1 = Bool; @@ -2143,7 +2172,7 @@ messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_par messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector increment:Bool = messages.MessageViews; messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool; messages.migrateChat#a2875319 chat_id:long = Updates; -messages.searchGlobal#4bc6589a flags:# broadcasts_only:flags.1?true folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; +messages.searchGlobal#4bc6589a flags:# broadcasts_only:flags.1?true groups_only:flags.2?true users_only:flags.3?true folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages; messages.reorderStickerSets#78337739 flags:# masks:flags.0?true emojis:flags.1?true order:Vector = Bool; messages.getDocumentByHash#b1f2061f sha256:bytes size:long mime_type:string = Document; messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs; @@ -2319,6 +2348,8 @@ messages.reportSponsoredMessage#1af3dbb8 peer:InputPeer random_id:bytes option:b messages.getSponsoredMessages#9bd2f439 peer:InputPeer = messages.SponsoredMessages; messages.savePreparedInlineMessage#f21f7f2f flags:# result:InputBotInlineResult user_id:InputUser peer_types:flags.0?Vector = messages.BotPreparedInlineMessage; messages.getPreparedInlineMessage#857ebdb8 bot:InputUser id:string = messages.PreparedInlineMessage; +messages.searchStickers#29b1c66a flags:# emojis:flags.0?true q:string emoticon:string lang_code:Vector offset:int limit:int hash:long = messages.FoundStickers; +messages.reportMessagesDelivery#5a6d7395 flags:# push:flags.0?true peer:InputPeer id:Vector = Bool; updates.getState#edd4882a = updates.State; updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference; @@ -2453,6 +2484,9 @@ bots.getPreviewMedias#a2a5594d bot:InputUser = Vector; bots.updateUserEmojiStatus#ed9f30c5 user_id:InputUser emoji_status:EmojiStatus = Bool; bots.toggleUserEmojiStatusPermission#6de6392 bot:InputUser enabled:Bool = Bool; bots.checkDownloadFileParams#50077589 bot:InputUser file_name:string url:string = Bool; +bots.getAdminedBots#b0711d83 = Vector; +bots.updateStarRefProgram#778b5ab3 flags:# bot:InputUser commission_permille:int duration_months:flags.0?int = StarRefProgram; +bots.setCustomVerification#8b89dfbd flags:# enabled:flags.1?true bot:flags.0?InputUser peer:InputPeer custom_description:flags.2?string = Bool; payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm; payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt; @@ -2486,9 +2520,18 @@ payments.fulfillStarsSubscription#cc5bebb3 peer:InputPeer subscription_id:string payments.getStarsGiveawayOptions#bd1efd3e = Vector; payments.getStarGifts#c4563590 hash:int = payments.StarGifts; payments.getUserStarGifts#5e72c7e1 user_id:InputUser offset:string limit:int = payments.UserStarGifts; -payments.saveStarGift#87acf08e flags:# unsave:flags.0?true user_id:InputUser msg_id:int = Bool; -payments.convertStarGift#421e027 user_id:InputUser msg_id:int = Bool; +payments.saveStarGift#92fd2aae flags:# unsave:flags.0?true msg_id:int = Bool; +payments.convertStarGift#72770c83 msg_id:int = Bool; payments.botCancelStarsSubscription#6dfa0622 flags:# restore:flags.0?true user_id:InputUser charge_id:string = Bool; +payments.getConnectedStarRefBots#5869a553 flags:# peer:InputPeer offset_date:flags.2?int offset_link:flags.2?string limit:int = payments.ConnectedStarRefBots; +payments.getConnectedStarRefBot#b7d998f0 peer:InputPeer bot:InputUser = payments.ConnectedStarRefBots; +payments.getSuggestedStarRefBots#d6b48f7 flags:# order_by_revenue:flags.0?true order_by_date:flags.1?true peer:InputPeer offset:string limit:int = payments.SuggestedStarRefBots; +payments.connectStarRefBot#7ed5348a peer:InputPeer bot:InputUser = payments.ConnectedStarRefBots; +payments.editConnectedStarRefBot#e4fca4a3 flags:# revoked:flags.0?true peer:InputPeer link:string = payments.ConnectedStarRefBots; +payments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgradePreview; +payments.upgradeStarGift#cf4f0781 flags:# keep_original_details:flags.0?true msg_id:int = Updates; +payments.transferStarGift#333fb526 msg_id:int to_id:InputUser = Updates; +payments.getUserStarGift#b502e4a5 msg_id:Vector = payments.UserStarGifts; stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; @@ -2503,7 +2546,7 @@ stickers.deleteStickerSet#87704394 stickerset:InputStickerSet = Bool; stickers.replaceSticker#4696459a sticker:InputDocument new_sticker:InputStickerSetItem = messages.StickerSet; phone.getCallConfig#55451fa9 = DataJSON; -phone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; +phone.requestCall#a6c4600c flags:# video:flags.0?true user_id:InputUser conference_call:flags.1?InputGroupCall random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall; phone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall; phone.receivedCall#17d54f61 peer:InputPhoneCall = Bool; @@ -2512,7 +2555,7 @@ phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhon phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool; phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool; phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates; -phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates; +phone.joinGroupCall#d61e1df3 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string key_fingerprint:flags.3?long params:DataJSON = Updates; phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates; phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector = Updates; phone.discardGroupCall#7a777135 call:InputGroupCall = Updates; @@ -2533,6 +2576,7 @@ phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates; phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels; phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl; phone.saveCallLog#41248786 peer:InputPhoneCall file:InputFile = Bool; +phone.createConferenceCall#dfc909ab peer:InputPhoneCall key_fingerprint:long = phone.PhoneCall; langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector; diff --git a/lib/tgchat/ext/td/td/generate/tl_json_converter.cpp b/lib/tgchat/ext/td/td/generate/tl_json_converter.cpp index bd5abc6d..7146b86b 100644 --- a/lib/tgchat/ext/td/td/generate/tl_json_converter.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_json_converter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -21,6 +21,11 @@ namespace td { using Mode = tl::TL_writer::Mode; +static bool need_bytes(const tl::simple::Type *type) { + return type->type == tl::simple::Type::Bytes || + (type->type == tl::simple::Type::Vector && need_bytes(type->vector_value_type)); +} + template void gen_to_json_constructor(StringBuilder &sb, const T *constructor, bool is_header) { sb << "void to_json(JsonValueScope &jv, " @@ -42,6 +47,8 @@ void gen_to_json_constructor(StringBuilder &sb, const T *constructor, bool is_he } if (arg.type->type == tl::simple::Type::Bytes) { object = PSTRING() << "base64_encode(" << object << ")"; + } else if (need_bytes(arg.type)) { + object = "UNSUPPORTED STORED VECTOR OF BYTES"; } else if (arg.type->type == tl::simple::Type::Bool) { object = PSTRING() << "JsonBool{" << object << "}"; } else if (arg.type->type == tl::simple::Type::Int64) { @@ -102,7 +109,7 @@ void gen_from_json_constructor(StringBuilder &sb, const T *constructor, bool is_ } else { sb << " {\n"; for (auto &arg : constructor->args) { - sb << " TRY_STATUS(from_json" << (arg.type->type == tl::simple::Type::Bytes ? "_bytes" : "") << "(to." + sb << " TRY_STATUS(from_json" << (need_bytes(arg.type) ? "_bytes" : "") << "(to." << tl::simple::gen_cpp_field_name(arg.name) << ", from.extract_field(\"" << tl::simple::gen_cpp_name(arg.name) << "\")));\n"; } diff --git a/lib/tgchat/ext/td/td/generate/tl_json_converter.h b/lib/tgchat/ext/td/td/generate/tl_json_converter.h index afde9528..3f9ec7df 100644 --- a/lib/tgchat/ext/td/td/generate/tl_json_converter.h +++ b/lib/tgchat/ext/td/td/generate/tl_json_converter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_c.h b/lib/tgchat/ext/td/td/generate/tl_writer_c.h index b78313e5..42efe6e3 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_c.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_c.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_cpp.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_cpp.cpp index 24da40e1..2ffb3711 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_cpp.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_cpp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_cpp.h b/lib/tgchat/ext/td/td/generate/tl_writer_cpp.h index 94a43814..91e443c8 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_cpp.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_cpp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_dotnet.h b/lib/tgchat/ext/td/td/generate/tl_writer_dotnet.h index 754ffb83..af95a9ea 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_dotnet.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_dotnet.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_h.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_h.cpp index 21cf1958..e7e33697 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_h.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_h.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_h.h b/lib/tgchat/ext/td/td/generate/tl_writer_h.h index 3055afa5..b0561745 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_h.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_h.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_hpp.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_hpp.cpp index 8881d519..24fc3151 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_hpp.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_hpp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_hpp.h b/lib/tgchat/ext/td/td/generate/tl_writer_hpp.h index 96561251..30d78d51 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_hpp.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_hpp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_java.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_java.cpp index 504c8894..c83184c9 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_java.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_java.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_java.h b/lib/tgchat/ext/td/td/generate/tl_writer_java.h index 3ae7e973..26b3fced 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_java.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_java.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.cpp index d7aaefaa..f8ed4bb7 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.h b/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.h index d168903c..a60a88a9 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_jni_cpp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.cpp index 40edd529..476a4ad1 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.h b/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.h index 969e8899..a501b53c 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_jni_h.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_td.cpp b/lib/tgchat/ext/td/td/generate/tl_writer_td.cpp index dd5455e5..81e9e19b 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_td.cpp +++ b/lib/tgchat/ext/td/td/generate/tl_writer_td.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/generate/tl_writer_td.h b/lib/tgchat/ext/td/td/generate/tl_writer_td.h index 05693f3f..6eab3086 100644 --- a/lib/tgchat/ext/td/td/generate/tl_writer_td.h +++ b/lib/tgchat/ext/td/td/generate/tl_writer_td.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/AuthData.cpp b/lib/tgchat/ext/td/td/mtproto/AuthData.cpp index e0063189..fad59fbe 100644 --- a/lib/tgchat/ext/td/td/mtproto/AuthData.cpp +++ b/lib/tgchat/ext/td/td/mtproto/AuthData.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/AuthData.h b/lib/tgchat/ext/td/td/mtproto/AuthData.h index 0361cada..d7458a6f 100644 --- a/lib/tgchat/ext/td/td/mtproto/AuthData.h +++ b/lib/tgchat/ext/td/td/mtproto/AuthData.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/AuthKey.h b/lib/tgchat/ext/td/td/mtproto/AuthKey.h index 7d20a724..291833cf 100644 --- a/lib/tgchat/ext/td/td/mtproto/AuthKey.h +++ b/lib/tgchat/ext/td/td/mtproto/AuthKey.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/ConnectionManager.cpp b/lib/tgchat/ext/td/td/mtproto/ConnectionManager.cpp index cf375dd4..20fb28a5 100644 --- a/lib/tgchat/ext/td/td/mtproto/ConnectionManager.cpp +++ b/lib/tgchat/ext/td/td/mtproto/ConnectionManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/ConnectionManager.h b/lib/tgchat/ext/td/td/mtproto/ConnectionManager.h index d8c073ac..09587111 100644 --- a/lib/tgchat/ext/td/td/mtproto/ConnectionManager.h +++ b/lib/tgchat/ext/td/td/mtproto/ConnectionManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/CryptoStorer.h b/lib/tgchat/ext/td/td/mtproto/CryptoStorer.h index fde16448..b094dccd 100644 --- a/lib/tgchat/ext/td/td/mtproto/CryptoStorer.h +++ b/lib/tgchat/ext/td/td/mtproto/CryptoStorer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/DhCallback.h b/lib/tgchat/ext/td/td/mtproto/DhCallback.h index 6e7821a7..6ed0dfb1 100644 --- a/lib/tgchat/ext/td/td/mtproto/DhCallback.h +++ b/lib/tgchat/ext/td/td/mtproto/DhCallback.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/DhHandshake.cpp b/lib/tgchat/ext/td/td/mtproto/DhHandshake.cpp index b2d224af..74c82d52 100644 --- a/lib/tgchat/ext/td/td/mtproto/DhHandshake.cpp +++ b/lib/tgchat/ext/td/td/mtproto/DhHandshake.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/DhHandshake.h b/lib/tgchat/ext/td/td/mtproto/DhHandshake.h index 408e92a4..02ab86cb 100644 --- a/lib/tgchat/ext/td/td/mtproto/DhHandshake.h +++ b/lib/tgchat/ext/td/td/mtproto/DhHandshake.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/Handshake.cpp b/lib/tgchat/ext/td/td/mtproto/Handshake.cpp index 1478e3c5..8872de10 100644 --- a/lib/tgchat/ext/td/td/mtproto/Handshake.cpp +++ b/lib/tgchat/ext/td/td/mtproto/Handshake.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/Handshake.h b/lib/tgchat/ext/td/td/mtproto/Handshake.h index 39df4b50..1b979543 100644 --- a/lib/tgchat/ext/td/td/mtproto/Handshake.h +++ b/lib/tgchat/ext/td/td/mtproto/Handshake.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/HandshakeActor.cpp b/lib/tgchat/ext/td/td/mtproto/HandshakeActor.cpp index 82035ea9..8645e003 100644 --- a/lib/tgchat/ext/td/td/mtproto/HandshakeActor.cpp +++ b/lib/tgchat/ext/td/td/mtproto/HandshakeActor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/HandshakeActor.h b/lib/tgchat/ext/td/td/mtproto/HandshakeActor.h index b6c2615f..c140e4ff 100644 --- a/lib/tgchat/ext/td/td/mtproto/HandshakeActor.h +++ b/lib/tgchat/ext/td/td/mtproto/HandshakeActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/HandshakeConnection.h b/lib/tgchat/ext/td/td/mtproto/HandshakeConnection.h index dea612d0..9d3cc3db 100644 --- a/lib/tgchat/ext/td/td/mtproto/HandshakeConnection.h +++ b/lib/tgchat/ext/td/td/mtproto/HandshakeConnection.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/HttpTransport.cpp b/lib/tgchat/ext/td/td/mtproto/HttpTransport.cpp index c697bcfd..802c6051 100644 --- a/lib/tgchat/ext/td/td/mtproto/HttpTransport.cpp +++ b/lib/tgchat/ext/td/td/mtproto/HttpTransport.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/HttpTransport.h b/lib/tgchat/ext/td/td/mtproto/HttpTransport.h index b5921fce..c153f43c 100644 --- a/lib/tgchat/ext/td/td/mtproto/HttpTransport.h +++ b/lib/tgchat/ext/td/td/mtproto/HttpTransport.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/IStreamTransport.cpp b/lib/tgchat/ext/td/td/mtproto/IStreamTransport.cpp index 0bac35d6..9dc9085c 100644 --- a/lib/tgchat/ext/td/td/mtproto/IStreamTransport.cpp +++ b/lib/tgchat/ext/td/td/mtproto/IStreamTransport.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/IStreamTransport.h b/lib/tgchat/ext/td/td/mtproto/IStreamTransport.h index 5bb355d6..06154f7d 100644 --- a/lib/tgchat/ext/td/td/mtproto/IStreamTransport.h +++ b/lib/tgchat/ext/td/td/mtproto/IStreamTransport.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/KDF.cpp b/lib/tgchat/ext/td/td/mtproto/KDF.cpp index 1c4728ca..56849a84 100644 --- a/lib/tgchat/ext/td/td/mtproto/KDF.cpp +++ b/lib/tgchat/ext/td/td/mtproto/KDF.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/KDF.h b/lib/tgchat/ext/td/td/mtproto/KDF.h index 7835a476..44ee4b71 100644 --- a/lib/tgchat/ext/td/td/mtproto/KDF.h +++ b/lib/tgchat/ext/td/td/mtproto/KDF.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/MessageId.h b/lib/tgchat/ext/td/td/mtproto/MessageId.h index 7abf974d..1f0cad09 100644 --- a/lib/tgchat/ext/td/td/mtproto/MessageId.h +++ b/lib/tgchat/ext/td/td/mtproto/MessageId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/MtprotoQuery.h b/lib/tgchat/ext/td/td/mtproto/MtprotoQuery.h index 65c2b710..229419a0 100644 --- a/lib/tgchat/ext/td/td/mtproto/MtprotoQuery.h +++ b/lib/tgchat/ext/td/td/mtproto/MtprotoQuery.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/NoCryptoStorer.h b/lib/tgchat/ext/td/td/mtproto/NoCryptoStorer.h index 18c1dd91..c2d51293 100644 --- a/lib/tgchat/ext/td/td/mtproto/NoCryptoStorer.h +++ b/lib/tgchat/ext/td/td/mtproto/NoCryptoStorer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/PacketInfo.h b/lib/tgchat/ext/td/td/mtproto/PacketInfo.h index 5af08b69..78788919 100644 --- a/lib/tgchat/ext/td/td/mtproto/PacketInfo.h +++ b/lib/tgchat/ext/td/td/mtproto/PacketInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/PacketStorer.h b/lib/tgchat/ext/td/td/mtproto/PacketStorer.h index 56b2b844..8e894add 100644 --- a/lib/tgchat/ext/td/td/mtproto/PacketStorer.h +++ b/lib/tgchat/ext/td/td/mtproto/PacketStorer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/Ping.cpp b/lib/tgchat/ext/td/td/mtproto/Ping.cpp index 93fc17b1..aa190714 100644 --- a/lib/tgchat/ext/td/td/mtproto/Ping.cpp +++ b/lib/tgchat/ext/td/td/mtproto/Ping.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/Ping.h b/lib/tgchat/ext/td/td/mtproto/Ping.h index 79befff5..b3469073 100644 --- a/lib/tgchat/ext/td/td/mtproto/Ping.h +++ b/lib/tgchat/ext/td/td/mtproto/Ping.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/PingConnection.cpp b/lib/tgchat/ext/td/td/mtproto/PingConnection.cpp index 64a26150..28bca3c3 100644 --- a/lib/tgchat/ext/td/td/mtproto/PingConnection.cpp +++ b/lib/tgchat/ext/td/td/mtproto/PingConnection.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/PingConnection.h b/lib/tgchat/ext/td/td/mtproto/PingConnection.h index ce2b3910..9520aaaf 100644 --- a/lib/tgchat/ext/td/td/mtproto/PingConnection.h +++ b/lib/tgchat/ext/td/td/mtproto/PingConnection.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/ProxySecret.cpp b/lib/tgchat/ext/td/td/mtproto/ProxySecret.cpp index 15aea75f..63279da0 100644 --- a/lib/tgchat/ext/td/td/mtproto/ProxySecret.cpp +++ b/lib/tgchat/ext/td/td/mtproto/ProxySecret.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/ProxySecret.h b/lib/tgchat/ext/td/td/mtproto/ProxySecret.h index bdbd33e8..cce108bc 100644 --- a/lib/tgchat/ext/td/td/mtproto/ProxySecret.h +++ b/lib/tgchat/ext/td/td/mtproto/ProxySecret.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/RSA.cpp b/lib/tgchat/ext/td/td/mtproto/RSA.cpp index c5e54e2d..db82e66f 100644 --- a/lib/tgchat/ext/td/td/mtproto/RSA.cpp +++ b/lib/tgchat/ext/td/td/mtproto/RSA.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/RSA.h b/lib/tgchat/ext/td/td/mtproto/RSA.h index 553856b7..6d08cf7a 100644 --- a/lib/tgchat/ext/td/td/mtproto/RSA.h +++ b/lib/tgchat/ext/td/td/mtproto/RSA.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/RawConnection.cpp b/lib/tgchat/ext/td/td/mtproto/RawConnection.cpp index 3e6da818..6a92ee88 100644 --- a/lib/tgchat/ext/td/td/mtproto/RawConnection.cpp +++ b/lib/tgchat/ext/td/td/mtproto/RawConnection.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/RawConnection.h b/lib/tgchat/ext/td/td/mtproto/RawConnection.h index aee15977..250f52d1 100644 --- a/lib/tgchat/ext/td/td/mtproto/RawConnection.h +++ b/lib/tgchat/ext/td/td/mtproto/RawConnection.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/SessionConnection.cpp b/lib/tgchat/ext/td/td/mtproto/SessionConnection.cpp index 05b1556a..898713bb 100644 --- a/lib/tgchat/ext/td/td/mtproto/SessionConnection.cpp +++ b/lib/tgchat/ext/td/td/mtproto/SessionConnection.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -117,7 +117,7 @@ namespace mtproto { * BadMsgNotification; * * error codes: - * 16: msg_id is too low. -- lite resend. It will be automatially packed in a container. I hope. + * 16: msg_id is too low. -- lite resend. It will be automatically packed in a container. I hope. * 17: msg_id is too high. -- fail connection. * 18: msg_id % 4 != 0. -- Error and fail connection. * 19: container msg_id is the same as msg_id of a previously received message. MUST NEVER HAPPENS. Error and fail diff --git a/lib/tgchat/ext/td/td/mtproto/SessionConnection.h b/lib/tgchat/ext/td/td/mtproto/SessionConnection.h index 70749e54..41240235 100644 --- a/lib/tgchat/ext/td/td/mtproto/SessionConnection.h +++ b/lib/tgchat/ext/td/td/mtproto/SessionConnection.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TcpTransport.cpp b/lib/tgchat/ext/td/td/mtproto/TcpTransport.cpp index 2d1b6515..72dc280b 100644 --- a/lib/tgchat/ext/td/td/mtproto/TcpTransport.cpp +++ b/lib/tgchat/ext/td/td/mtproto/TcpTransport.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TcpTransport.h b/lib/tgchat/ext/td/td/mtproto/TcpTransport.h index b8a4c862..00efd5cc 100644 --- a/lib/tgchat/ext/td/td/mtproto/TcpTransport.h +++ b/lib/tgchat/ext/td/td/mtproto/TcpTransport.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp b/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp index 775effb3..38fdf072 100644 --- a/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp +++ b/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TlsInit.h b/lib/tgchat/ext/td/td/mtproto/TlsInit.h index 1a51dd88..519ee11a 100644 --- a/lib/tgchat/ext/td/td/mtproto/TlsInit.h +++ b/lib/tgchat/ext/td/td/mtproto/TlsInit.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.cpp b/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.cpp index 35ea2f09..dbf45d63 100644 --- a/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.cpp +++ b/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.h b/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.h index 0c8151d5..ea6468d2 100644 --- a/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.h +++ b/lib/tgchat/ext/td/td/mtproto/TlsReaderByteFlow.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/Transport.cpp b/lib/tgchat/ext/td/td/mtproto/Transport.cpp index 1a98182d..ecfe1fff 100644 --- a/lib/tgchat/ext/td/td/mtproto/Transport.cpp +++ b/lib/tgchat/ext/td/td/mtproto/Transport.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/Transport.h b/lib/tgchat/ext/td/td/mtproto/Transport.h index 6a00f6a2..4cd04cf0 100644 --- a/lib/tgchat/ext/td/td/mtproto/Transport.h +++ b/lib/tgchat/ext/td/td/mtproto/Transport.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/TransportType.h b/lib/tgchat/ext/td/td/mtproto/TransportType.h index 16379148..51ede8e7 100644 --- a/lib/tgchat/ext/td/td/mtproto/TransportType.h +++ b/lib/tgchat/ext/td/td/mtproto/TransportType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/utils.cpp b/lib/tgchat/ext/td/td/mtproto/utils.cpp index d0233f7e..4c9d3ecc 100644 --- a/lib/tgchat/ext/td/td/mtproto/utils.cpp +++ b/lib/tgchat/ext/td/td/mtproto/utils.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/mtproto/utils.h b/lib/tgchat/ext/td/td/mtproto/utils.h index ab4a8064..5519887b 100644 --- a/lib/tgchat/ext/td/td/mtproto/utils.h +++ b/lib/tgchat/ext/td/td/mtproto/utils.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AccentColorId.h b/lib/tgchat/ext/td/td/telegram/AccentColorId.h index e7840c7f..deba6222 100644 --- a/lib/tgchat/ext/td/td/telegram/AccentColorId.h +++ b/lib/tgchat/ext/td/td/telegram/AccentColorId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AccessRights.h b/lib/tgchat/ext/td/td/telegram/AccessRights.h index baf589e0..b02e4c62 100644 --- a/lib/tgchat/ext/td/td/telegram/AccessRights.h +++ b/lib/tgchat/ext/td/td/telegram/AccessRights.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AccountManager.cpp b/lib/tgchat/ext/td/td/telegram/AccountManager.cpp index f261d504..b27e629f 100644 --- a/lib/tgchat/ext/td/td/telegram/AccountManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AccountManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AccountManager.h b/lib/tgchat/ext/td/td/telegram/AccountManager.h index be0e0f1a..7f8e25a4 100644 --- a/lib/tgchat/ext/td/td/telegram/AccountManager.h +++ b/lib/tgchat/ext/td/td/telegram/AccountManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AffectedHistory.h b/lib/tgchat/ext/td/td/telegram/AffectedHistory.h index 4b76579d..f303ede8 100644 --- a/lib/tgchat/ext/td/td/telegram/AffectedHistory.h +++ b/lib/tgchat/ext/td/td/telegram/AffectedHistory.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AffiliateType.cpp b/lib/tgchat/ext/td/td/telegram/AffiliateType.cpp new file mode 100644 index 00000000..61f390f9 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/AffiliateType.cpp @@ -0,0 +1,76 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/AffiliateType.h" + +#include "td/telegram/AccessRights.h" +#include "td/telegram/ChatManager.h" +#include "td/telegram/DialogManager.h" +#include "td/telegram/Td.h" +#include "td/telegram/UserId.h" +#include "td/telegram/UserManager.h" + +namespace td { + +Result AffiliateType::get_affiliate_type(Td *td, const td_api::object_ptr &type) { + if (type == nullptr) { + return Status::Error(400, "Affiliate type must be non-empty"); + } + switch (type->get_id()) { + case td_api::affiliateTypeCurrentUser::ID: + return AffiliateType(td->dialog_manager_->get_my_dialog_id()); + case td_api::affiliateTypeBot::ID: { + UserId user_id(static_cast(type.get())->user_id_); + TRY_RESULT(bot_data, td->user_manager_->get_bot_data(user_id)); + if (!bot_data.can_be_edited) { + return Status::Error(400, "The bot isn't owned"); + } + return AffiliateType(DialogId(user_id)); + } + case td_api::affiliateTypeChannel::ID: { + DialogId dialog_id(static_cast(type.get())->chat_id_); + TRY_STATUS(td->dialog_manager_->check_dialog_access(dialog_id, false, AccessRights::Read, "get_affiliate_type")); + if (!td->dialog_manager_->is_broadcast_channel(dialog_id)) { + return Status::Error(400, "The chat must be a channel chat"); + } + auto channel_id = dialog_id.get_channel_id(); + auto status = td->chat_manager_->get_channel_permissions(channel_id); + if (!status.can_post_messages()) { + return Status::Error(400, "Not enough rights in the chat"); + } + return AffiliateType(dialog_id); + } + default: + UNREACHABLE(); + return Status::Error(500, "Unreachable"); + } +} + +telegram_api::object_ptr AffiliateType::get_input_peer(Td *td) const { + return td->dialog_manager_->get_input_peer(dialog_id_, AccessRights::Read); +} + +td_api::object_ptr AffiliateType::get_affiliate_type_object(Td *td) const { + switch (dialog_id_.get_type()) { + case DialogType::User: + if (td->dialog_manager_->get_my_dialog_id() == dialog_id_) { + return td_api::make_object(); + } + return td_api::make_object( + td->user_manager_->get_user_id_object(dialog_id_.get_user_id(), "affiliateTypeBot")); + case DialogType::Channel: + return td_api::make_object( + td->dialog_manager_->get_chat_id_object(dialog_id_, "affiliateTypeChannel")); + default: + UNREACHABLE(); + } +} + +StringBuilder &operator<<(StringBuilder &string_builder, const AffiliateType &affiliate_type) { + return string_builder << "affiliate " << affiliate_type.get_dialog_id(); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/AffiliateType.h b/lib/tgchat/ext/td/td/telegram/AffiliateType.h new file mode 100644 index 00000000..fd4e1f68 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/AffiliateType.h @@ -0,0 +1,43 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/DialogId.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" + +#include "td/utils/common.h" +#include "td/utils/Status.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class Td; + +class AffiliateType { + DialogId dialog_id_; + + explicit AffiliateType(DialogId dialog_id) : dialog_id_(dialog_id) { + } + + public: + AffiliateType() = default; + + static Result get_affiliate_type(Td *td, const td_api::object_ptr &type); + + DialogId get_dialog_id() const { + return dialog_id_; + } + + telegram_api::object_ptr get_input_peer(Td *td) const; + + td_api::object_ptr get_affiliate_type_object(Td *td) const; +}; + +StringBuilder &operator<<(StringBuilder &string_builder, const AffiliateType &affiliate_type); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/AlarmManager.cpp b/lib/tgchat/ext/td/td/telegram/AlarmManager.cpp index df50fe12..ab59f4fb 100644 --- a/lib/tgchat/ext/td/td/telegram/AlarmManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AlarmManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AlarmManager.h b/lib/tgchat/ext/td/td/telegram/AlarmManager.h index 22908886..7fa9b379 100644 --- a/lib/tgchat/ext/td/td/telegram/AlarmManager.h +++ b/lib/tgchat/ext/td/td/telegram/AlarmManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp b/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp index a065cb2f..b375baa4 100644 --- a/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -592,8 +592,8 @@ void AnimationsManager::on_get_saved_animations( continue; } CHECK(document_constructor_id == telegram_api::document::ID); - auto document = - td_->documents_manager_->on_get_document(move_tl_object_as(document_ptr), DialogId()); + auto document = td_->documents_manager_->on_get_document(move_tl_object_as(document_ptr), + DialogId(), false); if (document.type != Document::Type::Animation) { LOG(ERROR) << "Receive " << document << " instead of animation as saved animation"; continue; diff --git a/lib/tgchat/ext/td/td/telegram/AnimationsManager.h b/lib/tgchat/ext/td/td/telegram/AnimationsManager.h index 852e2921..62847a0c 100644 --- a/lib/tgchat/ext/td/td/telegram/AnimationsManager.h +++ b/lib/tgchat/ext/td/td/telegram/AnimationsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AnimationsManager.hpp b/lib/tgchat/ext/td/td/telegram/AnimationsManager.hpp index 2a5c3a0c..82290c3b 100644 --- a/lib/tgchat/ext/td/td/telegram/AnimationsManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/AnimationsManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Application.cpp b/lib/tgchat/ext/td/td/telegram/Application.cpp index c1f8f960..c6368927 100644 --- a/lib/tgchat/ext/td/td/telegram/Application.cpp +++ b/lib/tgchat/ext/td/td/telegram/Application.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Application.h b/lib/tgchat/ext/td/td/telegram/Application.h index 42c96348..fcc496a3 100644 --- a/lib/tgchat/ext/td/td/telegram/Application.h +++ b/lib/tgchat/ext/td/td/telegram/Application.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp b/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp index 5347ce8f..3247e1d7 100644 --- a/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -474,8 +474,8 @@ Result AttachMenuManager::get_attach_menu_bot( } auto expected_document_type = ends_with(name, "_static") ? Document::Type::General : Document::Type::Sticker; - auto parsed_document = - td_->documents_manager_->on_get_document(move_tl_object_as(icon->icon_), DialogId()); + auto parsed_document = td_->documents_manager_->on_get_document( + move_tl_object_as(icon->icon_), DialogId(), false); if (parsed_document.type != expected_document_type) { LOG(ERROR) << "Receive wrong attachment menu bot icon \"" << name << "\" for " << user_id; continue; diff --git a/lib/tgchat/ext/td/td/telegram/AttachMenuManager.h b/lib/tgchat/ext/td/td/telegram/AttachMenuManager.h index aa258195..1ae9ee66 100644 --- a/lib/tgchat/ext/td/td/telegram/AttachMenuManager.h +++ b/lib/tgchat/ext/td/td/telegram/AttachMenuManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp b/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp index 3e57124b..781c9aa9 100644 --- a/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AudiosManager.h b/lib/tgchat/ext/td/td/telegram/AudiosManager.h index 90ef79b0..cf830899 100644 --- a/lib/tgchat/ext/td/td/telegram/AudiosManager.h +++ b/lib/tgchat/ext/td/td/telegram/AudiosManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AudiosManager.hpp b/lib/tgchat/ext/td/td/telegram/AudiosManager.hpp index 77a6cf8a..c86e8795 100644 --- a/lib/tgchat/ext/td/td/telegram/AudiosManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/AudiosManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AuthManager.cpp b/lib/tgchat/ext/td/td/telegram/AuthManager.cpp index 385a20d8..92874cc2 100644 --- a/lib/tgchat/ext/td/td/telegram/AuthManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AuthManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AuthManager.h b/lib/tgchat/ext/td/td/telegram/AuthManager.h index 4c2ff21e..8113c8c7 100644 --- a/lib/tgchat/ext/td/td/telegram/AuthManager.h +++ b/lib/tgchat/ext/td/td/telegram/AuthManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -129,7 +129,7 @@ class AuthManager final : public NetActor { ActorShared<> parent_; // STATE - // from contructor + // from constructor int32 api_id_; string api_hash_; diff --git a/lib/tgchat/ext/td/td/telegram/AuthManager.hpp b/lib/tgchat/ext/td/td/telegram/AuthManager.hpp index 376510df..a6cb2542 100644 --- a/lib/tgchat/ext/td/td/telegram/AuthManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/AuthManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.cpp b/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.cpp index c7b06496..bb96e469 100644 --- a/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.cpp +++ b/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.h b/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.h index 6a6956aa..2c1576e6 100644 --- a/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.h +++ b/lib/tgchat/ext/td/td/telegram/AutoDownloadSettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AutosaveManager.cpp b/lib/tgchat/ext/td/td/telegram/AutosaveManager.cpp index 432d94cb..6c344cdf 100644 --- a/lib/tgchat/ext/td/td/telegram/AutosaveManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/AutosaveManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/AutosaveManager.h b/lib/tgchat/ext/td/td/telegram/AutosaveManager.h index cc03b087..aa592f4d 100644 --- a/lib/tgchat/ext/td/td/telegram/AutosaveManager.h +++ b/lib/tgchat/ext/td/td/telegram/AutosaveManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundId.h b/lib/tgchat/ext/td/td/telegram/BackgroundId.h index 9f8a791f..8c2c67db 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundId.h +++ b/lib/tgchat/ext/td/td/telegram/BackgroundId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundInfo.cpp b/lib/tgchat/ext/td/td/telegram/BackgroundInfo.cpp index 747c485b..dc7c3615 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/BackgroundInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundInfo.h b/lib/tgchat/ext/td/td/telegram/BackgroundInfo.h index b84f2e32..8046f020 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundInfo.h +++ b/lib/tgchat/ext/td/td/telegram/BackgroundInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundInfo.hpp b/lib/tgchat/ext/td/td/telegram/BackgroundInfo.hpp index 9a8fdd6c..4aa2ede4 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/BackgroundInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundManager.cpp b/lib/tgchat/ext/td/td/telegram/BackgroundManager.cpp index 6a8bed25..6d9e3ecd 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/BackgroundManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1336,7 +1336,7 @@ std::pair BackgroundManager::on_get_background( bool is_pattern = wallpaper->pattern_; Document document = td_->documents_manager_->on_get_document( - telegram_api::move_object_as(wallpaper->document_), DialogId(), nullptr, + telegram_api::move_object_as(wallpaper->document_), DialogId(), false, nullptr, Document::Type::General, is_pattern ? DocumentsManager::Subtype::Pattern : DocumentsManager::Subtype::Background); if (!document.file_id.is_valid()) { LOG(ERROR) << "Receive wrong document in " << to_string(wallpaper); diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundManager.h b/lib/tgchat/ext/td/td/telegram/BackgroundManager.h index 9fa68364..9f36d01f 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundManager.h +++ b/lib/tgchat/ext/td/td/telegram/BackgroundManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundType.cpp b/lib/tgchat/ext/td/td/telegram/BackgroundType.cpp index 4fecd853..20d470e7 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundType.cpp +++ b/lib/tgchat/ext/td/td/telegram/BackgroundType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundType.h b/lib/tgchat/ext/td/td/telegram/BackgroundType.h index 2e6ab0a0..576744ab 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundType.h +++ b/lib/tgchat/ext/td/td/telegram/BackgroundType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BackgroundType.hpp b/lib/tgchat/ext/td/td/telegram/BackgroundType.hpp index cffbc057..4c8f7878 100644 --- a/lib/tgchat/ext/td/td/telegram/BackgroundType.hpp +++ b/lib/tgchat/ext/td/td/telegram/BackgroundType.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BaseTheme.cpp b/lib/tgchat/ext/td/td/telegram/BaseTheme.cpp index ee4844f9..8f7603b7 100644 --- a/lib/tgchat/ext/td/td/telegram/BaseTheme.cpp +++ b/lib/tgchat/ext/td/td/telegram/BaseTheme.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BaseTheme.h b/lib/tgchat/ext/td/td/telegram/BaseTheme.h index 3063d98d..3ce35b56 100644 --- a/lib/tgchat/ext/td/td/telegram/BaseTheme.h +++ b/lib/tgchat/ext/td/td/telegram/BaseTheme.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Birthdate.cpp b/lib/tgchat/ext/td/td/telegram/Birthdate.cpp index 18c5dd12..4e0cc491 100644 --- a/lib/tgchat/ext/td/td/telegram/Birthdate.cpp +++ b/lib/tgchat/ext/td/td/telegram/Birthdate.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Birthdate.h b/lib/tgchat/ext/td/td/telegram/Birthdate.h index da48b1ac..5b05050c 100644 --- a/lib/tgchat/ext/td/td/telegram/Birthdate.h +++ b/lib/tgchat/ext/td/td/telegram/Birthdate.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Birthdate.hpp b/lib/tgchat/ext/td/td/telegram/Birthdate.hpp index b797a7ed..50904a88 100644 --- a/lib/tgchat/ext/td/td/telegram/Birthdate.hpp +++ b/lib/tgchat/ext/td/td/telegram/Birthdate.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BlockListId.h b/lib/tgchat/ext/td/td/telegram/BlockListId.h index 4230b0dc..7c1d94ea 100644 --- a/lib/tgchat/ext/td/td/telegram/BlockListId.h +++ b/lib/tgchat/ext/td/td/telegram/BlockListId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BoostManager.cpp b/lib/tgchat/ext/td/td/telegram/BoostManager.cpp index bd1d047f..de534213 100644 --- a/lib/tgchat/ext/td/td/telegram/BoostManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/BoostManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BoostManager.h b/lib/tgchat/ext/td/td/telegram/BoostManager.h index 99854892..1ef8d316 100644 --- a/lib/tgchat/ext/td/td/telegram/BoostManager.h +++ b/lib/tgchat/ext/td/td/telegram/BoostManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotCommand.cpp b/lib/tgchat/ext/td/td/telegram/BotCommand.cpp index 3fe6bf06..9f215acc 100644 --- a/lib/tgchat/ext/td/td/telegram/BotCommand.cpp +++ b/lib/tgchat/ext/td/td/telegram/BotCommand.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotCommand.h b/lib/tgchat/ext/td/td/telegram/BotCommand.h index 61a80d8a..0c5d85b1 100644 --- a/lib/tgchat/ext/td/td/telegram/BotCommand.h +++ b/lib/tgchat/ext/td/td/telegram/BotCommand.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotCommandScope.cpp b/lib/tgchat/ext/td/td/telegram/BotCommandScope.cpp index 6b712835..cb03c820 100644 --- a/lib/tgchat/ext/td/td/telegram/BotCommandScope.cpp +++ b/lib/tgchat/ext/td/td/telegram/BotCommandScope.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotCommandScope.h b/lib/tgchat/ext/td/td/telegram/BotCommandScope.h index 9a861dc9..6b6db9c1 100644 --- a/lib/tgchat/ext/td/td/telegram/BotCommandScope.h +++ b/lib/tgchat/ext/td/td/telegram/BotCommandScope.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotInfoManager.cpp b/lib/tgchat/ext/td/td/telegram/BotInfoManager.cpp index 98b690fd..da705036 100644 --- a/lib/tgchat/ext/td/td/telegram/BotInfoManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/BotInfoManager.cpp @@ -1,13 +1,15 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/BotInfoManager.h" +#include "td/telegram/AccessRights.h" #include "td/telegram/AuthManager.h" #include "td/telegram/DialogId.h" +#include "td/telegram/DialogManager.h" #include "td/telegram/FileReferenceManager.h" #include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileType.h" @@ -30,6 +32,42 @@ namespace td { +class GetAdminedBotsQuery final : public Td::ResultHandler { + Promise> promise_; + UserId bot_user_id_; + + public: + explicit GetAdminedBotsQuery(Promise> &&promise) : promise_(std::move(promise)) { + } + + void send() { + send_query(G()->net_query_creator().create(telegram_api::bots_getAdminedBots())); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto users = result_ptr.move_as_ok(); + vector user_ids; + for (const auto &user : users) { + auto user_id = UserManager::get_user_id(user); + if (user_id.is_valid()) { + user_ids.push_back(user_id); + } + } + td_->user_manager_->on_get_users(std::move(users), "GetAdminedBotsQuery"); + promise_.set_value(td_api::make_object( + static_cast(user_ids.size()), td_->user_manager_->get_user_ids_object(user_ids, "GetAdminedBotsQuery"))); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + class SetBotGroupDefaultAdminRightsQuery final : public Td::ResultHandler { Promise promise_; @@ -550,6 +588,51 @@ class GetBotInfoQuery final : public Td::ResultHandler { } }; +class SetCustomVerificationQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + + public: + explicit SetCustomVerificationQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(telegram_api::object_ptr input_user, DialogId dialog_id, bool is_verified, + const string &custom_description) { + dialog_id_ = dialog_id; + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); + CHECK(input_peer != nullptr); + + int32 flags = 0; + if (input_user != nullptr) { + flags |= telegram_api::bots_setCustomVerification::BOT_MASK; + } + if (is_verified) { + flags |= telegram_api::bots_setCustomVerification::ENABLED_MASK; + } + if (!custom_description.empty()) { + flags |= telegram_api::bots_setCustomVerification::CUSTOM_DESCRIPTION_MASK; + } + send_query(G()->net_query_creator().create( + telegram_api::bots_setCustomVerification(flags, false /*ignored*/, std::move(input_user), std::move(input_peer), + custom_description), + {{dialog_id}})); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "SetCustomVerificationQuery"); + promise_.set_error(std::move(status)); + } +}; + class BotInfoManager::UploadMediaCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileUploadId file_upload_id, telegram_api::object_ptr input_file) final { @@ -645,6 +728,10 @@ void BotInfoManager::timeout_expired() { } } +void BotInfoManager::get_owned_bots(Promise> &&promise) { + td_->create_handler(std::move(promise))->send(); +} + void BotInfoManager::set_default_group_administrator_rights(AdministratorRights administrator_rights, Promise &&promise) { td_->user_manager_->invalidate_user_full(td_->user_manager_->get_my_id()); @@ -984,4 +1071,16 @@ void BotInfoManager::get_bot_info_about(UserId bot_user_id, const string &langua add_pending_get_query(bot_user_id, language_code, 2, std::move(promise)); } +void BotInfoManager::set_custom_bot_verification(UserId bot_user_id, DialogId dialog_id, bool is_verified, + const string &custom_description, Promise &&promise) { + telegram_api::object_ptr bot_input_user; + if (bot_user_id != UserId()) { + TRY_RESULT_PROMISE_ASSIGN(promise, bot_input_user, td_->user_manager_->get_input_user(bot_user_id)); + } + TRY_STATUS_PROMISE(promise, td_->dialog_manager_->check_dialog_access(dialog_id, false, AccessRights::Read, + "set_custom_bot_verification")); + td_->create_handler(std::move(promise)) + ->send(std::move(bot_input_user), dialog_id, is_verified, custom_description); +} + } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BotInfoManager.h b/lib/tgchat/ext/td/td/telegram/BotInfoManager.h index 481362c8..7b9a6d61 100644 --- a/lib/tgchat/ext/td/td/telegram/BotInfoManager.h +++ b/lib/tgchat/ext/td/td/telegram/BotInfoManager.h @@ -1,11 +1,12 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once +#include "td/telegram/DialogId.h" #include "td/telegram/DialogParticipant.h" #include "td/telegram/files/FileId.h" #include "td/telegram/files/FileSourceId.h" @@ -39,6 +40,8 @@ class BotInfoManager final : public Actor { BotInfoManager &operator=(BotInfoManager &&) = delete; ~BotInfoManager() final; + void get_owned_bots(Promise> &&promise); + void set_default_group_administrator_rights(AdministratorRights administrator_rights, Promise &&promise); void set_default_channel_administrator_rights(AdministratorRights administrator_rights, Promise &&promise); @@ -88,6 +91,9 @@ class BotInfoManager final : public Actor { void get_bot_info_about(UserId bot_user_id, const string &language_code, Promise &&promise); + void set_custom_bot_verification(UserId bot_user_id, DialogId dialog_id, bool is_verified, + const string &custom_description, Promise &&promise); + private: static constexpr double MAX_QUERY_DELAY = 0.01; diff --git a/lib/tgchat/ext/td/td/telegram/BotMenuButton.cpp b/lib/tgchat/ext/td/td/telegram/BotMenuButton.cpp index 0f330deb..af77eb20 100644 --- a/lib/tgchat/ext/td/td/telegram/BotMenuButton.cpp +++ b/lib/tgchat/ext/td/td/telegram/BotMenuButton.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotMenuButton.h b/lib/tgchat/ext/td/td/telegram/BotMenuButton.h index f1c5e73f..2052072b 100644 --- a/lib/tgchat/ext/td/td/telegram/BotMenuButton.h +++ b/lib/tgchat/ext/td/td/telegram/BotMenuButton.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotQueries.cpp b/lib/tgchat/ext/td/td/telegram/BotQueries.cpp index aa87839c..b4047e95 100644 --- a/lib/tgchat/ext/td/td/telegram/BotQueries.cpp +++ b/lib/tgchat/ext/td/td/telegram/BotQueries.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotQueries.h b/lib/tgchat/ext/td/td/telegram/BotQueries.h index 5364520b..e5224f0a 100644 --- a/lib/tgchat/ext/td/td/telegram/BotQueries.h +++ b/lib/tgchat/ext/td/td/telegram/BotQueries.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BotVerification.cpp b/lib/tgchat/ext/td/td/telegram/BotVerification.cpp new file mode 100644 index 00000000..b1fa31e3 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/BotVerification.cpp @@ -0,0 +1,75 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/BotVerification.h" + +#include "td/telegram/Dependencies.h" +#include "td/telegram/MessageEntity.h" +#include "td/telegram/Td.h" +#include "td/telegram/UserManager.h" + +#include "td/utils/logging.h" + +namespace td { + +BotVerification::BotVerification(telegram_api::object_ptr &&bot_verification) { + if (bot_verification == nullptr) { + return; + } + bot_user_id_ = UserId(bot_verification->bot_id_); + icon_ = CustomEmojiId(bot_verification->icon_); + description_ = std::move(bot_verification->description_); +} + +unique_ptr BotVerification::get_bot_verification( + telegram_api::object_ptr &&bot_verification) { + if (bot_verification == nullptr) { + return nullptr; + } + auto result = td::make_unique(std::move(bot_verification)); + if (!result->is_valid()) { + LOG(ERROR) << "Receive invalid " << *result; + return nullptr; + } + return result; +} + +td_api::object_ptr BotVerification::get_bot_verification_object(Td *td) const { + if (!is_valid()) { + return nullptr; + } + FormattedText text; + text.text = description_; + text.entities = find_entities(text.text, true, true); + return td_api::make_object( + td->user_manager_->get_user_id_object(bot_user_id_, "botVerification"), icon_.get(), + get_formatted_text_object(td->user_manager_.get(), text, true, -1)); +} + +void BotVerification::add_dependencies(Dependencies &dependencies) const { + dependencies.add(bot_user_id_); +} + +bool operator==(const BotVerification &lhs, const BotVerification &rhs) { + return lhs.bot_user_id_ == rhs.bot_user_id_ && lhs.icon_ == rhs.icon_ && lhs.description_ == rhs.description_; +} + +bool operator==(const unique_ptr &lhs, const unique_ptr &rhs) { + if (lhs == nullptr) { + return rhs == nullptr; + } + if (rhs == nullptr) { + return false; + } + return *lhs == *rhs; +} + +StringBuilder &operator<<(StringBuilder &string_builder, const BotVerification &bot_verification) { + return string_builder << "verified by " << bot_verification.bot_user_id_ << " with " << bot_verification.icon_ + << " and " << bot_verification.description_; +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BotVerification.h b/lib/tgchat/ext/td/td/telegram/BotVerification.h new file mode 100644 index 00000000..f19e0f3f --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/BotVerification.h @@ -0,0 +1,65 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/CustomEmojiId.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" +#include "td/telegram/UserId.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class Dependencies; +class Td; + +class BotVerification { + public: + BotVerification() = default; + + explicit BotVerification(telegram_api::object_ptr &&bot_verification); + + static unique_ptr get_bot_verification( + telegram_api::object_ptr &&bot_verification); + + td_api::object_ptr get_bot_verification_object(Td *td) const; + + bool is_valid() const { + return bot_user_id_.is_valid() && icon_.is_valid(); + } + + void add_dependencies(Dependencies &dependencies) const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); + + private: + UserId bot_user_id_; + CustomEmojiId icon_; + string description_; + + friend bool operator==(const BotVerification &lhs, const BotVerification &rhs); + + friend StringBuilder &operator<<(StringBuilder &string_builder, const BotVerification &bot_verification); +}; + +bool operator==(const BotVerification &lhs, const BotVerification &rhs); + +bool operator==(const unique_ptr &lhs, const unique_ptr &rhs); + +inline bool operator!=(const unique_ptr &lhs, const unique_ptr &rhs) { + return !(lhs == rhs); +} + +StringBuilder &operator<<(StringBuilder &string_builder, const BotVerification &bot_verification); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BotVerification.hpp b/lib/tgchat/ext/td/td/telegram/BotVerification.hpp new file mode 100644 index 00000000..c96e93b4 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/BotVerification.hpp @@ -0,0 +1,33 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/BotVerification.h" + +#include "td/utils/tl_helpers.h" + +namespace td { + +template +void BotVerification::store(StorerT &storer) const { + BEGIN_STORE_FLAGS(); + END_STORE_FLAGS(); + td::store(bot_user_id_, storer); + td::store(icon_, storer); + td::store(description_, storer); +} + +template +void BotVerification::parse(ParserT &parser) { + BEGIN_PARSE_FLAGS(); + END_PARSE_FLAGS(); + td::parse(bot_user_id_, parser); + td::parse(icon_, parser); + td::parse(description_, parser); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.cpp b/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.cpp new file mode 100644 index 00000000..b17279b3 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.cpp @@ -0,0 +1,76 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/BotVerifierSettings.h" + +#include "td/telegram/MessageEntity.h" +#include "td/telegram/Td.h" + +#include "td/utils/logging.h" + +namespace td { + +BotVerifierSettings::BotVerifierSettings( + telegram_api::object_ptr &&bot_verifier_settings) { + if (bot_verifier_settings == nullptr) { + return; + } + icon_ = CustomEmojiId(bot_verifier_settings->icon_); + company_ = std::move(bot_verifier_settings->company_); + description_ = std::move(bot_verifier_settings->custom_description_); + can_modify_custom_description_ = bot_verifier_settings->can_modify_custom_description_; +} + +unique_ptr BotVerifierSettings::get_bot_verifier_settings( + telegram_api::object_ptr &&bot_verifier_settings) { + if (bot_verifier_settings == nullptr) { + return nullptr; + } + auto result = td::make_unique(std::move(bot_verifier_settings)); + if (!result->is_valid()) { + LOG(ERROR) << "Receive invalid " << *result; + return nullptr; + } + return result; +} + +td_api::object_ptr BotVerifierSettings::get_bot_verification_parameters_object( + Td *td) const { + if (!is_valid()) { + return nullptr; + } + td_api::object_ptr description; + if (!description_.empty() || can_modify_custom_description_) { + FormattedText text; + text.text = description_; + text.entities = find_entities(text.text, true, true); + description = get_formatted_text_object(td->user_manager_.get(), text, true, -1); + } + return td_api::make_object(icon_.get(), company_, std::move(description), + can_modify_custom_description_); +} + +bool operator==(const BotVerifierSettings &lhs, const BotVerifierSettings &rhs) { + return lhs.icon_ == rhs.icon_ && lhs.company_ == rhs.company_ && lhs.description_ == rhs.description_ && + lhs.can_modify_custom_description_ == rhs.can_modify_custom_description_; +} + +bool operator==(const unique_ptr &lhs, const unique_ptr &rhs) { + if (lhs == nullptr) { + return rhs == nullptr; + } + if (rhs == nullptr) { + return false; + } + return *lhs == *rhs; +} + +StringBuilder &operator<<(StringBuilder &string_builder, const BotVerifierSettings &bot_verifier_settings) { + return string_builder << "VerificationSettings[" << bot_verifier_settings.icon_ << " by " + << bot_verifier_settings.company_ << ']'; +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.h b/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.h new file mode 100644 index 00000000..9f26ccc0 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.h @@ -0,0 +1,62 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/CustomEmojiId.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class Td; + +class BotVerifierSettings { + public: + BotVerifierSettings() = default; + + explicit BotVerifierSettings(telegram_api::object_ptr &&bot_verifier_settings); + + static unique_ptr get_bot_verifier_settings( + telegram_api::object_ptr &&bot_verifier_settings); + + td_api::object_ptr get_bot_verification_parameters_object(Td *td) const; + + bool is_valid() const { + return icon_.is_valid(); + } + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); + + private: + CustomEmojiId icon_; + string company_; + string description_; + bool can_modify_custom_description_ = false; + + friend bool operator==(const BotVerifierSettings &lhs, const BotVerifierSettings &rhs); + + friend StringBuilder &operator<<(StringBuilder &string_builder, const BotVerifierSettings &bot_verifier_settings); +}; + +bool operator==(const BotVerifierSettings &lhs, const BotVerifierSettings &rhs); + +bool operator==(const unique_ptr &lhs, const unique_ptr &rhs); + +inline bool operator!=(const unique_ptr &lhs, const unique_ptr &rhs) { + return !(lhs == rhs); +} + +StringBuilder &operator<<(StringBuilder &string_builder, const BotVerifierSettings &bot_verifier_settings); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.hpp b/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.hpp new file mode 100644 index 00000000..719e9ce6 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/BotVerifierSettings.hpp @@ -0,0 +1,43 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/BotVerifierSettings.h" + +#include "td/utils/tl_helpers.h" + +namespace td { + +template +void BotVerifierSettings::store(StorerT &storer) const { + bool has_description = !description_.empty(); + BEGIN_STORE_FLAGS(); + STORE_FLAG(has_description); + STORE_FLAG(can_modify_custom_description_); + END_STORE_FLAGS(); + td::store(icon_, storer); + td::store(company_, storer); + if (has_description) { + td::store(description_, storer); + } +} + +template +void BotVerifierSettings::parse(ParserT &parser) { + bool has_description; + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(has_description); + PARSE_FLAG(can_modify_custom_description_); + END_PARSE_FLAGS(); + td::parse(icon_, parser); + td::parse(company_, parser); + if (has_description) { + td::parse(description_, parser); + } +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.cpp b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.cpp index 14e6a4e9..de3c0019 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.h b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.h index d8efb2be..a40a67ae 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.hpp b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.hpp index 602c5cb8..22aa939f 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessage.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.cpp b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.cpp index 8bc7139b..b1394a10 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.h b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.h index c76ff9b1..2e885569 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.hpp b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.hpp index 82c6b0b5..adbe953a 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessAwayMessageSchedule.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.cpp b/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.cpp index 6152f94a..4505a02e 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.h b/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.h index 56351dd2..e8b88c7c 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessBotManageBar.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessChatLink.cpp b/lib/tgchat/ext/td/td/telegram/BusinessChatLink.cpp index 66e19d49..8259ea86 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessChatLink.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessChatLink.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessChatLink.h b/lib/tgchat/ext/td/td/telegram/BusinessChatLink.h index ee53be06..c879bb8a 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessChatLink.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessChatLink.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.cpp b/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.cpp index eabdf3c3..0c499197 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -39,7 +39,7 @@ bool operator==(const BusinessConnectedBot &lhs, const BusinessConnectedBot &rhs } StringBuilder &operator<<(StringBuilder &string_builder, const BusinessConnectedBot &connected_bot) { - return string_builder << "coneected bot " << connected_bot.user_id_ << ' ' << connected_bot.recipients_ << ' ' + return string_builder << "connected bot " << connected_bot.user_id_ << ' ' << connected_bot.recipients_ << ' ' << (connected_bot.can_reply_ ? " that can reply" : " read-only"); } diff --git a/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.h b/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.h index d6285267..be089de8 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.hpp b/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.hpp index e075654e..4c8643dc 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessConnectedBot.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessConnectionId.h b/lib/tgchat/ext/td/td/telegram/BusinessConnectionId.h index 9dff460a..56273593 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessConnectionId.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessConnectionId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.cpp b/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.cpp index 1b69ceaa..7d0818fa 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -134,7 +134,7 @@ struct BusinessConnectionManager::PendingMessage { } file_upload_id_ = {file_id, FileManager::get_internal_upload_id()}; FileView file_view = td->file_manager_->get_file_view(file_id); - if (get_main_file_type(file_view.get_type()) != FileType::Photo) { + if (get_file_type_class(file_view.get_type()) != FileTypeClass::Photo) { auto thumbnail_file_id = get_message_content_thumbnail_file_id(content_.get(), td); if (thumbnail_file_id.is_valid()) { thumbnail_file_upload_id_ = {thumbnail_file_id, FileManager::get_internal_upload_id()}; diff --git a/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.h b/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.h index bf3c1d0d..ccc7bfe8 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessConnectionManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.cpp b/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.cpp index e34f3afe..d672bae1 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.h b/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.h index adffaf2b..332245a7 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.hpp b/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.hpp index 10057fd1..227b9abf 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessGreetingMessage.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessInfo.cpp b/lib/tgchat/ext/td/td/telegram/BusinessInfo.cpp index be0801e8..ec16866c 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessInfo.h b/lib/tgchat/ext/td/td/telegram/BusinessInfo.h index b4611c26..d7011eb2 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessInfo.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessInfo.hpp b/lib/tgchat/ext/td/td/telegram/BusinessInfo.hpp index c59764d6..0e4a17a8 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessIntro.cpp b/lib/tgchat/ext/td/td/telegram/BusinessIntro.cpp index 93de62e5..06b6f148 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessIntro.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessIntro.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessIntro.h b/lib/tgchat/ext/td/td/telegram/BusinessIntro.h index 17e3dfa0..b4c20d6a 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessIntro.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessIntro.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessIntro.hpp b/lib/tgchat/ext/td/td/telegram/BusinessIntro.hpp index 78367c1d..93ad8c9c 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessIntro.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessIntro.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessManager.cpp b/lib/tgchat/ext/td/td/telegram/BusinessManager.cpp index 5cac17ca..154b63d1 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessManager.h b/lib/tgchat/ext/td/td/telegram/BusinessManager.h index e85eedd6..f06a16ee 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessManager.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessRecipients.cpp b/lib/tgchat/ext/td/td/telegram/BusinessRecipients.cpp index 3d1be6d0..010b4991 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessRecipients.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessRecipients.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessRecipients.h b/lib/tgchat/ext/td/td/telegram/BusinessRecipients.h index 36feb55f..abb4ecd9 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessRecipients.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessRecipients.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessRecipients.hpp b/lib/tgchat/ext/td/td/telegram/BusinessRecipients.hpp index e37ee444..6ce1c429 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessRecipients.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessRecipients.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.cpp b/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.cpp index 40d4d7ec..10e8fcd6 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.cpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.h b/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.h index 20ddecb0..7e4bb5e7 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.h +++ b/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.hpp b/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.hpp index 5bd15721..add0a8b7 100644 --- a/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.hpp +++ b/lib/tgchat/ext/td/td/telegram/BusinessWorkHours.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CallActor.cpp b/lib/tgchat/ext/td/td/telegram/CallActor.cpp index 25f06b3c..5add0d91 100644 --- a/lib/tgchat/ext/td/td/telegram/CallActor.cpp +++ b/lib/tgchat/ext/td/td/telegram/CallActor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -11,6 +11,7 @@ #include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileType.h" #include "td/telegram/Global.h" +#include "td/telegram/GroupCallManager.h" #include "td/telegram/misc.h" #include "td/telegram/net/NetQueryCreator.h" #include "td/telegram/net/NetQueryDispatcher.h" @@ -141,18 +142,23 @@ tl_object_ptr CallState::get_call_state_object() const { } } -CallActor::CallActor(CallId call_id, ActorShared<> parent, Promise promise) - : parent_(std::move(parent)), call_id_promise_(std::move(promise)), local_call_id_(call_id) { +CallActor::CallActor(Td *td, CallId call_id, ActorShared<> parent, Promise promise) + : td_(td), parent_(std::move(parent)), call_id_promise_(std::move(promise)), local_call_id_(call_id) { } void CallActor::create_call(UserId user_id, tl_object_ptr &&input_user, - CallProtocol &&protocol, bool is_video, Promise &&promise) { + CallProtocol &&protocol, bool is_video, GroupCallId group_call_id, + Promise &&promise) { CHECK(state_ == State::Empty); state_ = State::SendRequestQuery; is_outgoing_ = true; is_video_ = is_video; user_id_ = user_id; input_user_ = std::move(input_user); + auto r_input_group_call_id = td_->group_call_manager_->get_input_group_call_id(group_call_id); + if (r_input_group_call_id.is_ok()) { + // input_group_call_id_ = r_input_group_call_id.ok(); + } call_state_.protocol = std::move(protocol); call_state_.type = CallState::Type::Pending; call_state_.is_received = false; @@ -217,16 +223,18 @@ void CallActor::discard_call(bool is_disconnected, int32 duration, bool is_video case CallState::Type::Empty: case CallState::Type::Pending: if (is_outgoing_) { - call_state_.discard_reason = CallDiscardReason::Missed; + call_state_.discard_reason.type_ = CallDiscardReason::Type::Missed; } else { - call_state_.discard_reason = CallDiscardReason::Declined; + call_state_.discard_reason.type_ = CallDiscardReason::Type::Declined; } break; case CallState::Type::ExchangingKey: - call_state_.discard_reason = is_disconnected ? CallDiscardReason::Disconnected : CallDiscardReason::HungUp; + call_state_.discard_reason.type_ = + is_disconnected ? CallDiscardReason::Type::Disconnected : CallDiscardReason::Type::HungUp; break; case CallState::Type::Ready: - call_state_.discard_reason = is_disconnected ? CallDiscardReason::Disconnected : CallDiscardReason::HungUp; + call_state_.discard_reason.type_ = + is_disconnected ? CallDiscardReason::Type::Disconnected : CallDiscardReason::Type::HungUp; duration_ = duration; connection_id_ = connection_id; break; @@ -357,7 +365,7 @@ void CallActor::send_call_log(td_api::object_ptr log_file, Pr return promise.set_error(Status::Error(400, "Unexpected sendCallLog")); } - auto *file_manager = G()->td().get_actor_unsafe()->file_manager_.get(); + auto *file_manager = td_->file_manager_.get(); TRY_RESULT_PROMISE(promise, file_id, file_manager->get_input_file_id(FileType::CallLog, log_file, DialogId(), false, false)); @@ -459,7 +467,32 @@ void CallActor::on_save_log_query_result(FileUploadId file_upload_id, Promise promise) { + if (input_group_call_id_.is_valid()) { + return promise.set_value(Unit()); + } + auto tl_query = telegram_api::phone_createConferenceCall(get_input_phone_call("create_conference_call"), 0); + auto query = G()->net_query_creator().create(tl_query); + send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this), promise = std::move(promise)]( + Result r_net_query) mutable { + send_closure(actor_id, &CallActor::on_create_conference_call_result, std::move(promise), + std::move(r_net_query)); + })); + loop(); +} + +void CallActor::on_create_conference_call_result(Promise promise, Result r_net_query) { + auto res = fetch_result(std::move(r_net_query)); + if (res.is_error()) { + return promise.set_error(res.move_as_error()); + } + update_call_inner(res.move_as_ok()); + if (!input_group_call_id_.is_valid()) { + return promise.set_error(Status::Error(500, "Receive invalid response")); + } + promise.set_value(Unit()); +} + void CallActor::update_call(tl_object_ptr call) { LOG(INFO) << "Receive " << to_string(call); auto status = [&] { @@ -522,6 +555,7 @@ Status CallActor::do_update_call(const telegram_api::phoneCallWaiting &call) { call_access_hash_ = call.access_hash_; is_call_id_inited_ = true; call_admin_user_id_ = UserId(call.admin_id_); + update_conference_call(call.conference_call_); on_get_call_id(); if (call.video_ && !is_video_) { @@ -544,6 +578,7 @@ Status CallActor::do_update_call(const telegram_api::phoneCallRequested &call) { call_id_ = call.id_; call_access_hash_ = call.access_hash_; is_call_id_inited_ = true; + update_conference_call(call.conference_call_); is_video_ |= call.video_; call_admin_user_id_ = UserId(call.admin_id_); on_get_call_id(); @@ -578,6 +613,7 @@ Status CallActor::do_update_call(const telegram_api::phoneCallAccepted &call) { call_admin_user_id_ = UserId(call.admin_id_); on_get_call_id(); } + update_conference_call(call.conference_call_); is_video_ |= call.video_; dh_handshake_.set_g_a(call.g_b_.as_slice()); TRY_STATUS(dh_handshake_.run_checks(true, DhCache::instance())); @@ -596,8 +632,22 @@ void CallActor::on_begin_exchanging_key() { set_timeout_in(timeout); } +void CallActor::update_conference_call(const telegram_api::object_ptr &conference_call) { + InputGroupCallId input_group_call_id; + if (conference_call != nullptr) { + input_group_call_id = InputGroupCallId(conference_call); + } + if (input_group_call_id_ != input_group_call_id) { + input_group_call_id_ = input_group_call_id; + call_state_need_flush_ = true; + } +} + Status CallActor::do_update_call(const telegram_api::phoneCall &call) { if (state_ != State::WaitAcceptResult && state_ != State::WaitConfirmResult) { + if (state_ == State::Ready) { + update_conference_call(call.conference_call_); + } return Status::OK(); } cancel_timeout(); @@ -625,6 +675,7 @@ Status CallActor::do_update_call(const telegram_api::phoneCall &call) { if (call.custom_parameters_ != nullptr) { call_state_.custom_parameters = std::move(call.custom_parameters_->data_); } + update_conference_call(call.conference_call_); call_state_.type = CallState::Type::Ready; call_state_need_flush_ = true; @@ -633,6 +684,7 @@ Status CallActor::do_update_call(const telegram_api::phoneCall &call) { Status CallActor::do_update_call(const telegram_api::phoneCallDiscarded &call) { LOG(DEBUG) << "Do update call to Discarded"; + update_conference_call(call.conference_call_); on_call_discarded(get_call_discard_reason(call.reason_), call.need_rating_, call.need_debug_, call.video_); return Status::OK(); } @@ -654,8 +706,8 @@ void CallActor::on_call_discarded(CallDiscardReason reason, bool need_rating, bo is_video_ = true; call_state_need_flush_ = true; } - if (call_state_.discard_reason != reason && reason != CallDiscardReason::Empty) { - call_state_.discard_reason = reason; + if (call_state_.discard_reason != reason && reason.type_ != CallDiscardReason::Type::Empty) { + call_state_.discard_reason = std::move(reason); call_state_need_flush_ = true; } if (call_state_.type != CallState::Type::Error) { @@ -696,8 +748,9 @@ void CallActor::on_error(Status status) { state_ = State::Discarded; } else { state_ = State::SendDiscardQuery; - call_state_.discard_reason = - call_state_.type == CallState::Type::Pending ? CallDiscardReason::Missed : CallDiscardReason::Disconnected; + call_state_.discard_reason.type_ = call_state_.type == CallState::Type::Pending + ? CallDiscardReason::Type::Missed + : CallDiscardReason::Type::Disconnected; } call_state_.type = CallState::Type::Error; @@ -784,9 +837,14 @@ void CallActor::try_send_request_query() { if (is_video_) { flags |= telegram_api::phone_requestCall::VIDEO_MASK; } - auto tl_query = telegram_api::phone_requestCall(flags, false /*ignored*/, std::move(input_user_), - Random::secure_int32(), BufferSlice(dh_handshake_.get_g_b_hash()), - call_state_.protocol.get_input_phone_call_protocol()); + telegram_api::object_ptr input_group_call; + if (input_group_call_id_.is_valid()) { + flags |= telegram_api::phone_requestCall::CONFERENCE_CALL_MASK; + input_group_call = input_group_call_id_.get_input_group_call(); + } + auto tl_query = telegram_api::phone_requestCall( + flags, false /*ignored*/, std::move(input_user_), std::move(input_group_call), Random::secure_int32(), + BufferSlice(dh_handshake_.get_g_b_hash()), call_state_.protocol.get_input_phone_call_protocol()); auto query = G()->net_query_creator().create(tl_query); state_ = State::WaitRequestResult; int64 call_receive_timeout_ms = G()->get_option_integer("call_receive_timeout_ms", 20000); @@ -869,7 +927,9 @@ void CallActor::on_confirm_query_result(Result r_net_query) { void CallActor::try_send_discard_query() { if (call_id_ == 0) { LOG(INFO) << "Failed to send discard query, because call_id_ is unknown"; - on_call_discarded(CallDiscardReason::Missed, false, false, is_video_); + CallDiscardReason reason; + reason.type_ = CallDiscardReason::Type::Missed; + on_call_discarded(std::move(reason), false, false, is_video_); yield(); return; } @@ -898,6 +958,9 @@ void CallActor::on_discard_query_result(Result r_net_query) { } void CallActor::flush_call_state() { + if (G()->close_flag()) { + return; + } if (call_state_need_flush_) { if (!is_outgoing_) { if (call_state_.type == CallState::Type::Pending) { @@ -921,8 +984,9 @@ void CallActor::flush_call_state() { call_state_need_flush_ = false; auto peer_id = is_outgoing_ ? user_id_ : call_admin_user_id_; + auto group_call_id = td_->group_call_manager_->get_group_call_id(input_group_call_id_, DialogId()).get(); auto update = td_api::make_object(td_api::make_object( - local_call_id_.get(), 0, is_outgoing_, is_video_, call_state_.get_call_state_object())); + local_call_id_.get(), 0, is_outgoing_, is_video_, call_state_.get_call_state_object(), group_call_id)); send_closure(G()->user_manager(), &UserManager::get_user_id_object_async, peer_id, [td_actor = G()->td(), update = std::move(update)](Result r_user_id) mutable { if (r_user_id.is_ok()) { diff --git a/lib/tgchat/ext/td/td/telegram/CallActor.h b/lib/tgchat/ext/td/td/telegram/CallActor.h index 135eb2e9..6d670611 100644 --- a/lib/tgchat/ext/td/td/telegram/CallActor.h +++ b/lib/tgchat/ext/td/td/telegram/CallActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,6 +10,8 @@ #include "td/telegram/CallId.h" #include "td/telegram/DhConfig.h" #include "td/telegram/files/FileUploadId.h" +#include "td/telegram/GroupCallId.h" +#include "td/telegram/InputGroupCallId.h" #include "td/telegram/net/NetQuery.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" @@ -28,6 +30,8 @@ namespace td { +class Td; + struct CallProtocol { bool udp_p2p{true}; bool udp_reflector{true}; @@ -74,7 +78,7 @@ struct CallState { CallProtocol protocol; vector connections; - CallDiscardReason discard_reason{CallDiscardReason::Empty}; + CallDiscardReason discard_reason; bool is_created{false}; bool is_received{false}; bool need_debug_information{false}; @@ -95,23 +99,32 @@ struct CallState { class CallActor final : public NetQueryCallback { public: - CallActor(CallId call_id, ActorShared<> parent, Promise promise); + CallActor(Td *td, CallId call_id, ActorShared<> parent, Promise promise); void create_call(UserId user_id, tl_object_ptr &&input_user, CallProtocol &&protocol, - bool is_video, Promise &&promise); + bool is_video, GroupCallId group_call_id, Promise &&promise); + void accept_call(CallProtocol &&protocol, Promise promise); + void update_call_signaling_data(string data); + void send_call_signaling_data(string &&data, Promise promise); + void discard_call(bool is_disconnected, int32 duration, bool is_video, int64 connection_id, Promise promise); + void rate_call(int32 rating, string comment, vector> &&problems, Promise promise); + void send_call_debug_information(string data, Promise promise); + void send_call_log(td_api::object_ptr log_file, Promise promise); + void create_conference_call(Promise promise); + void update_call(tl_object_ptr call); private: - void update_call_inner(tl_object_ptr call); + Td *td_; ActorShared<> parent_; Promise call_id_promise_; @@ -142,6 +155,7 @@ class CallActor final : public NetQueryCallback { bool is_video_{false}; UserId user_id_; tl_object_ptr input_user_; + InputGroupCallId input_group_call_id_; CallId local_call_id_; int64 call_id_{0}; @@ -156,6 +170,10 @@ class CallActor final : public NetQueryCallback { NetQueryRef request_query_ref_; + void update_call_inner(tl_object_ptr call); + + void update_conference_call(const telegram_api::object_ptr &conference_call); + tl_object_ptr get_input_phone_call(const char *source); bool load_dh_config(); void on_dh_config(Result> r_dh_config, bool dummy); @@ -205,6 +223,8 @@ class CallActor final : public NetQueryCallback { void on_save_log_query_result(FileUploadId file_upload_id, Promise promise, Result r_net_query); + void on_create_conference_call_result(Promise promise, Result r_net_query); + void on_get_call_config_result(Result r_net_query); void flush_call_state(); diff --git a/lib/tgchat/ext/td/td/telegram/CallDiscardReason.cpp b/lib/tgchat/ext/td/td/telegram/CallDiscardReason.cpp index 0da670b5..019a6820 100644 --- a/lib/tgchat/ext/td/td/telegram/CallDiscardReason.cpp +++ b/lib/tgchat/ext/td/td/telegram/CallDiscardReason.cpp @@ -1,68 +1,91 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/CallDiscardReason.h" +#include "td/utils/buffer.h" #include "td/utils/common.h" namespace td { -CallDiscardReason get_call_discard_reason(const tl_object_ptr &reason) { - if (reason == nullptr) { - return CallDiscardReason::Empty; - } - switch (reason->get_id()) { - case telegram_api::phoneCallDiscardReasonMissed::ID: - return CallDiscardReason::Missed; - case telegram_api::phoneCallDiscardReasonDisconnect::ID: - return CallDiscardReason::Disconnected; - case telegram_api::phoneCallDiscardReasonHangup::ID: - return CallDiscardReason::HungUp; - case telegram_api::phoneCallDiscardReasonBusy::ID: - return CallDiscardReason::Declined; - default: - UNREACHABLE(); - return CallDiscardReason::Empty; +CallDiscardReason get_call_discard_reason( + const telegram_api::object_ptr &reason) { + CallDiscardReason result; + if (reason != nullptr) { + switch (reason->get_id()) { + case telegram_api::phoneCallDiscardReasonMissed::ID: + result.type_ = CallDiscardReason::Type::Missed; + break; + case telegram_api::phoneCallDiscardReasonDisconnect::ID: + result.type_ = CallDiscardReason::Type::Disconnected; + break; + case telegram_api::phoneCallDiscardReasonHangup::ID: + result.type_ = CallDiscardReason::Type::HungUp; + break; + case telegram_api::phoneCallDiscardReasonBusy::ID: + result.type_ = CallDiscardReason::Type::Declined; + break; + case telegram_api::phoneCallDiscardReasonAllowGroupCall::ID: + result.type_ = CallDiscardReason::Type::AllowGroupCall; + result.encrypted_key_ = static_cast(reason.get()) + ->encrypted_key_.as_slice() + .str(); + break; + default: + UNREACHABLE(); + break; + } } + return result; } -tl_object_ptr get_input_phone_call_discard_reason(CallDiscardReason reason) { - switch (reason) { - case CallDiscardReason::Empty: +telegram_api::object_ptr get_input_phone_call_discard_reason( + CallDiscardReason reason) { + switch (reason.type_) { + case CallDiscardReason::Type::Empty: return nullptr; - case CallDiscardReason::Missed: - return make_tl_object(); - case CallDiscardReason::Disconnected: - return make_tl_object(); - case CallDiscardReason::HungUp: - return make_tl_object(); - case CallDiscardReason::Declined: - return make_tl_object(); + case CallDiscardReason::Type::Missed: + return telegram_api::make_object(); + case CallDiscardReason::Type::Disconnected: + return telegram_api::make_object(); + case CallDiscardReason::Type::HungUp: + return telegram_api::make_object(); + case CallDiscardReason::Type::Declined: + return telegram_api::make_object(); + case CallDiscardReason::Type::AllowGroupCall: + return telegram_api::make_object( + BufferSlice(reason.encrypted_key_)); default: UNREACHABLE(); return nullptr; } } -tl_object_ptr get_call_discard_reason_object(CallDiscardReason reason) { - switch (reason) { - case CallDiscardReason::Empty: - return make_tl_object(); - case CallDiscardReason::Missed: - return make_tl_object(); - case CallDiscardReason::Disconnected: - return make_tl_object(); - case CallDiscardReason::HungUp: - return make_tl_object(); - case CallDiscardReason::Declined: - return make_tl_object(); +td_api::object_ptr get_call_discard_reason_object(CallDiscardReason reason) { + switch (reason.type_) { + case CallDiscardReason::Type::Empty: + return td_api::make_object(); + case CallDiscardReason::Type::Missed: + return td_api::make_object(); + case CallDiscardReason::Type::Disconnected: + return td_api::make_object(); + case CallDiscardReason::Type::HungUp: + return td_api::make_object(); + case CallDiscardReason::Type::Declined: + return td_api::make_object(); + case CallDiscardReason::Type::AllowGroupCall: + return td_api::make_object(reason.encrypted_key_); default: UNREACHABLE(); return nullptr; } } +bool operator==(const CallDiscardReason &lhs, const CallDiscardReason &rhs) { + return lhs.type_ == rhs.type_ && lhs.encrypted_key_ == rhs.encrypted_key_; +} + } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/CallDiscardReason.h b/lib/tgchat/ext/td/td/telegram/CallDiscardReason.h index 3bc20f73..06be06b1 100644 --- a/lib/tgchat/ext/td/td/telegram/CallDiscardReason.h +++ b/lib/tgchat/ext/td/td/telegram/CallDiscardReason.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,16 +9,27 @@ #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" -#include "td/utils/int_types.h" +#include "td/utils/common.h" namespace td { -enum class CallDiscardReason : int32 { Empty, Missed, Disconnected, HungUp, Declined }; +struct CallDiscardReason { + enum class Type : int32 { Empty, Missed, Disconnected, HungUp, Declined, AllowGroupCall }; + Type type_ = Type::Empty; + string encrypted_key_; +}; -CallDiscardReason get_call_discard_reason(const tl_object_ptr &reason); +CallDiscardReason get_call_discard_reason(const telegram_api::object_ptr &reason); -tl_object_ptr get_input_phone_call_discard_reason(CallDiscardReason reason); +telegram_api::object_ptr get_input_phone_call_discard_reason( + CallDiscardReason reason); -tl_object_ptr get_call_discard_reason_object(CallDiscardReason reason); +td_api::object_ptr get_call_discard_reason_object(CallDiscardReason reason); + +bool operator==(const CallDiscardReason &lhs, const CallDiscardReason &rhs); + +inline bool operator!=(const CallDiscardReason &lhs, const CallDiscardReason &rhs) { + return !(lhs == rhs); +} } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/CallId.h b/lib/tgchat/ext/td/td/telegram/CallId.h index d3683c6b..5fdf4098 100644 --- a/lib/tgchat/ext/td/td/telegram/CallId.h +++ b/lib/tgchat/ext/td/td/telegram/CallId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CallManager.cpp b/lib/tgchat/ext/td/td/telegram/CallManager.cpp index 0eaf1d07..aa159231 100644 --- a/lib/tgchat/ext/td/td/telegram/CallManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/CallManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,7 +17,11 @@ namespace td { -CallManager::CallManager(ActorShared<> parent) : parent_(std::move(parent)) { +CallManager::CallManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { +} + +void CallManager::tear_down() { + parent_.reset(); } void CallManager::update_call(telegram_api::object_ptr call) { @@ -77,14 +81,15 @@ void CallManager::update_call_signaling_data(int64 call_id, string data) { } void CallManager::create_call(UserId user_id, tl_object_ptr &&input_user, - CallProtocol &&protocol, bool is_video, Promise promise) { + CallProtocol &&protocol, bool is_video, GroupCallId group_call_id, + Promise promise) { LOG(INFO) << "Create call with " << user_id; auto call_id = create_call_actor(); auto actor = get_call_actor(call_id); CHECK(!actor.empty()); auto safe_promise = SafePromise(std::move(promise), Status::Error(400, "Call not found")); send_closure(actor, &CallActor::create_call, user_id, std::move(input_user), std::move(protocol), is_video, - std::move(safe_promise)); + group_call_id, std::move(safe_promise)); } void CallManager::accept_call(CallId call_id, CallProtocol &&protocol, Promise promise) { @@ -144,6 +149,15 @@ void CallManager::send_call_log(CallId call_id, td_api::object_ptr promise) { + auto actor = get_call_actor(call_id); + if (actor.empty()) { + return promise.set_error(Status::Error(400, "Call not found")); + } + auto safe_promise = SafePromise(std::move(promise), Status::Error(400, "Call not found")); + send_closure(actor, &CallActor::create_conference_call, std::move(safe_promise)); +} + CallId CallManager::create_call_actor() { if (next_call_id_ == std::numeric_limits::max()) { next_call_id_ = 1; @@ -156,8 +170,8 @@ CallId CallManager::create_call_actor() { auto main_promise = PromiseCreator::lambda([actor_id = actor_id(this), id](Result call_id) { send_closure(actor_id, &CallManager::set_call_id, id, std::move(call_id)); }); - it_flag.first->second = create_actor(PSLICE() << "Call " << id.get(), id, actor_shared(this, id.get()), - std::move(main_promise)); + it_flag.first->second = create_actor(PSLICE() << "Call " << id.get(), td_, id, + actor_shared(this, id.get()), std::move(main_promise)); return id; } diff --git a/lib/tgchat/ext/td/td/telegram/CallManager.h b/lib/tgchat/ext/td/td/telegram/CallManager.h index a4bcb5a6..e9222ca2 100644 --- a/lib/tgchat/ext/td/td/telegram/CallManager.h +++ b/lib/tgchat/ext/td/td/telegram/CallManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,6 +8,7 @@ #include "td/telegram/CallActor.h" #include "td/telegram/CallId.h" +#include "td/telegram/GroupCallId.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UserId.h" @@ -23,16 +24,18 @@ namespace td { +class Td; + class CallManager final : public Actor { public: - explicit CallManager(ActorShared<> parent); + CallManager(Td *td, ActorShared<> parent); void update_call(telegram_api::object_ptr call); void update_call_signaling_data(int64 call_id, string data); void create_call(UserId user_id, tl_object_ptr &&input_user, CallProtocol &&protocol, - bool is_video, Promise promise); + bool is_video, GroupCallId group_call_id, Promise promise); void accept_call(CallId call_id, CallProtocol &&protocol, Promise promise); @@ -48,8 +51,12 @@ class CallManager final : public Actor { void send_call_log(CallId call_id, td_api::object_ptr log_file, Promise promise); + void create_conference_call(CallId call_id, Promise promise); + private: bool close_flag_ = false; + + Td *td_; ActorShared<> parent_; struct CallInfo { @@ -66,5 +73,6 @@ class CallManager final : public Actor { void hangup() final; void hangup_shared() final; + void tear_down() final; }; } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.cpp b/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.cpp index 4afaa112..6f32aa80 100644 --- a/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.h b/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.h index 9deae9da..69d953b0 100644 --- a/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.h +++ b/lib/tgchat/ext/td/td/telegram/CallbackQueriesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChainId.h b/lib/tgchat/ext/td/td/telegram/ChainId.h index 295bc8d1..05224599 100644 --- a/lib/tgchat/ext/td/td/telegram/ChainId.h +++ b/lib/tgchat/ext/td/td/telegram/ChainId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChannelId.h b/lib/tgchat/ext/td/td/telegram/ChannelId.h index 7a9b4936..8dcb4291 100644 --- a/lib/tgchat/ext/td/td/telegram/ChannelId.h +++ b/lib/tgchat/ext/td/td/telegram/ChannelId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.cpp b/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.cpp index 4295cd32..316bdd57 100644 --- a/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.cpp +++ b/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.h b/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.h index 614e3a7f..b6b4b707 100644 --- a/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.h +++ b/lib/tgchat/ext/td/td/telegram/ChannelParticipantFilter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.cpp b/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.cpp index 164d304c..0cf5e69d 100644 --- a/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.h b/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.h index 8cdd5efa..4a572d59 100644 --- a/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.h +++ b/lib/tgchat/ext/td/td/telegram/ChannelRecommendationManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChannelType.h b/lib/tgchat/ext/td/td/telegram/ChannelType.h index 6d22147b..1fe0c00e 100644 --- a/lib/tgchat/ext/td/td/telegram/ChannelType.h +++ b/lib/tgchat/ext/td/td/telegram/ChannelType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChatId.h b/lib/tgchat/ext/td/td/telegram/ChatId.h index b74d8439..e2a0975a 100644 --- a/lib/tgchat/ext/td/td/telegram/ChatId.h +++ b/lib/tgchat/ext/td/td/telegram/ChatId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChatManager.cpp b/lib/tgchat/ext/td/td/telegram/ChatManager.cpp index fb4caca7..61d6450c 100644 --- a/lib/tgchat/ext/td/td/telegram/ChatManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ChatManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,6 +7,8 @@ #include "td/telegram/ChatManager.h" #include "td/telegram/AuthManager.h" +#include "td/telegram/BotVerification.h" +#include "td/telegram/BotVerification.hpp" #include "td/telegram/Dependencies.h" #include "td/telegram/DialogAdministrator.h" #include "td/telegram/DialogInviteLink.hpp" @@ -37,12 +39,14 @@ #include "td/telegram/StickersManager.h" #include "td/telegram/StoryManager.h" #include "td/telegram/SuggestedAction.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/Td.h" #include "td/telegram/TdDb.h" #include "td/telegram/telegram_api.h" #include "td/telegram/ThemeManager.h" #include "td/telegram/UpdatesManager.h" #include "td/telegram/UserManager.h" +#include "td/telegram/VerificationStatus.h" #include "td/db/binlog/BinlogEvent.h" #include "td/db/binlog/BinlogHelper.h" @@ -1932,6 +1936,7 @@ void ChatManager::Channel::store(StorerT &storer) const { bool has_profile_background_custom_emoji_id = profile_background_custom_emoji_id.is_valid(); bool has_boost_level = boost_level != 0; bool has_emoji_status = !emoji_status.is_empty(); + bool has_bot_verification_icon = bot_verification_icon.is_valid(); BEGIN_STORE_FLAGS(); STORE_FLAG(false); STORE_FLAG(false); @@ -1978,6 +1983,7 @@ void ChatManager::Channel::store(StorerT &storer) const { STORE_FLAG(has_boost_level); STORE_FLAG(has_emoji_status); STORE_FLAG(show_message_sender); + STORE_FLAG(has_bot_verification_icon); END_STORE_FLAGS(); } @@ -2030,6 +2036,9 @@ void ChatManager::Channel::store(StorerT &storer) const { if (has_emoji_status) { store(emoji_status, storer); } + if (has_bot_verification_icon) { + store(bot_verification_icon, storer); + } } template @@ -2061,6 +2070,7 @@ void ChatManager::Channel::parse(ParserT &parser) { bool has_profile_background_custom_emoji_id = false; bool has_boost_level = false; bool has_emoji_status = false; + bool has_bot_verification_icon = false; BEGIN_PARSE_FLAGS(); PARSE_FLAG(left); PARSE_FLAG(kicked); @@ -2107,6 +2117,7 @@ void ChatManager::Channel::parse(ParserT &parser) { PARSE_FLAG(has_boost_level); PARSE_FLAG(has_emoji_status); PARSE_FLAG(show_message_sender); + PARSE_FLAG(has_bot_verification_icon); END_PARSE_FLAGS(); } @@ -2192,6 +2203,9 @@ void ChatManager::Channel::parse(ParserT &parser) { if (has_emoji_status) { parse(emoji_status, parser); } + if (has_bot_verification_icon) { + parse(bot_verification_icon, parser); + } if (!check_utf8(title)) { LOG(ERROR) << "Have invalid title \"" << title << '"'; @@ -2240,6 +2254,7 @@ void ChatManager::ChannelFull::store(StorerT &storer) const { bool has_boost_count = boost_count != 0; bool has_unrestrict_boost_count = unrestrict_boost_count != 0; bool has_can_have_sponsored_messages = true; + bool has_bot_verification = bot_verification != nullptr; BEGIN_STORE_FLAGS(); STORE_FLAG(has_description); STORE_FLAG(has_administrator_count); @@ -2283,6 +2298,7 @@ void ChatManager::ChannelFull::store(StorerT &storer) const { STORE_FLAG(has_can_have_sponsored_messages); STORE_FLAG(has_paid_media_allowed); STORE_FLAG(can_view_star_revenue); + STORE_FLAG(has_bot_verification); END_STORE_FLAGS(); } if (has_description) { @@ -2344,6 +2360,9 @@ void ChatManager::ChannelFull::store(StorerT &storer) const { if (has_unrestrict_boost_count) { store(unrestrict_boost_count, storer); } + if (has_bot_verification) { + store(bot_verification, storer); + } } template @@ -2373,6 +2392,7 @@ void ChatManager::ChannelFull::parse(ParserT &parser) { bool has_boost_count = false; bool has_unrestrict_boost_count = false; bool has_can_have_sponsored_messages = false; + bool has_bot_verification = false; BEGIN_PARSE_FLAGS(); PARSE_FLAG(has_description); PARSE_FLAG(has_administrator_count); @@ -2416,6 +2436,7 @@ void ChatManager::ChannelFull::parse(ParserT &parser) { PARSE_FLAG(has_can_have_sponsored_messages); PARSE_FLAG(has_paid_media_allowed); PARSE_FLAG(can_view_star_revenue); + PARSE_FLAG(has_bot_verification); END_PARSE_FLAGS(); } if (has_description) { @@ -2485,6 +2506,9 @@ void ChatManager::ChannelFull::parse(ParserT &parser) { if (has_unrestrict_boost_count) { parse(unrestrict_boost_count, parser); } + if (has_bot_verification) { + parse(bot_verification, parser); + } if (legacy_can_view_statistics) { LOG(DEBUG) << "Ignore legacy can view statistics flag"; @@ -3314,7 +3338,7 @@ void ChatManager::convert_channel_to_gigagroup(ChannelId channel_id, Promisedialog_manager_->remove_dialog_suggested_action( + td_->suggested_action_manager_->remove_dialog_suggested_action( SuggestedAction{SuggestedAction::Type::ConvertToGigagroup, DialogId(channel_id)}); td_->create_handler(std::move(promise))->send(channel_id); @@ -4655,6 +4679,9 @@ void ChatManager::on_load_channel_full_from_database(ChannelId channel_id, strin for (auto bot_user_id : channel_full->bot_user_ids) { dependencies.add(bot_user_id); } + if (channel_full->bot_verification != nullptr) { + channel_full->bot_verification->add_dependencies(dependencies); + } dependencies.add(channel_full->invite_link.get_creator_user_id()); if (!dependencies.resolve_force(td_, source)) { channels_full_.erase(channel_id); @@ -4935,7 +4962,7 @@ void ChatManager::update_channel(Channel *c, ChannelId channel_id, bool from_bin if (c->default_permissions != RestrictedRights(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, ChannelType::Unknown)) { - td_->dialog_manager_->remove_dialog_suggested_action( + td_->suggested_action_manager_->remove_dialog_suggested_action( SuggestedAction{SuggestedAction::Type::ConvertToGigagroup, DialogId(channel_id)}); } c->is_default_permissions_changed = false; @@ -5389,6 +5416,7 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ auto unrestrict_boost_count = channel->boosts_unrestrict_; auto has_paid_media_allowed = channel->paid_media_allowed_; auto can_view_star_revenue = channel->can_view_stars_revenue_; + auto bot_verification = BotVerification::get_bot_verification(std::move(channel->bot_verification_)); StickerSetId sticker_set_id; if (channel->stickerset_ != nullptr) { sticker_set_id = @@ -5426,7 +5454,8 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ channel_full->unrestrict_boost_count != unrestrict_boost_count || channel_full->can_view_revenue != can_view_revenue || channel_full->has_paid_media_allowed != has_paid_media_allowed || - channel_full->can_view_star_revenue != can_view_star_revenue) { + channel_full->can_view_star_revenue != can_view_star_revenue || + channel_full->bot_verification != bot_verification) { channel_full->participant_count = participant_count; channel_full->administrator_count = administrator_count; channel_full->restricted_count = restricted_count; @@ -5448,6 +5477,7 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ channel_full->can_view_revenue = can_view_revenue; channel_full->has_paid_media_allowed = has_paid_media_allowed; channel_full->can_view_star_revenue = can_view_star_revenue; + channel_full->bot_verification = std::move(bot_verification); channel_full->is_changed = true; } @@ -5478,8 +5508,10 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ false); on_update_channel_full_photo(channel_full, channel_id, std::move(photo)); - td_->messages_manager_->on_read_channel_outbox(channel_id, - MessageId(ServerMessageId(channel->read_outbox_max_id_))); + auto read_outbox_max_message_id = MessageId(ServerMessageId(channel->read_outbox_max_id_)); + if (read_outbox_max_message_id.is_valid()) { + td_->messages_manager_->read_history_outbox(DialogId(channel_id), read_outbox_max_message_id); + } if ((channel->flags_ & telegram_api::channelFull::AVAILABLE_MIN_ID_MASK) != 0) { td_->messages_manager_->on_update_channel_max_unavailable_message_id( channel_id, MessageId(ServerMessageId(channel->available_min_id_)), "ChannelFull"); @@ -5599,8 +5631,8 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ } } - td_->dialog_manager_->set_dialog_pending_suggestions(DialogId(channel_id), - std::move(channel->pending_suggestions_)); + td_->suggested_action_manager_->set_dialog_pending_suggestions(DialogId(channel_id), + std::move(channel->pending_suggestions_)); } promise.set_value(Unit()); } @@ -6972,7 +7004,7 @@ void ChatManager::on_channel_status_changed(Channel *c, ChannelId channel_id, co send_get_channel_full_query(nullptr, channel_id, Auto(), "update channel owner"); td_->dialog_participant_manager_->reload_dialog_administrators(DialogId(channel_id), {}, Auto()); - td_->dialog_manager_->remove_dialog_suggested_action( + td_->suggested_action_manager_->remove_dialog_suggested_action( SuggestedAction{SuggestedAction::Type::ConvertToGigagroup, DialogId(channel_id)}); } @@ -7164,6 +7196,14 @@ void ChatManager::on_update_channel_stories_hidden(Channel *c, ChannelId channel } } +void ChatManager::on_update_channel_bot_verification_icon(Channel *c, ChannelId channel_id, + CustomEmojiId bot_verification_icon) { + if (c->bot_verification_icon != bot_verification_icon) { + c->bot_verification_icon = bot_verification_icon; + c->is_changed = true; + } +} + void ChatManager::on_update_channel_participant_count(ChannelId channel_id, int32 participant_count) { Channel *c = get_channel(channel_id); if (c == nullptr || c->participant_count == participant_count) { @@ -7839,20 +7879,18 @@ bool ChatManager::get_channel_is_verified(ChannelId channel_id) const { return c->is_verified; } -bool ChatManager::get_channel_is_scam(ChannelId channel_id) const { +td_api::object_ptr ChatManager::get_channel_verification_status_object( + ChannelId channel_id) const { auto c = get_channel(channel_id); if (c == nullptr) { - return false; + return nullptr; } - return c->is_scam; + return get_channel_verification_status_object(c); } -bool ChatManager::get_channel_is_fake(ChannelId channel_id) const { - auto c = get_channel(channel_id); - if (c == nullptr) { - return false; - } - return c->is_fake; +td_api::object_ptr ChatManager::get_channel_verification_status_object( + const Channel *c) const { + return get_verification_status_object(td_, c->is_verified, c->is_scam, c->is_fake, c->bot_verification_icon); } bool ChatManager::get_channel_sign_messages(ChannelId channel_id) const { @@ -8376,8 +8414,10 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou if (channel.flags_ == 0 && channel.access_hash_ == 0 && channel.title_.empty()) { Channel *c = get_channel_force(channel_id, source); - LOG(ERROR) << "Receive empty " << to_string(channel) << " from " << source << ", have " - << to_string(get_supergroup_object(channel_id, c)); + if (c != nullptr) { + LOG(ERROR) << "Receive from " << source << " empty " << channel_id << ": " << to_string(channel) << ", have " + << to_string(get_supergroup_object(channel_id, c)); + } if (c == nullptr && !have_min_channel(channel_id)) { min_channels_.set(channel_id, td::make_unique()); } @@ -8434,7 +8474,7 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou is_forum = false; } if (is_gigagroup) { - td_->dialog_manager_->remove_dialog_suggested_action( + td_->suggested_action_manager_->remove_dialog_suggested_action( SuggestedAction{SuggestedAction::Type::ConvertToGigagroup, DialogId(channel_id)}); } @@ -8480,6 +8520,7 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou c->restriction_reasons = std::move(restriction_reasons); c->is_changed = true; } + on_update_channel_bot_verification_icon(c, channel_id, CustomEmojiId(channel.bot_verification_icon_)); } if (c->join_to_send != join_to_send || c->join_request != join_request) { c->join_to_send = join_to_send; @@ -8592,6 +8633,7 @@ void ChatManager::on_get_channel(telegram_api::channel &channel, const char *sou c->restriction_reasons = std::move(restriction_reasons); c->is_changed = true; } + on_update_channel_bot_verification_icon(c, channel_id, CustomEmojiId(channel.bot_verification_icon_)); } if (c->join_to_send != join_to_send || c->join_request != join_request) { c->join_to_send = join_to_send; @@ -8756,6 +8798,7 @@ void ChatManager::on_get_channel_forbidden(telegram_api::channelForbidden &chann // on_update_channel_has_location(c, channel_id, false); on_update_channel_noforwards(c, channel_id, false); on_update_channel_emoji_status(c, channel_id, EmojiStatus()); + on_update_channel_bot_verification_icon(c, channel_id, CustomEmojiId()); td_->messages_manager_->on_update_dialog_group_call(DialogId(channel_id), false, false, "on_get_channel_forbidden"); // must be after setting of c->is_megagroup tl_object_ptr banned_rights; // == nullptr @@ -8863,8 +8906,8 @@ td_api::object_ptr ChatManager::get_update_unknown_sup bool is_megagroup = min_channel == nullptr ? false : min_channel->is_megagroup_; return td_api::make_object(td_api::make_object( channel_id.get(), nullptr, 0, DialogParticipantStatus::Banned(0).get_chat_member_status_object(), 0, 0, false, - false, false, false, !is_megagroup, false, false, !is_megagroup, false, false, false, false, string(), false, - false, false, false)); + false, false, false, !is_megagroup, false, false, !is_megagroup, false, false, nullptr, false, string(), false, + false)); } int64 ChatManager::get_supergroup_id_object(ChannelId channel_id, const char *source) const { @@ -8890,11 +8933,12 @@ bool ChatManager::get_channel_has_unread_stories(const Channel *c) { return c->max_active_story_id.get() > c->max_read_story_id.get(); } -tl_object_ptr ChatManager::get_supergroup_object(ChannelId channel_id) const { +td_api::object_ptr ChatManager::get_supergroup_object(ChannelId channel_id) const { return get_supergroup_object(channel_id, get_channel(channel_id)); } -tl_object_ptr ChatManager::get_supergroup_object(ChannelId channel_id, const Channel *c) { +td_api::object_ptr ChatManager::get_supergroup_object(ChannelId channel_id, + const Channel *c) const { if (c == nullptr) { return nullptr; } @@ -8903,9 +8947,9 @@ tl_object_ptr ChatManager::get_supergroup_object(ChannelId c get_channel_status(c).get_chat_member_status_object(), c->participant_count, c->boost_level, c->has_linked_channel, c->has_location, c->sign_messages, c->show_message_sender, get_channel_join_to_send(c), get_channel_join_request(c), c->is_slow_mode_enabled, !c->is_megagroup, c->is_gigagroup, c->is_forum, - c->is_verified, get_restriction_reason_has_sensitive_content(c->restriction_reasons), - get_restriction_reason_description(c->restriction_reasons), c->is_scam, c->is_fake, - c->max_active_story_id.is_valid(), get_channel_has_unread_stories(c)); + get_channel_verification_status_object(c), get_restriction_reason_has_sensitive_content(c->restriction_reasons), + get_restriction_reason_description(c->restriction_reasons), c->max_active_story_id.is_valid(), + get_channel_has_unread_stories(c)); } tl_object_ptr ChatManager::get_supergroup_full_info_object(ChannelId channel_id) const { @@ -8923,6 +8967,9 @@ tl_object_ptr ChatManager::get_supergroup_full_info_ auto bot_commands = transform(channel_full->bot_commands, [td = td_](const BotCommands &commands) { return commands.get_bot_commands_object(td); }); + auto bot_verification = channel_full->bot_verification == nullptr + ? nullptr + : channel_full->bot_verification->get_bot_verification_object(td_); bool has_hidden_participants = channel_full->has_hidden_participants || !channel_full->can_get_participants; return td_api::make_object( get_chat_photo_object(td_->file_manager_.get(), channel_full->photo), channel_full->description, @@ -8938,6 +8985,7 @@ tl_object_ptr ChatManager::get_supergroup_full_info_ channel_full->unrestrict_boost_count, channel_full->sticker_set_id.get(), channel_full->emoji_sticker_set_id.get(), channel_full->location.get_chat_location_object(), channel_full->invite_link.get_chat_invite_link_object(td_->user_manager_.get()), std::move(bot_commands), + std::move(bot_verification), get_basic_group_id_object(channel_full->migrated_from_chat_id, "get_supergroup_full_info_object"), channel_full->migrated_from_max_message_id.get()); } diff --git a/lib/tgchat/ext/td/td/telegram/ChatManager.h b/lib/tgchat/ext/td/td/telegram/ChatManager.h index 166dfd9b..11d72e55 100644 --- a/lib/tgchat/ext/td/td/telegram/ChatManager.h +++ b/lib/tgchat/ext/td/td/telegram/ChatManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -54,6 +54,7 @@ namespace td { struct BinlogEvent; +class BotVerification; struct MinChannel; class Td; @@ -348,8 +349,7 @@ class ChatManager final : public Actor { DialogParticipantStatus get_channel_status(ChannelId channel_id) const; DialogParticipantStatus get_channel_permissions(ChannelId channel_id) const; bool get_channel_is_verified(ChannelId channel_id) const; - bool get_channel_is_scam(ChannelId channel_id) const; - bool get_channel_is_fake(ChannelId channel_id) const; + td_api::object_ptr get_channel_verification_status_object(ChannelId channel_id) const; int32 get_channel_participant_count(ChannelId channel_id) const; bool get_channel_sign_messages(ChannelId channel_id) const; bool get_channel_show_message_sender(ChannelId channel_id) const; @@ -374,7 +374,7 @@ class ChatManager final : public Actor { int64 get_supergroup_id_object(ChannelId channel_id, const char *source) const; - tl_object_ptr get_supergroup_object(ChannelId channel_id) const; + td_api::object_ptr get_supergroup_object(ChannelId channel_id) const; tl_object_ptr get_supergroup_full_info_object(ChannelId channel_id) const; @@ -482,6 +482,7 @@ class ChatManager final : public Actor { int32 date = 0; int32 participant_count = 0; int32 boost_level = 0; + CustomEmojiId bot_verification_icon; double max_active_story_id_next_reload_time = 0.0; StoryId max_active_story_id; @@ -558,6 +559,7 @@ class ChatManager final : public Actor { DialogInviteLink invite_link; vector bot_commands; + unique_ptr bot_verification; uint32 speculative_version = 1; uint32 repair_request_version = 0; @@ -704,6 +706,7 @@ class ChatManager final : public Actor { static ChannelType get_channel_type(const Channel *c); static DialogParticipantStatus get_channel_status(const Channel *c); DialogParticipantStatus get_channel_permissions(ChannelId channel_id, const Channel *c) const; + td_api::object_ptr get_channel_verification_status_object(const Channel *c) const; static bool get_channel_sign_messages(const Channel *c); static bool get_channel_show_message_sender(const Channel *c); static bool get_channel_has_linked_channel(const Channel *c); @@ -752,6 +755,7 @@ class ChatManager final : public Actor { void on_update_channel_story_ids_impl(Channel *c, ChannelId channel_id, StoryId max_active_story_id, StoryId max_read_story_id); void on_update_channel_max_read_story_id(Channel *c, ChannelId channel_id, StoryId max_read_story_id); + void on_update_channel_bot_verification_icon(Channel *c, ChannelId channel_id, CustomEmojiId bot_verification_icon); void on_update_channel_full_photo(ChannelFull *channel_full, ChannelId channel_id, Photo photo); void on_update_channel_full_invite_link(ChannelFull *channel_full, @@ -868,7 +872,7 @@ class ChatManager final : public Actor { td_api::object_ptr get_update_unknown_supergroup_object(ChannelId channel_id) const; - static tl_object_ptr get_supergroup_object(ChannelId channel_id, const Channel *c); + td_api::object_ptr get_supergroup_object(ChannelId channel_id, const Channel *c) const; Status can_hide_chat_participants(ChatId chat_id) const; diff --git a/lib/tgchat/ext/td/td/telegram/ChatReactions.cpp b/lib/tgchat/ext/td/td/telegram/ChatReactions.cpp index 91779e73..4f73cbb3 100644 --- a/lib/tgchat/ext/td/td/telegram/ChatReactions.cpp +++ b/lib/tgchat/ext/td/td/telegram/ChatReactions.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChatReactions.h b/lib/tgchat/ext/td/td/telegram/ChatReactions.h index 8b7c9053..4ac9d56d 100644 --- a/lib/tgchat/ext/td/td/telegram/ChatReactions.h +++ b/lib/tgchat/ext/td/td/telegram/ChatReactions.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ChatReactions.hpp b/lib/tgchat/ext/td/td/telegram/ChatReactions.hpp index 692049f9..cc39ca27 100644 --- a/lib/tgchat/ext/td/td/telegram/ChatReactions.hpp +++ b/lib/tgchat/ext/td/td/telegram/ChatReactions.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Client.cpp b/lib/tgchat/ext/td/td/telegram/Client.cpp index 45322cee..0a12cb50 100644 --- a/lib/tgchat/ext/td/td/telegram/Client.cpp +++ b/lib/tgchat/ext/td/td/telegram/Client.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Client.h b/lib/tgchat/ext/td/td/telegram/Client.h index f6019fd3..6b78b80a 100644 --- a/lib/tgchat/ext/td/td/telegram/Client.h +++ b/lib/tgchat/ext/td/td/telegram/Client.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ClientActor.cpp b/lib/tgchat/ext/td/td/telegram/ClientActor.cpp index 915ba7f1..415af1d2 100644 --- a/lib/tgchat/ext/td/td/telegram/ClientActor.cpp +++ b/lib/tgchat/ext/td/td/telegram/ClientActor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ClientActor.h b/lib/tgchat/ext/td/td/telegram/ClientActor.h index b22e392a..e1613d2c 100644 --- a/lib/tgchat/ext/td/td/telegram/ClientActor.h +++ b/lib/tgchat/ext/td/td/telegram/ClientActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ClientDotNet.cpp b/lib/tgchat/ext/td/td/telegram/ClientDotNet.cpp index fa5401b5..7de27d89 100644 --- a/lib/tgchat/ext/td/td/telegram/ClientDotNet.cpp +++ b/lib/tgchat/ext/td/td/telegram/ClientDotNet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ClientJson.cpp b/lib/tgchat/ext/td/td/telegram/ClientJson.cpp index ae92aa02..990454d3 100644 --- a/lib/tgchat/ext/td/td/telegram/ClientJson.cpp +++ b/lib/tgchat/ext/td/td/telegram/ClientJson.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ClientJson.h b/lib/tgchat/ext/td/td/telegram/ClientJson.h index 91ca78ee..5ba19e62 100644 --- a/lib/tgchat/ext/td/td/telegram/ClientJson.h +++ b/lib/tgchat/ext/td/td/telegram/ClientJson.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CommonDialogManager.cpp b/lib/tgchat/ext/td/td/telegram/CommonDialogManager.cpp index 3a9b2d47..b83353b0 100644 --- a/lib/tgchat/ext/td/td/telegram/CommonDialogManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/CommonDialogManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CommonDialogManager.h b/lib/tgchat/ext/td/td/telegram/CommonDialogManager.h index 7b128ca6..8dcd56fa 100644 --- a/lib/tgchat/ext/td/td/telegram/CommonDialogManager.h +++ b/lib/tgchat/ext/td/td/telegram/CommonDialogManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ConfigManager.cpp b/lib/tgchat/ext/td/td/telegram/ConfigManager.cpp index 40d0369d..4449fb18 100644 --- a/lib/tgchat/ext/td/td/telegram/ConfigManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ConfigManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -26,7 +26,8 @@ #include "td/telegram/Premium.h" #include "td/telegram/ReactionType.h" #include "td/telegram/StateManager.h" -#include "td/telegram/SuggestedAction.hpp" +#include "td/telegram/SuggestedAction.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/Td.h" #include "td/telegram/TdDb.h" #include "td/telegram/telegram_api.h" @@ -874,18 +875,6 @@ void ConfigManager::start_up() { expire_time_ = expire_time; set_timeout_in(expire_time_.in()); } - - auto log_event_string = G()->td_db()->get_binlog_pmc()->get(get_suggested_actions_database_key()); - if (!log_event_string.empty()) { - vector suggested_actions; - auto status = log_event_parse(suggested_actions, log_event_string); - if (status.is_error()) { - LOG(ERROR) << "Failed to parse suggested actions from binlog: " << status; - save_suggested_actions(); - } else { - update_suggested_actions(suggested_actions_, std::move(suggested_actions)); - } - } } ActorShared<> ConfigManager::create_reference() { @@ -1051,58 +1040,8 @@ void ConfigManager::do_set_ignore_sensitive_content_restrictions(bool ignore_sen reget_app_config(Auto()); } -void ConfigManager::hide_suggested_action(SuggestedAction suggested_action) { - if (remove_suggested_action(suggested_actions_, suggested_action)) { - save_suggested_actions(); - } -} - -void ConfigManager::dismiss_suggested_action(SuggestedAction suggested_action, Promise &&promise) { - auto action_str = suggested_action.get_suggested_action_str(); - if (action_str.empty()) { - return promise.set_value(Unit()); - } - - if (!td::contains(suggested_actions_, suggested_action)) { - return promise.set_value(Unit()); - } - - dismiss_suggested_action_request_count_++; - auto type = static_cast(suggested_action.type_); - auto &queries = dismiss_suggested_action_queries_[type]; - queries.push_back(std::move(promise)); - if (queries.size() == 1) { - G()->net_query_dispatcher().dispatch_with_callback( - G()->net_query_creator().create( - telegram_api::help_dismissSuggestion(make_tl_object(), action_str)), - actor_shared(this, 100 + type)); - } -} - void ConfigManager::on_result(NetQueryPtr net_query) { auto token = get_link_token(); - if (token >= 100 && token <= 200) { - auto type = static_cast(token - 100); - SuggestedAction suggested_action{static_cast(type)}; - auto promises = std::move(dismiss_suggested_action_queries_[type]); - dismiss_suggested_action_queries_.erase(type); - CHECK(!promises.empty()); - CHECK(dismiss_suggested_action_request_count_ >= promises.size()); - dismiss_suggested_action_request_count_ -= promises.size(); - - auto result_ptr = fetch_result(std::move(net_query)); - if (result_ptr.is_error()) { - fail_promises(promises, result_ptr.move_as_error()); - return; - } - if (remove_suggested_action(suggested_actions_, suggested_action)) { - save_suggested_actions(); - } - reget_app_config(Auto()); - - set_promises(promises); - return; - } if (token == 3 || token == 4) { is_set_content_settings_request_sent_ = false; bool ignore_sensitive_content_restrictions = (token == 4); @@ -1436,6 +1375,7 @@ void ConfigManager::process_app_config(tl_object_ptr &c bool need_premium_for_new_chat_privacy = true; bool channel_revenue_withdrawal_enabled = false; bool can_edit_fact_check = false; + vector starref_start_param_prefixes; if (config->get_id() == telegram_api::jsonObject::ID) { for (auto &key_value : static_cast(config.get())->value_) { Slice key = key_value->key_; @@ -2079,6 +2019,41 @@ void ConfigManager::process_app_config(tl_object_ptr &c G()->set_option_integer("gift_sell_period", get_json_value_int(std::move(key_value->value_), key)); continue; } + if (key == "starref_start_param_prefixes") { + if (value->get_id() == telegram_api::jsonArray::ID) { + auto prefixes = std::move(static_cast(value)->value_); + for (auto &prefix : prefixes) { + auto prefix_text = get_json_value_string(std::move(prefix), key); + if (!prefix_text.empty() && prefix_text.find(' ') == string::npos) { + fragment_prefixes.push_back(prefix_text); + } else { + LOG(ERROR) << "Receive an invalid affiliate program link prefix"; + } + } + } else { + LOG(ERROR) << "Receive unexpected starref_start_param_prefixes " << to_string(*value); + } + continue; + } + if (key == "video_ignore_alt_documents") { + G()->set_option_boolean("video_ignore_alt_documents", get_json_value_bool(std::move(key_value->value_), key)); + continue; + } + if (key == "starref_min_commission_permille") { + G()->set_option_integer("affiliate_program_commission_per_mille_min", + get_json_value_int(std::move(key_value->value_), key)); + continue; + } + if (key == "starref_max_commission_permille") { + G()->set_option_integer("affiliate_program_commission_per_mille_max", + get_json_value_int(std::move(key_value->value_), key)); + continue; + } + if (key == "bot_verification_description_length_limit") { + G()->set_option_integer("bot_verification_custom_description_length_max", + get_json_value_int(std::move(key_value->value_), key)); + continue; + } new_values.push_back(std::move(key_value)); } @@ -2133,6 +2108,12 @@ void ConfigManager::process_app_config(tl_object_ptr &c options.set_option_string("fragment_prefixes", implode(fragment_prefixes, ',')); + if (starref_start_param_prefixes.empty()) { + options.set_option_empty("starref_start_param_prefixes"); + } else { + options.set_option_string("starref_start_param_prefixes", implode(starref_start_param_prefixes, ' ')); + } + options.set_option_string("emoji_sounds", implode(emoji_sounds, ',')); if (animated_emoji_zoom <= 0 || animated_emoji_zoom > 2.0) { @@ -2256,30 +2237,10 @@ void ConfigManager::process_app_config(tl_object_ptr &c G()->set_option_string("premium_manage_subscription_url", premium_manage_subscription_url); } - // do not update suggested actions while changing content settings or dismissing an action - if (!is_set_content_settings_request_sent_ && dismiss_suggested_action_request_count_ == 0) { - if (update_suggested_actions(suggested_actions_, std::move(suggested_actions))) { - save_suggested_actions(); - } - } -} - -string ConfigManager::get_suggested_actions_database_key() { - return "suggested_actions"; -} - -void ConfigManager::save_suggested_actions() { - if (suggested_actions_.empty()) { - G()->td_db()->get_binlog_pmc()->erase(get_suggested_actions_database_key()); - } else { - G()->td_db()->get_binlog_pmc()->set(get_suggested_actions_database_key(), - log_event_store(suggested_actions_).as_slice().str()); - } -} - -void ConfigManager::get_current_state(vector> &updates) const { - if (!suggested_actions_.empty()) { - updates.push_back(get_update_suggested_actions_object(suggested_actions_, {}, "get_current_state")); + // do not update suggested actions while changing content settings + if (!is_set_content_settings_request_sent_) { + send_closure(G()->suggested_action_manager(), &SuggestedActionManager::update_suggested_actions, + std::move(suggested_actions)); } } diff --git a/lib/tgchat/ext/td/td/telegram/ConfigManager.h b/lib/tgchat/ext/td/td/telegram/ConfigManager.h index 34036e19..68dae570 100644 --- a/lib/tgchat/ext/td/td/telegram/ConfigManager.h +++ b/lib/tgchat/ext/td/td/telegram/ConfigManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -9,7 +9,6 @@ #include "td/telegram/net/DcId.h" #include "td/telegram/net/DcOptions.h" #include "td/telegram/net/NetQuery.h" -#include "td/telegram/SuggestedAction.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" @@ -24,7 +23,6 @@ #include "td/utils/Time.h" #include -#include namespace td { @@ -75,17 +73,11 @@ class ConfigManager final : public NetQueryCallback { void set_content_settings(bool ignore_sensitive_content_restrictions, Promise &&promise); - void hide_suggested_action(SuggestedAction suggested_action); - - void dismiss_suggested_action(SuggestedAction suggested_action, Promise &&promise); - void on_dc_options_update(DcOptions dc_options); - void get_current_state(vector> &updates) const; - private: struct AppConfig { - static constexpr int32 CURRENT_VERSION = 61; + static constexpr int32 CURRENT_VERSION = 65; int32 version_ = 0; int32 hash_ = 0; telegram_api::object_ptr config_; @@ -118,10 +110,6 @@ class ConfigManager final : public NetQueryCallback { AppConfig app_config_; - vector suggested_actions_; - size_t dismiss_suggested_action_request_count_ = 0; - std::map>> dismiss_suggested_action_queries_; - static constexpr uint64 REFCNT_TOKEN = std::numeric_limits::max() - 2; void start_up() final; @@ -141,10 +129,6 @@ class ConfigManager final : public NetQueryCallback { void do_set_ignore_sensitive_content_restrictions(bool ignore_sensitive_content_restrictions); - static string get_suggested_actions_database_key(); - - void save_suggested_actions(); - static Timestamp load_config_expire_time(); static void save_config_expire(Timestamp timestamp); static void save_dc_options_update(const DcOptions &dc_options); diff --git a/lib/tgchat/ext/td/td/telegram/ConnectionState.cpp b/lib/tgchat/ext/td/td/telegram/ConnectionState.cpp index 5cca7943..dd968b30 100644 --- a/lib/tgchat/ext/td/td/telegram/ConnectionState.cpp +++ b/lib/tgchat/ext/td/td/telegram/ConnectionState.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ConnectionState.h b/lib/tgchat/ext/td/td/telegram/ConnectionState.h index c39749d0..8d3a7069 100644 --- a/lib/tgchat/ext/td/td/telegram/ConnectionState.h +++ b/lib/tgchat/ext/td/td/telegram/ConnectionState.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.cpp b/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.cpp index f760fb4a..edeec401 100644 --- a/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.h b/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.h index a0201539..17b9bf94 100644 --- a/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.h +++ b/lib/tgchat/ext/td/td/telegram/ConnectionStateManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Contact.cpp b/lib/tgchat/ext/td/td/telegram/Contact.cpp index 8ab83f2e..f99099c2 100644 --- a/lib/tgchat/ext/td/td/telegram/Contact.cpp +++ b/lib/tgchat/ext/td/td/telegram/Contact.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Contact.h b/lib/tgchat/ext/td/td/telegram/Contact.h index a93538e1..12ca1336 100644 --- a/lib/tgchat/ext/td/td/telegram/Contact.h +++ b/lib/tgchat/ext/td/td/telegram/Contact.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CountryInfoManager.cpp b/lib/tgchat/ext/td/td/telegram/CountryInfoManager.cpp index 06cacb7d..a784770c 100644 --- a/lib/tgchat/ext/td/td/telegram/CountryInfoManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/CountryInfoManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CountryInfoManager.h b/lib/tgchat/ext/td/td/telegram/CountryInfoManager.h index 001c898f..13d8fea7 100644 --- a/lib/tgchat/ext/td/td/telegram/CountryInfoManager.h +++ b/lib/tgchat/ext/td/td/telegram/CountryInfoManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/CustomEmojiId.h b/lib/tgchat/ext/td/td/telegram/CustomEmojiId.h index f1ead2ee..8cce0e65 100644 --- a/lib/tgchat/ext/td/td/telegram/CustomEmojiId.h +++ b/lib/tgchat/ext/td/td/telegram/CustomEmojiId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DelayDispatcher.cpp b/lib/tgchat/ext/td/td/telegram/DelayDispatcher.cpp index d5c47c08..b82a6969 100644 --- a/lib/tgchat/ext/td/td/telegram/DelayDispatcher.cpp +++ b/lib/tgchat/ext/td/td/telegram/DelayDispatcher.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DelayDispatcher.h b/lib/tgchat/ext/td/td/telegram/DelayDispatcher.h index 9b1faf99..49ca5e34 100644 --- a/lib/tgchat/ext/td/td/telegram/DelayDispatcher.h +++ b/lib/tgchat/ext/td/td/telegram/DelayDispatcher.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Dependencies.cpp b/lib/tgchat/ext/td/td/telegram/Dependencies.cpp index bbd43b05..b8a67eb5 100644 --- a/lib/tgchat/ext/td/td/telegram/Dependencies.cpp +++ b/lib/tgchat/ext/td/td/telegram/Dependencies.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Dependencies.h b/lib/tgchat/ext/td/td/telegram/Dependencies.h index 775a7acf..41115ff6 100644 --- a/lib/tgchat/ext/td/td/telegram/Dependencies.h +++ b/lib/tgchat/ext/td/td/telegram/Dependencies.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.cpp b/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.cpp index 241485dd..b9110f3f 100644 --- a/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.h b/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.h index dd553c36..f3cc2407 100644 --- a/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.h +++ b/lib/tgchat/ext/td/td/telegram/DeviceTokenManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DhCache.cpp b/lib/tgchat/ext/td/td/telegram/DhCache.cpp index 510049c6..327279b0 100644 --- a/lib/tgchat/ext/td/td/telegram/DhCache.cpp +++ b/lib/tgchat/ext/td/td/telegram/DhCache.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DhCache.h b/lib/tgchat/ext/td/td/telegram/DhCache.h index d548dfd4..de765e9c 100644 --- a/lib/tgchat/ext/td/td/telegram/DhCache.h +++ b/lib/tgchat/ext/td/td/telegram/DhCache.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DhConfig.h b/lib/tgchat/ext/td/td/telegram/DhConfig.h index 8e8e806e..b8960fe3 100644 --- a/lib/tgchat/ext/td/td/telegram/DhConfig.h +++ b/lib/tgchat/ext/td/td/telegram/DhConfig.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogAction.cpp b/lib/tgchat/ext/td/td/telegram/DialogAction.cpp index e1a0dcf1..379d2789 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogAction.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogAction.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -427,6 +427,7 @@ bool DialogAction::is_canceled_by_message_of_type(MessageContentType message_con case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; default: UNREACHABLE(); diff --git a/lib/tgchat/ext/td/td/telegram/DialogAction.h b/lib/tgchat/ext/td/td/telegram/DialogAction.h index 11c42047..26bf0c91 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogAction.h +++ b/lib/tgchat/ext/td/td/telegram/DialogAction.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogActionBar.cpp b/lib/tgchat/ext/td/td/telegram/DialogActionBar.cpp index 12f1fad5..8ef5dfde 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogActionBar.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogActionBar.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogActionBar.h b/lib/tgchat/ext/td/td/telegram/DialogActionBar.h index 2fe3ac19..dc6f71df 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogActionBar.h +++ b/lib/tgchat/ext/td/td/telegram/DialogActionBar.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogActionManager.cpp b/lib/tgchat/ext/td/td/telegram/DialogActionManager.cpp index 169b8482..c2633e18 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogActionManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogActionManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogActionManager.h b/lib/tgchat/ext/td/td/telegram/DialogActionManager.h index e67fe019..eeda0321 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogActionManager.h +++ b/lib/tgchat/ext/td/td/telegram/DialogActionManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogAdministrator.cpp b/lib/tgchat/ext/td/td/telegram/DialogAdministrator.cpp index ed044cc0..ab3141e2 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogAdministrator.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogAdministrator.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogAdministrator.h b/lib/tgchat/ext/td/td/telegram/DialogAdministrator.h index a9e0f6b4..28b827f4 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogAdministrator.h +++ b/lib/tgchat/ext/td/td/telegram/DialogAdministrator.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogBoostLinkInfo.h b/lib/tgchat/ext/td/td/telegram/DialogBoostLinkInfo.h index 2c583072..d3c4161b 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogBoostLinkInfo.h +++ b/lib/tgchat/ext/td/td/telegram/DialogBoostLinkInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogDate.h b/lib/tgchat/ext/td/td/telegram/DialogDate.h index 9f73210c..9bbc37c1 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogDate.h +++ b/lib/tgchat/ext/td/td/telegram/DialogDate.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogDb.cpp b/lib/tgchat/ext/td/td/telegram/DialogDb.cpp index 18da32b1..6a719e49 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogDb.h b/lib/tgchat/ext/td/td/telegram/DialogDb.h index 5bc7adc5..46c4cf9c 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogDb.h +++ b/lib/tgchat/ext/td/td/telegram/DialogDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogEventLog.cpp b/lib/tgchat/ext/td/td/telegram/DialogEventLog.cpp index ff3ef6f2..6bd5e868 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogEventLog.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogEventLog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogEventLog.h b/lib/tgchat/ext/td/td/telegram/DialogEventLog.h index bbe83b00..239ee492 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogEventLog.h +++ b/lib/tgchat/ext/td/td/telegram/DialogEventLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilter.cpp b/lib/tgchat/ext/td/td/telegram/DialogFilter.cpp index 33c5e0d3..efbd0ba9 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilter.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogFilter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -47,7 +47,9 @@ unique_ptr DialogFilter::get_dialog_filter( } auto dialog_filter = make_unique(); dialog_filter->dialog_filter_id_ = dialog_filter_id; - dialog_filter->title_ = std::move(filter->title_); + dialog_filter->title_ = get_formatted_text(nullptr, std::move(filter->title_), true, false, "dialogFilter"); + keep_only_custom_emoji(dialog_filter->title_); + dialog_filter->animate_title_ = !filter->title_noanimate_; dialog_filter->emoji_ = std::move(filter->emoticon_); dialog_filter->color_id_ = (filter->flags_ & telegram_api::dialogFilter::COLOR_MASK) != 0 ? filter->color_ : -1; dialog_filter->pinned_dialog_ids_ = InputDialogId::get_input_dialog_ids(filter->pinned_peers_, &added_dialog_ids); @@ -83,7 +85,10 @@ unique_ptr DialogFilter::get_dialog_filter( } auto dialog_filter = make_unique(); dialog_filter->dialog_filter_id_ = dialog_filter_id; - dialog_filter->title_ = std::move(filter->title_); + dialog_filter->title_ = + get_formatted_text(nullptr, std::move(filter->title_), true, false, "dialogFilterChatlist"); + keep_only_custom_emoji(dialog_filter->title_); + dialog_filter->animate_title_ = !filter->title_noanimate_; dialog_filter->emoji_ = std::move(filter->emoticon_); dialog_filter->color_id_ = (filter->flags_ & telegram_api::dialogFilterChatlist::COLOR_MASK) != 0 ? filter->color_ : -1; @@ -109,13 +114,25 @@ Result> DialogFilter::create_dialog_filter(Td *td, Dial if (filter == nullptr) { return Status::Error(400, "Chat folder must be non-empty"); } + if (filter->name_ == nullptr || filter->name_->text_ == nullptr) { + return Status::Error(400, "Chat folder name must be non-empty"); + } string icon_name; if (filter->icon_ != nullptr) { icon_name = std::move(filter->icon_->name_); + if (!clean_input_string(icon_name)) { + return Status::Error(400, "Strings must be encoded in UTF-8"); + } } - if (!clean_input_string(filter->title_) || !clean_input_string(icon_name)) { - return Status::Error(400, "Strings must be encoded in UTF-8"); + + TRY_RESULT(title, get_formatted_text(td, td->dialog_manager_->get_my_dialog_id(), std::move(filter->name_->text_), + false, false, true, false)); + constexpr size_t MAX_TITLE_LENGTH = 12; // server-side limit for dialog filter title + title.text = clean_name(title.text, MAX_TITLE_LENGTH); + if (title.text.empty()) { + return Status::Error(400, "Title must be non-empty"); } + keep_only_custom_emoji(title); auto dialog_filter = make_unique(); dialog_filter->dialog_filter_id_ = dialog_filter_id; @@ -135,11 +152,8 @@ Result> DialogFilter::create_dialog_filter(Td *td, Dial add_chats(dialog_filter->included_dialog_ids_, filter->included_chat_ids_); add_chats(dialog_filter->excluded_dialog_ids_, filter->excluded_chat_ids_); - constexpr size_t MAX_TITLE_LENGTH = 12; // server-side limit for dialog filter title - dialog_filter->title_ = clean_name(std::move(filter->title_), MAX_TITLE_LENGTH); - if (dialog_filter->title_.empty()) { - return Status::Error(400, "Title must be non-empty"); - } + dialog_filter->title_ = std::move(title); + dialog_filter->animate_title_ = filter->name_->animate_custom_emoji_; dialog_filter->emoji_ = get_emoji_by_icon_name(icon_name); if (dialog_filter->emoji_.empty() && !icon_name.empty()) { return Status::Error(400, "Invalid icon name specified"); @@ -433,11 +447,18 @@ telegram_api::object_ptr DialogFilter::get_input_dia if (has_my_invites_) { flags |= telegram_api::dialogFilterChatlist::HAS_MY_INVITES_MASK; } + if (!animate_title_) { + flags |= telegram_api::dialogFilterChatlist::TITLE_NOANIMATE_MASK; + } return telegram_api::make_object( - flags, false /*ignored*/, dialog_filter_id_.get(), title_, emoji_, color_id_, + flags, false /*ignored*/, false /*ignored*/, dialog_filter_id_.get(), + get_input_text_with_entities(nullptr, title_, "dialogFilterChatlist"), emoji_, color_id_, InputDialogId::get_input_peers(pinned_dialog_ids_), InputDialogId::get_input_peers(included_dialog_ids_)); } int32 flags = telegram_api::dialogFilter::EMOTICON_MASK; + if (!animate_title_) { + flags |= telegram_api::dialogFilter::TITLE_NOANIMATE_MASK; + } if (color_id_ != -1) { flags |= telegram_api::dialogFilter::COLOR_MASK; } @@ -468,7 +489,8 @@ telegram_api::object_ptr DialogFilter::get_input_dia return telegram_api::make_object( flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, - false /*ignored*/, false /*ignored*/, false /*ignored*/, dialog_filter_id_.get(), title_, emoji_, color_id_, + false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, dialog_filter_id_.get(), + get_input_text_with_entities(nullptr, title_, "dialogFilter"), emoji_, color_id_, InputDialogId::get_input_peers(pinned_dialog_ids_), InputDialogId::get_input_peers(included_dialog_ids_), InputDialogId::get_input_peers(excluded_dialog_ids_)); } @@ -492,16 +514,21 @@ td_api::object_ptr DialogFilter::get_chat_folder_object( if (!icon_name.empty()) { icon = td_api::make_object(icon_name); } + auto name = + td_api::make_object(get_formatted_text_object(nullptr, title_, true, -1), animate_title_); return td_api::make_object( - title_, std::move(icon), color_id_, is_shareable_, get_chat_ids(pinned_dialog_ids_), + std::move(name), std::move(icon), color_id_, is_shareable_, get_chat_ids(pinned_dialog_ids_), get_chat_ids(included_dialog_ids_), get_chat_ids(excluded_dialog_ids_), exclude_muted_, exclude_read_, exclude_archived_, include_contacts_, include_non_contacts_, include_bots_, include_groups_, include_channels_); } td_api::object_ptr DialogFilter::get_chat_folder_info_object() const { + auto name = + td_api::make_object(get_formatted_text_object(nullptr, title_, true, -1), animate_title_); return td_api::make_object( - dialog_filter_id_.get(), title_, td_api::make_object(get_chosen_or_default_icon_name()), - color_id_, is_shareable_, has_my_invites_); + dialog_filter_id_.get(), std::move(name), + td_api::make_object(get_chosen_or_default_icon_name()), color_id_, is_shareable_, + has_my_invites_); } void DialogFilter::for_each_dialog(std::function callback) const { @@ -671,6 +698,7 @@ unique_ptr DialogFilter::merge_dialog_filter_changes(const DialogF } update_value(new_filter->title_, old_server_filter->title_, new_server_filter->title_); + update_value(new_filter->animate_title_, old_server_filter->animate_title_, new_server_filter->animate_title_); update_value(new_filter->emoji_, old_server_filter->emoji_, new_server_filter->emoji_); update_value(new_filter->color_id_, old_server_filter->color_id_, new_server_filter->color_id_); @@ -887,8 +915,9 @@ bool DialogFilter::are_similar(const DialogFilter &lhs, const DialogFilter &rhs) } bool DialogFilter::are_equivalent(const DialogFilter &lhs, const DialogFilter &rhs) { - return lhs.title_ == rhs.title_ && lhs.emoji_ == rhs.emoji_ && lhs.color_id_ == rhs.color_id_ && - lhs.is_shareable_ == rhs.is_shareable_ && lhs.has_my_invites_ == rhs.has_my_invites_ && + return lhs.title_ == rhs.title_ && lhs.animate_title_ == rhs.animate_title_ && lhs.emoji_ == rhs.emoji_ && + lhs.color_id_ == rhs.color_id_ && lhs.is_shareable_ == rhs.is_shareable_ && + lhs.has_my_invites_ == rhs.has_my_invites_ && InputDialogId::are_equivalent(lhs.pinned_dialog_ids_, rhs.pinned_dialog_ids_) && InputDialogId::are_equivalent(lhs.included_dialog_ids_, rhs.included_dialog_ids_) && InputDialogId::are_equivalent(lhs.excluded_dialog_ids_, rhs.excluded_dialog_ids_) && are_flags_equal(lhs, rhs); diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilter.h b/lib/tgchat/ext/td/td/telegram/DialogFilter.h index f2d78c23..b2ffdaae 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilter.h +++ b/lib/tgchat/ext/td/td/telegram/DialogFilter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -11,6 +11,7 @@ #include "td/telegram/DialogId.h" #include "td/telegram/FolderId.h" #include "td/telegram/InputDialogId.h" +#include "td/telegram/MessageEntity.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" @@ -120,7 +121,7 @@ class DialogFilter { private: DialogFilterId dialog_filter_id_; - string title_; + FormattedText title_; string emoji_; vector pinned_dialog_ids_; vector included_dialog_ids_; @@ -136,6 +137,7 @@ class DialogFilter { bool include_channels_ = false; bool is_shareable_ = false; bool has_my_invites_ = false; + bool animate_title_ = false; static FlatHashMap emoji_to_icon_name_; static FlatHashMap icon_name_to_emoji_; @@ -158,7 +160,7 @@ inline bool operator==(const DialogFilter &lhs, const DialogFilter &rhs) { lhs.color_id_ == rhs.color_id_ && lhs.is_shareable_ == rhs.is_shareable_ && lhs.has_my_invites_ == rhs.has_my_invites_ && lhs.pinned_dialog_ids_ == rhs.pinned_dialog_ids_ && lhs.included_dialog_ids_ == rhs.included_dialog_ids_ && lhs.excluded_dialog_ids_ == rhs.excluded_dialog_ids_ && - DialogFilter::are_flags_equal(lhs, rhs); + DialogFilter::are_flags_equal(lhs, rhs) && lhs.animate_title_ == rhs.animate_title_; } inline bool operator!=(const DialogFilter &lhs, const DialogFilter &rhs) { diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilter.hpp b/lib/tgchat/ext/td/td/telegram/DialogFilter.hpp index b16a0b03..7f2c3fe9 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilter.hpp +++ b/lib/tgchat/ext/td/td/telegram/DialogFilter.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -20,6 +20,7 @@ void DialogFilter::store(StorerT &storer) const { bool has_included_dialog_ids = !included_dialog_ids_.empty(); bool has_excluded_dialog_ids = !excluded_dialog_ids_.empty(); bool has_color_id = color_id_ != -1; + bool has_title_entities = !title_.entities.empty(); BEGIN_STORE_FLAGS(); STORE_FLAG(exclude_muted_); STORE_FLAG(exclude_read_); @@ -35,9 +36,14 @@ void DialogFilter::store(StorerT &storer) const { STORE_FLAG(is_shareable_); STORE_FLAG(has_my_invites_); STORE_FLAG(has_color_id); + STORE_FLAG(has_title_entities); + STORE_FLAG(animate_title_); END_STORE_FLAGS(); store(dialog_filter_id_, storer); - store(title_, storer); + store(title_.text, storer); + if (has_title_entities) { + store(title_.entities, storer); + } store(emoji_, storer); if (has_pinned_dialog_ids) { store(pinned_dialog_ids_, storer); @@ -60,6 +66,7 @@ void DialogFilter::parse(ParserT &parser) { bool has_included_dialog_ids; bool has_excluded_dialog_ids; bool has_color_id; + bool has_title_entities; BEGIN_PARSE_FLAGS(); PARSE_FLAG(exclude_muted_); PARSE_FLAG(exclude_read_); @@ -75,9 +82,15 @@ void DialogFilter::parse(ParserT &parser) { PARSE_FLAG(is_shareable_); PARSE_FLAG(has_my_invites_); PARSE_FLAG(has_color_id); + PARSE_FLAG(has_title_entities); + PARSE_FLAG(animate_title_); END_PARSE_FLAGS(); parse(dialog_filter_id_, parser); - parse(title_, parser); + parse(title_.text, parser); + if (has_title_entities) { + parse(title_.entities, parser); + keep_only_custom_emoji(title_); + } parse(emoji_, parser); if (has_pinned_dialog_ids) { parse(pinned_dialog_ids_, parser); diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilterDialogInfo.h b/lib/tgchat/ext/td/td/telegram/DialogFilterDialogInfo.h index acb02450..c68c12b7 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilterDialogInfo.h +++ b/lib/tgchat/ext/td/td/telegram/DialogFilterDialogInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilterId.h b/lib/tgchat/ext/td/td/telegram/DialogFilterId.h index e8489fc9..ef782f4f 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilterId.h +++ b/lib/tgchat/ext/td/td/telegram/DialogFilterId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.cpp b/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.cpp index 03fb6416..1e65db49 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.h b/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.h index 36688e8c..74f36853 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.h +++ b/lib/tgchat/ext/td/td/telegram/DialogFilterInviteLink.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilterManager.cpp b/lib/tgchat/ext/td/td/telegram/DialogFilterManager.cpp index 21105bb5..4675df7b 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilterManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogFilterManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,6 +17,8 @@ #include "td/telegram/Global.h" #include "td/telegram/LinkManager.h" #include "td/telegram/logevent/LogEvent.h" +#include "td/telegram/MessageEntity.h" +#include "td/telegram/MessageEntity.hpp" #include "td/telegram/MessagesManager.h" #include "td/telegram/OptionManager.h" #include "td/telegram/Td.h" @@ -2116,8 +2118,13 @@ void DialogFilterManager::on_get_chatlist_invite( if (icon_name.empty()) { icon_name = "Custom"; } + + auto title = get_formatted_text(nullptr, std::move(invite->title_), true, false, "chatlistInvite"); + keep_only_custom_emoji(title); + auto name = td_api::make_object(get_formatted_text_object(nullptr, title, true, -1), + !invite->title_noanimate_); info = td_api::make_object( - 0, invite->title_, td_api::make_object(icon_name), -1, true, false); + 0, std::move(name), td_api::make_object(icon_name), -1, true, false); missing_peers = std::move(invite->peers_); chats = std::move(invite->chats_); users = std::move(invite->users_); diff --git a/lib/tgchat/ext/td/td/telegram/DialogFilterManager.h b/lib/tgchat/ext/td/td/telegram/DialogFilterManager.h index 956fccf4..c8383c62 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogFilterManager.h +++ b/lib/tgchat/ext/td/td/telegram/DialogFilterManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogId.cpp b/lib/tgchat/ext/td/td/telegram/DialogId.cpp index e32aaffa..95f192b6 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogId.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogId.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogId.h b/lib/tgchat/ext/td/td/telegram/DialogId.h index 9244fb8f..7ab51254 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogId.h +++ b/lib/tgchat/ext/td/td/telegram/DialogId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogInviteLink.cpp b/lib/tgchat/ext/td/td/telegram/DialogInviteLink.cpp index a0aa2833..4e681c85 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogInviteLink.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogInviteLink.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogInviteLink.h b/lib/tgchat/ext/td/td/telegram/DialogInviteLink.h index 6c2345c8..ef9f4766 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogInviteLink.h +++ b/lib/tgchat/ext/td/td/telegram/DialogInviteLink.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogInviteLink.hpp b/lib/tgchat/ext/td/td/telegram/DialogInviteLink.hpp index 2d8cccae..ca34022b 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogInviteLink.hpp +++ b/lib/tgchat/ext/td/td/telegram/DialogInviteLink.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.cpp b/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.cpp index 3b8413e0..60805529 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -20,6 +20,7 @@ #include "td/telegram/ThemeManager.h" #include "td/telegram/UpdatesManager.h" #include "td/telegram/UserManager.h" +#include "td/telegram/VerificationStatus.h" #include "td/utils/buffer.h" #include "td/utils/logging.h" @@ -765,6 +766,9 @@ void DialogInviteLinkManager::on_get_dialog_invite_link_info( invite_link_info->is_verified = chat_invite->verified_; invite_link_info->is_scam = chat_invite->scam_; invite_link_info->is_fake = chat_invite->fake_; + invite_link_info->bot_verification_icon = chat_invite->bot_verification_ == nullptr + ? CustomEmojiId() + : CustomEmojiId(chat_invite->bot_verification_->icon_); break; } default: @@ -802,9 +806,7 @@ td_api::object_ptr DialogInviteLinkManager::get_chat bool creates_join_request = false; bool is_public = false; bool is_member = false; - bool is_verified = false; - bool is_scam = false; - bool is_fake = false; + td_api::object_ptr verification_status; if (dialog_id.is_valid()) { switch (dialog_id.get_type()) { @@ -827,9 +829,7 @@ td_api::object_ptr DialogInviteLinkManager::get_chat is_megagroup = td_->chat_manager_->is_megagroup_channel(channel_id); participant_count = td_->chat_manager_->get_channel_participant_count(channel_id); is_member = td_->chat_manager_->get_channel_status(channel_id).is_member(); - is_verified = td_->chat_manager_->get_channel_is_verified(channel_id); - is_scam = td_->chat_manager_->get_channel_is_scam(channel_id); - is_fake = td_->chat_manager_->get_channel_is_fake(channel_id); + verification_status = td_->chat_manager_->get_channel_verification_status_object(channel_id); accent_color_id_object = td_->chat_manager_->get_channel_accent_color_id_object(channel_id); break; } @@ -856,9 +856,9 @@ td_api::object_ptr DialogInviteLinkManager::get_chat } creates_join_request = invite_link_info->creates_join_request; is_public = invite_link_info->is_public; - is_verified = invite_link_info->is_verified; - is_scam = invite_link_info->is_scam; - is_fake = invite_link_info->is_fake; + verification_status = + get_verification_status_object(td_, invite_link_info->is_verified, invite_link_info->is_scam, + invite_link_info->is_fake, invite_link_info->bot_verification_icon); } td_api::object_ptr chat_type; @@ -882,7 +882,7 @@ td_api::object_ptr DialogInviteLinkManager::get_chat td_->dialog_manager_->get_chat_id_object(dialog_id, "chatInviteLinkInfo"), accessible_for, std::move(chat_type), title, get_chat_photo_info_object(td_->file_manager_.get(), photo), accent_color_id_object, description, participant_count, std::move(member_user_ids), std::move(subscription_info), creates_join_request, is_public, - is_verified, is_scam, is_fake); + std::move(verification_status)); } void DialogInviteLinkManager::add_dialog_access_by_invite_link(DialogId dialog_id, const string &invite_link, diff --git a/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.h b/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.h index 5f003b85..cfddc571 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.h +++ b/lib/tgchat/ext/td/td/telegram/DialogInviteLinkManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,6 +7,7 @@ #pragma once #include "td/telegram/AccentColorId.h" +#include "td/telegram/CustomEmojiId.h" #include "td/telegram/DialogId.h" #include "td/telegram/Photo.h" #include "td/telegram/StarSubscriptionPricing.h" @@ -117,6 +118,7 @@ class DialogInviteLinkManager final : public Actor { string description; StarSubscriptionPricing subscription_pricing; int64 subscription_form_id; + CustomEmojiId bot_verification_icon; bool creates_join_request = false; bool can_refulfill_subscription = false; bool is_chat = false; diff --git a/lib/tgchat/ext/td/td/telegram/DialogListId.h b/lib/tgchat/ext/td/td/telegram/DialogListId.h index 5b909ae3..9123f7e5 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogListId.h +++ b/lib/tgchat/ext/td/td/telegram/DialogListId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogLocation.cpp b/lib/tgchat/ext/td/td/telegram/DialogLocation.cpp index c12df81b..0b431216 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogLocation.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogLocation.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogLocation.h b/lib/tgchat/ext/td/td/telegram/DialogLocation.h index 3c84ec3d..bc733d66 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogLocation.h +++ b/lib/tgchat/ext/td/td/telegram/DialogLocation.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogManager.cpp b/lib/tgchat/ext/td/td/telegram/DialogManager.cpp index 20e5cb6e..338c922a 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,6 +7,7 @@ #include "td/telegram/DialogManager.h" #include "td/telegram/AuthManager.h" +#include "td/telegram/BlockListId.h" #include "td/telegram/BotCommand.h" #include "td/telegram/ChannelId.h" #include "td/telegram/ChannelType.h" @@ -15,7 +16,12 @@ #include "td/telegram/FileReferenceManager.h" #include "td/telegram/files/FileManager.h" #include "td/telegram/files/FileType.h" +#include "td/telegram/FolderId.h" #include "td/telegram/Global.h" +#include "td/telegram/logevent/LogEvent.h" +#include "td/telegram/logevent/LogEventHelper.h" +#include "td/telegram/MessageContentType.h" +#include "td/telegram/MessageSender.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/misc.h" #include "td/telegram/OptionManager.h" @@ -24,18 +30,23 @@ #include "td/telegram/SecretChatsManager.h" #include "td/telegram/StickerPhotoSize.h" #include "td/telegram/Td.h" +#include "td/telegram/TdDb.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UpdatesManager.h" #include "td/telegram/UserId.h" #include "td/telegram/UserManager.h" #include "td/telegram/Usernames.h" +#include "td/db/binlog/BinlogEvent.h" +#include "td/db/binlog/BinlogHelper.h" + #include "td/utils/algorithm.h" #include "td/utils/buffer.h" #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/Slice.h" #include "td/utils/Time.h" +#include "td/utils/tl_helpers.h" #include @@ -113,7 +124,7 @@ class ResolveUsernameQuery final : public Td::ResultHandler { } void send(const string &username) { - send_query(G()->net_query_creator().create(telegram_api::contacts_resolveUsername(username))); + send_query(G()->net_query_creator().create(telegram_api::contacts_resolveUsername(0, username, string()))); } void on_result(BufferSlice packet) final { @@ -135,38 +146,6 @@ class ResolveUsernameQuery final : public Td::ResultHandler { } }; -class DismissSuggestionQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - - public: - explicit DismissSuggestionQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(SuggestedAction action) { - dialog_id_ = action.dialog_id_; - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id_, AccessRights::Read); - CHECK(input_peer != nullptr); - - send_query(G()->net_query_creator().create( - telegram_api::help_dismissSuggestion(std::move(input_peer), action.get_suggested_action_str()))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "DismissSuggestionQuery"); - promise_.set_error(std::move(status)); - } -}; - class MigrateChatQuery final : public Td::ResultHandler { Promise promise_; @@ -538,6 +517,433 @@ class ReportProfilePhotoQuery final : public Td::ResultHandler { } }; +class GetPeerSettingsQuery final : public Td::ResultHandler { + DialogId dialog_id_; + + public: + void send(DialogId dialog_id) { + dialog_id_ = dialog_id; + + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); + CHECK(input_peer != nullptr); + + send_query(G()->net_query_creator().create(telegram_api::messages_getPeerSettings(std::move(input_peer)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + td_->user_manager_->on_get_users(std::move(ptr->users_), "GetPeerSettingsQuery"); + td_->chat_manager_->on_get_chats(std::move(ptr->chats_), "GetPeerSettingsQuery"); + td_->messages_manager_->on_get_peer_settings(dialog_id_, std::move(ptr->settings_)); + } + + void on_error(Status status) final { + LOG(INFO) << "Receive error for get peer settings: " << status; + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "GetPeerSettingsQuery"); + } +}; + +class UpdatePeerSettingsQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + + public: + explicit UpdatePeerSettingsQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, bool is_spam_dialog) { + dialog_id_ = dialog_id; + + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); + if (input_peer == nullptr) { + return promise_.set_value(Unit()); + } + + if (is_spam_dialog) { + send_query(G()->net_query_creator().create(telegram_api::messages_reportSpam(std::move(input_peer)))); + } else { + send_query(G()->net_query_creator().create(telegram_api::messages_hidePeerSettingsBar(std::move(input_peer)))); + } + } + + void on_result(BufferSlice packet) final { + static_assert(std::is_same::value, + ""); + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + td_->messages_manager_->on_get_peer_settings(dialog_id_, telegram_api::make_object(), + true); + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + LOG(INFO) << "Receive error for update peer settings: " << status; + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "UpdatePeerSettingsQuery"); + td_->messages_manager_->reget_dialog_action_bar(dialog_id_, "UpdatePeerSettingsQuery"); + promise_.set_error(std::move(status)); + } +}; + +class ReportEncryptedSpamQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + + public: + explicit ReportEncryptedSpamQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id) { + dialog_id_ = dialog_id; + + auto input_peer = td_->dialog_manager_->get_input_encrypted_chat(dialog_id, AccessRights::Read); + CHECK(input_peer != nullptr); + + send_query(G()->net_query_creator().create(telegram_api::messages_reportEncryptedSpam(std::move(input_peer)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + td_->messages_manager_->on_get_peer_settings(dialog_id_, telegram_api::make_object(), + true); + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + LOG(INFO) << "Receive error for report encrypted spam: " << status; + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ReportEncryptedSpamQuery"); + td_->messages_manager_->reget_dialog_action_bar( + DialogId(td_->user_manager_->get_secret_chat_user_id(dialog_id_.get_secret_chat_id())), + "ReportEncryptedSpamQuery"); + promise_.set_error(std::move(status)); + } +}; + +class GetBlockedDialogsQuery final : public Td::ResultHandler { + Promise> promise_; + int32 offset_; + int32 limit_; + + public: + explicit GetBlockedDialogsQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(BlockListId block_list_id, int32 offset, int32 limit) { + offset_ = offset; + limit_ = limit; + + int32 flags = 0; + if (block_list_id == BlockListId::stories()) { + flags |= telegram_api::contacts_getBlocked::MY_STORIES_FROM_MASK; + } + + send_query( + G()->net_query_creator().create(telegram_api::contacts_getBlocked(flags, false /*ignored*/, offset, limit))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for GetBlockedDialogsQuery: " << to_string(ptr); + + switch (ptr->get_id()) { + case telegram_api::contacts_blocked::ID: { + auto blocked_peers = move_tl_object_as(ptr); + + td_->user_manager_->on_get_users(std::move(blocked_peers->users_), "GetBlockedDialogsQuery"); + td_->chat_manager_->on_get_chats(std::move(blocked_peers->chats_), "GetBlockedDialogsQuery"); + td_->dialog_manager_->on_get_blocked_dialogs(offset_, limit_, + narrow_cast(blocked_peers->blocked_.size()), + std::move(blocked_peers->blocked_), std::move(promise_)); + break; + } + case telegram_api::contacts_blockedSlice::ID: { + auto blocked_peers = move_tl_object_as(ptr); + + td_->user_manager_->on_get_users(std::move(blocked_peers->users_), "GetBlockedDialogsQuery slice"); + td_->chat_manager_->on_get_chats(std::move(blocked_peers->chats_), "GetBlockedDialogsQuery slice"); + td_->dialog_manager_->on_get_blocked_dialogs(offset_, limit_, blocked_peers->count_, + std::move(blocked_peers->blocked_), std::move(promise_)); + break; + } + default: + UNREACHABLE(); + } + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +class ToggleDialogIsBlockedQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + + public: + explicit ToggleDialogIsBlockedQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, bool is_blocked, bool is_blocked_for_stories) { + dialog_id_ = dialog_id; + + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Know); + CHECK(input_peer != nullptr && input_peer->get_id() != telegram_api::inputPeerEmpty::ID); + + int32 flags = 0; + if (is_blocked_for_stories) { + flags |= telegram_api::contacts_block::MY_STORIES_FROM_MASK; + } + vector chain_ids{{dialog_id, MessageContentType::Photo}, {dialog_id, MessageContentType::Text}}; + auto query = + is_blocked || is_blocked_for_stories + ? G()->net_query_creator().create( + telegram_api::contacts_block(flags, false /*ignored*/, std::move(input_peer)), std::move(chain_ids)) + : G()->net_query_creator().create( + telegram_api::contacts_unblock(flags, false /*ignored*/, std::move(input_peer)), + std::move(chain_ids)); + send_query(std::move(query)); + } + + void on_result(BufferSlice packet) final { + static_assert( + std::is_same::value, ""); + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + bool result = result_ptr.ok(); + LOG_IF(WARNING, !result) << "Block/Unblock " << dialog_id_ << " has failed"; + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogIsBlockedQuery")) { + LOG(ERROR) << "Receive error for ToggleDialogIsBlockedQuery: " << status; + } + if (!G()->close_flag()) { + td_->dialog_manager_->get_dialog_info_full(dialog_id_, Auto(), "ToggleDialogIsBlockedQuery"); + td_->messages_manager_->reget_dialog_action_bar(dialog_id_, "ToggleDialogIsBlockedQuery"); + } + promise_.set_error(std::move(status)); + } +}; + +class ToggleDialogUnreadMarkQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + bool is_marked_as_unread_; + + public: + explicit ToggleDialogUnreadMarkQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, bool is_marked_as_unread) { + dialog_id_ = dialog_id; + is_marked_as_unread_ = is_marked_as_unread; + + auto input_peer = td_->dialog_manager_->get_input_dialog_peer(dialog_id, AccessRights::Read); + if (input_peer == nullptr) { + return on_error(Status::Error(400, "Can't access the chat")); + } + + int32 flags = 0; + if (is_marked_as_unread) { + flags |= telegram_api::messages_markDialogUnread::UNREAD_MASK; + } + send_query(G()->net_query_creator().create( + telegram_api::messages_markDialogUnread(flags, false /*ignored*/, std::move(input_peer)), {{dialog_id}})); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + bool result = result_ptr.ok(); + if (!result) { + return on_error(Status::Error(400, "Toggle dialog mark failed")); + } + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogUnreadMarkQuery")) { + LOG(ERROR) << "Receive error for ToggleDialogUnreadMarkQuery: " << status; + } + if (!G()->close_flag()) { + td_->messages_manager_->on_update_dialog_is_marked_as_unread(dialog_id_, !is_marked_as_unread_); + } + promise_.set_error(std::move(status)); + } +}; + +class ToggleDialogPinQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + bool is_pinned_; + + public: + explicit ToggleDialogPinQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, bool is_pinned) { + dialog_id_ = dialog_id; + is_pinned_ = is_pinned; + + auto input_peer = td_->dialog_manager_->get_input_dialog_peer(dialog_id, AccessRights::Read); + if (input_peer == nullptr) { + return on_error(Status::Error(400, "Can't access the chat")); + } + + int32 flags = 0; + if (is_pinned) { + flags |= telegram_api::messages_toggleDialogPin::PINNED_MASK; + } + send_query(G()->net_query_creator().create( + telegram_api::messages_toggleDialogPin(flags, false /*ignored*/, std::move(input_peer)), {{dialog_id}})); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + bool result = result_ptr.ok(); + if (!result) { + return on_error(Status::Error(400, "Toggle dialog pin failed")); + } + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogPinQuery")) { + LOG(ERROR) << "Receive error for ToggleDialogPinQuery: " << status; + } + td_->messages_manager_->on_update_pinned_dialogs(FolderId::main()); + td_->messages_manager_->on_update_pinned_dialogs(FolderId::archive()); + promise_.set_error(std::move(status)); + } +}; + +class ToggleDialogTranslationsQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + bool is_translatable_; + + public: + explicit ToggleDialogTranslationsQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, bool is_translatable) { + dialog_id_ = dialog_id; + is_translatable_ = is_translatable; + + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); + if (input_peer == nullptr) { + return on_error(Status::Error(400, "Can't access the chat")); + } + + int32 flags = 0; + if (!is_translatable) { + flags |= telegram_api::messages_togglePeerTranslations::DISABLED_MASK; + } + send_query(G()->net_query_creator().create( + telegram_api::messages_togglePeerTranslations(flags, false /*ignored*/, std::move(input_peer)), {{dialog_id}})); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + bool result = result_ptr.ok(); + if (!result) { + return on_error(Status::Error(400, "Toggle dialog translations failed")); + } + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogTranslationsQuery")) { + LOG(ERROR) << "Receive error for ToggleDialogTranslationsQuery: " << status; + } + if (!G()->close_flag()) { + td_->messages_manager_->on_update_dialog_is_translatable(dialog_id_, !is_translatable_); + } + promise_.set_error(std::move(status)); + } +}; + +class ToggleViewForumAsMessagesQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + bool view_as_messages_; + + public: + explicit ToggleViewForumAsMessagesQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, bool view_as_messages) { + dialog_id_ = dialog_id; + view_as_messages_ = view_as_messages; + + CHECK(dialog_id.get_type() == DialogType::Channel); + auto input_channel = td_->chat_manager_->get_input_channel(dialog_id.get_channel_id()); + CHECK(input_channel != nullptr); + send_query(G()->net_query_creator().create( + telegram_api::channels_toggleViewForumAsMessages(std::move(input_channel), view_as_messages), {{dialog_id}})); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for ToggleViewForumAsMessagesQuery: " << to_string(ptr); + td_->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_)); + } + + void on_error(Status status) final { + if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleViewForumAsMessagesQuery")) { + LOG(ERROR) << "Receive error for ToggleViewForumAsMessagesQuery: " << status; + } + if (!G()->close_flag()) { + td_->messages_manager_->on_update_dialog_view_as_messages(dialog_id_, !view_as_messages_); + } + promise_.set_error(std::move(status)); + } +}; + class DialogManager::UploadDialogPhotoCallback final : public FileManager::UploadCallback { public: void on_upload_ok(FileUploadId file_upload_id, telegram_api::object_ptr input_file) final { @@ -2266,85 +2672,385 @@ void DialogManager::drop_username(const string &username) { } } -void DialogManager::set_dialog_pending_suggestions(DialogId dialog_id, vector &&pending_suggestions) { - if (dismiss_suggested_action_queries_.count(dialog_id) != 0) { +void DialogManager::reget_peer_settings(DialogId dialog_id) { + if (!have_input_peer(dialog_id, false, AccessRights::Read)) { return; } - auto it = dialog_suggested_actions_.find(dialog_id); - if (it == dialog_suggested_actions_.end() && !pending_suggestions.empty()) { - return; + + td_->create_handler()->send(dialog_id); +} + +class DialogManager::ToggleDialogReportSpamStateOnServerLogEvent { + public: + DialogId dialog_id_; + bool is_spam_dialog_; + + template + void store(StorerT &storer) const { + td::store(dialog_id_, storer); + td::store(is_spam_dialog_, storer); + } + + template + void parse(ParserT &parser) { + td::parse(dialog_id_, parser); + td::parse(is_spam_dialog_, parser); + } +}; + +uint64 DialogManager::save_toggle_dialog_report_spam_state_on_server_log_event(DialogId dialog_id, + bool is_spam_dialog) { + ToggleDialogReportSpamStateOnServerLogEvent log_event{dialog_id, is_spam_dialog}; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer, + get_log_event_storer(log_event)); +} + +void DialogManager::toggle_dialog_report_spam_state_on_server(DialogId dialog_id, bool is_spam_dialog, + uint64 log_event_id, Promise &&promise) { + if (log_event_id == 0 && G()->use_message_database()) { + log_event_id = save_toggle_dialog_report_spam_state_on_server_log_event(dialog_id, is_spam_dialog); } - vector suggested_actions; - for (auto &action_str : pending_suggestions) { - SuggestedAction suggested_action(action_str, dialog_id); - if (!suggested_action.is_empty()) { - if (suggested_action == SuggestedAction{SuggestedAction::Type::ConvertToGigagroup, dialog_id} && - (dialog_id.get_type() != DialogType::Channel || - !td_->chat_manager_->can_convert_channel_to_gigagroup(dialog_id.get_channel_id()))) { - LOG(INFO) << "Skip ConvertToGigagroup suggested action"; + + auto new_promise = get_erase_log_event_promise(log_event_id, std::move(promise)); + promise = std::move(new_promise); // to prevent self-move + + switch (dialog_id.get_type()) { + case DialogType::User: + case DialogType::Chat: + case DialogType::Channel: + return td_->create_handler(std::move(promise))->send(dialog_id, is_spam_dialog); + case DialogType::SecretChat: + if (is_spam_dialog) { + return td_->create_handler(std::move(promise))->send(dialog_id); } else { - suggested_actions.push_back(suggested_action); + auto user_id = td_->user_manager_->get_secret_chat_user_id(dialog_id.get_secret_chat_id()); + if (!user_id.is_valid()) { + return promise.set_error(Status::Error(400, "Peer user not found")); + } + return td_->create_handler(std::move(promise))->send(DialogId(user_id), false); } - } + case DialogType::None: + default: + UNREACHABLE(); + return; } - if (it == dialog_suggested_actions_.end()) { - it = dialog_suggested_actions_.emplace(dialog_id, vector()).first; +} + +void DialogManager::get_blocked_dialogs(const td_api::object_ptr &block_list, int32 offset, + int32 limit, Promise> &&promise) { + if (offset < 0) { + return promise.set_error(Status::Error(400, "Parameter offset must be non-negative")); + } + + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Parameter limit must be positive")); + } + + auto block_list_id = BlockListId(block_list); + if (!block_list_id.is_valid()) { + return promise.set_error(Status::Error(400, "Block list must be non-empty")); + } + + td_->create_handler(std::move(promise))->send(block_list_id, offset, limit); +} + +void DialogManager::on_get_blocked_dialogs(int32 offset, int32 limit, int32 total_count, + vector> &&blocked_peers, + Promise> &&promise) { + LOG(INFO) << "Receive " << blocked_peers.size() << " blocked chats from offset " << offset << " out of " + << total_count; + auto peers = + transform(std::move(blocked_peers), [](telegram_api::object_ptr &&blocked_peer) { + return std::move(blocked_peer->peer_id_); + }); + auto dialog_ids = get_message_sender_dialog_ids(td_, std::move(peers)); + if (!dialog_ids.empty() && offset + dialog_ids.size() > static_cast(total_count)) { + LOG(ERROR) << "Fix total count of blocked chats from " << total_count << " to " << offset + dialog_ids.size(); + total_count = offset + narrow_cast(dialog_ids.size()); + } + + auto senders = transform(dialog_ids, [td = td_](DialogId dialog_id) { + return get_message_sender_object(td, dialog_id, "on_get_blocked_dialogs"); + }); + promise.set_value(td_api::make_object(total_count, std::move(senders))); +} + +class DialogManager::ToggleDialogIsBlockedOnServerLogEvent { + public: + DialogId dialog_id_; + bool is_blocked_; + bool is_blocked_for_stories_; + + template + void store(StorerT &storer) const { + BEGIN_STORE_FLAGS(); + STORE_FLAG(is_blocked_); + STORE_FLAG(is_blocked_for_stories_); + END_STORE_FLAGS(); + + td::store(dialog_id_, storer); + } + + template + void parse(ParserT &parser) { + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(is_blocked_); + PARSE_FLAG(is_blocked_for_stories_); + END_PARSE_FLAGS(); + + td::parse(dialog_id_, parser); + } +}; + +uint64 DialogManager::save_toggle_dialog_is_blocked_on_server_log_event(DialogId dialog_id, bool is_blocked, + bool is_blocked_for_stories) { + ToggleDialogIsBlockedOnServerLogEvent log_event{dialog_id, is_blocked, is_blocked_for_stories}; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsBlockedOnServer, + get_log_event_storer(log_event)); +} + +void DialogManager::toggle_dialog_is_blocked_on_server(DialogId dialog_id, bool is_blocked, bool is_blocked_for_stories, + uint64 log_event_id) { + if (log_event_id == 0 && G()->use_message_database()) { + log_event_id = save_toggle_dialog_is_blocked_on_server_log_event(dialog_id, is_blocked, is_blocked_for_stories); + } + + td_->create_handler(get_erase_log_event_promise(log_event_id)) + ->send(dialog_id, is_blocked, is_blocked_for_stories); +} + +class DialogManager::ToggleDialogPropertyOnServerLogEvent { + public: + DialogId dialog_id_; + bool value_; + + template + void store(StorerT &storer) const { + BEGIN_STORE_FLAGS(); + STORE_FLAG(value_); + END_STORE_FLAGS(); + + td::store(dialog_id_, storer); } - update_suggested_actions(it->second, std::move(suggested_actions)); - if (it->second.empty()) { - dialog_suggested_actions_.erase(it); + + template + void parse(ParserT &parser) { + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(value_); + END_PARSE_FLAGS(); + + td::parse(dialog_id_, parser); } +}; + +uint64 DialogManager::save_toggle_dialog_is_marked_as_unread_on_server_log_event(DialogId dialog_id, + bool is_marked_as_unread) { + ToggleDialogPropertyOnServerLogEvent log_event{dialog_id, is_marked_as_unread}; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer, + get_log_event_storer(log_event)); } -void DialogManager::remove_dialog_suggested_action(SuggestedAction action) { - auto it = dialog_suggested_actions_.find(action.dialog_id_); - if (it == dialog_suggested_actions_.end()) { +void DialogManager::toggle_dialog_is_marked_as_unread_on_server(DialogId dialog_id, bool is_marked_as_unread, + uint64 log_event_id) { + if (log_event_id == 0 && dialog_id.get_type() == DialogType::SecretChat) { + // don't even create new binlog events return; } - remove_suggested_action(it->second, action); - if (it->second.empty()) { - dialog_suggested_actions_.erase(it); + + if (log_event_id == 0 && G()->use_message_database()) { + log_event_id = save_toggle_dialog_is_marked_as_unread_on_server_log_event(dialog_id, is_marked_as_unread); } + + td_->create_handler(get_erase_log_event_promise(log_event_id)) + ->send(dialog_id, is_marked_as_unread); } -void DialogManager::dismiss_dialog_suggested_action(SuggestedAction action, Promise &&promise) { - auto dialog_id = action.dialog_id_; - TRY_STATUS_PROMISE(promise, - check_dialog_access(dialog_id, false, AccessRights::Read, "dismiss_dialog_suggested_action")); +uint64 DialogManager::save_toggle_dialog_is_pinned_on_server_log_event(DialogId dialog_id, bool is_pinned) { + ToggleDialogPropertyOnServerLogEvent log_event{dialog_id, is_pinned}; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsPinnedOnServer, + get_log_event_storer(log_event)); +} - auto it = dialog_suggested_actions_.find(dialog_id); - if (it == dialog_suggested_actions_.end() || !td::contains(it->second, action)) { - return promise.set_value(Unit()); +void DialogManager::toggle_dialog_is_pinned_on_server(DialogId dialog_id, bool is_pinned, uint64 log_event_id) { + CHECK(!td_->auth_manager_->is_bot()); + if (log_event_id == 0 && dialog_id.get_type() == DialogType::SecretChat) { + // don't even create new binlog events + return; } - auto action_str = action.get_suggested_action_str(); - if (action_str.empty()) { - return promise.set_value(Unit()); + if (log_event_id == 0 && G()->use_message_database()) { + log_event_id = save_toggle_dialog_is_pinned_on_server_log_event(dialog_id, is_pinned); } - auto &queries = dismiss_suggested_action_queries_[dialog_id]; - queries.push_back(std::move(promise)); - if (queries.size() == 1) { - auto query_promise = PromiseCreator::lambda([actor_id = actor_id(this), action](Result &&result) { - send_closure(actor_id, &DialogManager::on_dismiss_suggested_action, action, std::move(result)); - }); - td_->create_handler(std::move(query_promise))->send(std::move(action)); + td_->create_handler(get_erase_log_event_promise(log_event_id))->send(dialog_id, is_pinned); +} + +uint64 DialogManager::save_toggle_dialog_is_translatable_on_server_log_event(DialogId dialog_id, bool is_translatable) { + ToggleDialogPropertyOnServerLogEvent log_event{dialog_id, is_translatable}; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsTranslatableOnServer, + get_log_event_storer(log_event)); +} + +void DialogManager::toggle_dialog_is_translatable_on_server(DialogId dialog_id, bool is_translatable, + uint64 log_event_id) { + if (log_event_id == 0 && dialog_id.get_type() == DialogType::SecretChat) { + // don't even create new binlog events + return; + } + + if (log_event_id == 0 && G()->use_message_database()) { + log_event_id = save_toggle_dialog_is_translatable_on_server_log_event(dialog_id, is_translatable); } + + td_->create_handler(get_erase_log_event_promise(log_event_id)) + ->send(dialog_id, is_translatable); } -void DialogManager::on_dismiss_suggested_action(SuggestedAction action, Result &&result) { - auto it = dismiss_suggested_action_queries_.find(action.dialog_id_); - CHECK(it != dismiss_suggested_action_queries_.end()); - auto promises = std::move(it->second); - dismiss_suggested_action_queries_.erase(it); +uint64 DialogManager::save_toggle_dialog_view_as_messages_on_server_log_event(DialogId dialog_id, + bool view_as_messages) { + ToggleDialogPropertyOnServerLogEvent log_event{dialog_id, view_as_messages}; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogViewAsMessagesOnServer, + get_log_event_storer(log_event)); +} - if (result.is_error()) { - return fail_promises(promises, result.move_as_error()); +void DialogManager::toggle_dialog_view_as_messages_on_server(DialogId dialog_id, bool view_as_messages, + uint64 log_event_id) { + if (log_event_id == 0 && G()->use_message_database()) { + log_event_id = save_toggle_dialog_view_as_messages_on_server_log_event(dialog_id, view_as_messages); } - remove_dialog_suggested_action(action); + td_->create_handler(get_erase_log_event_promise(log_event_id)) + ->send(dialog_id, view_as_messages); +} - set_promises(promises); +void DialogManager::on_binlog_events(vector &&events) { + if (G()->close_flag()) { + return; + } + bool have_old_message_database = G()->use_message_database() && !G()->td_db()->was_dialog_db_created(); + for (auto &event : events) { + CHECK(event.id_ != 0); + switch (event.type_) { + case LogEvent::HandlerType::ToggleDialogIsBlockedOnServer: { + if (!have_old_message_database) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + ToggleDialogIsBlockedOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + auto dialog_id = log_event.dialog_id_; + if (dialog_id.get_type() == DialogType::SecretChat || + !have_dialog_info_force(dialog_id, "ToggleDialogIsBlockedOnServer") || + !have_input_peer(dialog_id, true, AccessRights::Know)) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + toggle_dialog_is_blocked_on_server(dialog_id, log_event.is_blocked_, log_event.is_blocked_for_stories_, + event.id_); + break; + } + case LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer: { + if (!have_old_message_database) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + ToggleDialogPropertyOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + auto dialog_id = log_event.dialog_id_; + if (!have_dialog_force(dialog_id, "ToggleDialogIsMarkedAsUnreadOnServer") || + !have_input_peer(dialog_id, true, AccessRights::Read)) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + toggle_dialog_is_marked_as_unread_on_server(dialog_id, log_event.value_, event.id_); + break; + } + case LogEvent::HandlerType::ToggleDialogIsPinnedOnServer: { + if (!have_old_message_database) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + ToggleDialogPropertyOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + auto dialog_id = log_event.dialog_id_; + if (!have_dialog_force(dialog_id, "ToggleDialogIsPinnedOnServer") || + !have_input_peer(dialog_id, true, AccessRights::Read)) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + toggle_dialog_is_pinned_on_server(dialog_id, log_event.value_, event.id_); + break; + } + case LogEvent::HandlerType::ToggleDialogIsTranslatableOnServer: { + if (!have_old_message_database) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + ToggleDialogPropertyOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + auto dialog_id = log_event.dialog_id_; + if (!have_dialog_force(dialog_id, "ToggleDialogIsTranslatableOnServer") || + !have_input_peer(dialog_id, true, AccessRights::Read)) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + toggle_dialog_is_translatable_on_server(dialog_id, log_event.value_, event.id_); + break; + } + case LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer: { + if (!have_old_message_database) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + ToggleDialogReportSpamStateOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + auto dialog_id = log_event.dialog_id_; + if (!have_dialog_force(dialog_id, "ToggleDialogReportSpamStateOnServer") || + !have_input_peer(dialog_id, true, AccessRights::Read)) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + toggle_dialog_report_spam_state_on_server(dialog_id, log_event.is_spam_dialog_, event.id_, Promise()); + break; + } + case LogEvent::HandlerType::ToggleDialogViewAsMessagesOnServer: { + if (!have_old_message_database) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + ToggleDialogPropertyOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + auto dialog_id = log_event.dialog_id_; + if (!have_dialog_force(dialog_id, "ToggleDialogViewAsMessagesOnServer") || + !have_input_peer(dialog_id, true, AccessRights::Read)) { + binlog_erase(G()->td_db()->get_binlog(), event.id_); + break; + } + + toggle_dialog_view_as_messages_on_server(dialog_id, log_event.value_, event.id_); + break; + } + default: + LOG(FATAL) << "Unsupported log event type " << event.type_; + } + } } } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/DialogManager.h b/lib/tgchat/ext/td/td/telegram/DialogManager.h index beb998bf..325e80e6 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogManager.h +++ b/lib/tgchat/ext/td/td/telegram/DialogManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -21,7 +21,6 @@ #include "td/telegram/MessageId.h" #include "td/telegram/NotificationSettingsScope.h" #include "td/telegram/Photo.h" -#include "td/telegram/SuggestedAction.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UserId.h" @@ -40,6 +39,7 @@ namespace td { +struct BinlogEvent; class ReportReason; class Td; class Usernames; @@ -223,11 +223,30 @@ class DialogManager final : public Actor { void reload_voice_chat_on_search(const string &username); - void set_dialog_pending_suggestions(DialogId dialog_id, vector &&pending_suggestions); + void reget_peer_settings(DialogId dialog_id); - void dismiss_dialog_suggested_action(SuggestedAction action, Promise &&promise); + void toggle_dialog_report_spam_state_on_server(DialogId dialog_id, bool is_spam_dialog, uint64 log_event_id, + Promise &&promise); - void remove_dialog_suggested_action(SuggestedAction action); + void get_blocked_dialogs(const td_api::object_ptr &block_list, int32 offset, int32 limit, + Promise> &&promise); + + void on_get_blocked_dialogs(int32 offset, int32 limit, int32 total_count, + vector> &&blocked_peers, + Promise> &&promise); + + void toggle_dialog_is_blocked_on_server(DialogId dialog_id, bool is_blocked, bool is_blocked_for_stories, + uint64 log_event_id); + + void toggle_dialog_is_marked_as_unread_on_server(DialogId dialog_id, bool is_marked_as_unread, uint64 log_event_id); + + void toggle_dialog_is_pinned_on_server(DialogId dialog_id, bool is_pinned, uint64 log_event_id); + + void toggle_dialog_is_translatable_on_server(DialogId dialog_id, bool is_translatable, uint64 log_event_id); + + void toggle_dialog_view_as_messages_on_server(DialogId dialog_id, bool view_as_messages, uint64 log_event_id); + + void on_binlog_events(vector &&events); private: static constexpr size_t MAX_TITLE_LENGTH = 128; // server side limit for chat title @@ -255,7 +274,23 @@ class DialogManager final : public Actor { void on_resolve_dialog(const string &username, ChannelId channel_id, Promise &&promise); - void on_dismiss_suggested_action(SuggestedAction action, Result &&result); + static uint64 save_toggle_dialog_is_blocked_on_server_log_event(DialogId dialog_id, bool is_blocked, + bool is_blocked_for_stories); + + static uint64 save_toggle_dialog_is_marked_as_unread_on_server_log_event(DialogId dialog_id, + bool is_marked_as_unread); + + static uint64 save_toggle_dialog_is_pinned_on_server_log_event(DialogId dialog_id, bool is_pinned); + + static uint64 save_toggle_dialog_is_translatable_on_server_log_event(DialogId dialog_id, bool is_translatable); + + static uint64 save_toggle_dialog_report_spam_state_on_server_log_event(DialogId dialog_id, bool is_spam_dialog); + + static uint64 save_toggle_dialog_view_as_messages_on_server_log_event(DialogId dialog_id, bool view_as_messages); + + class ToggleDialogIsBlockedOnServerLogEvent; + class ToggleDialogPropertyOnServerLogEvent; + class ToggleDialogReportSpamStateOnServerLogEvent; class UploadDialogPhotoCallback; std::shared_ptr upload_dialog_photo_callback_; @@ -292,9 +327,6 @@ class DialogManager final : public Actor { FlatHashMap>> resolve_dialog_username_queries_; - FlatHashMap, DialogIdHash> dialog_suggested_actions_; - FlatHashMap>, DialogIdHash> dismiss_suggested_action_queries_; - Td *td_; ActorShared<> parent_; }; diff --git a/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.cpp b/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.cpp index b83be605..d54bb79f 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.h b/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.h index e1df7581..a98b58bd 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.h +++ b/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.hpp b/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.hpp index 3b3f0e2f..cd326253 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.hpp +++ b/lib/tgchat/ext/td/td/telegram/DialogNotificationSettings.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogParticipant.cpp b/lib/tgchat/ext/td/td/telegram/DialogParticipant.cpp index b78f3df6..46219841 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogParticipant.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogParticipant.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogParticipant.h b/lib/tgchat/ext/td/td/telegram/DialogParticipant.h index 2f56fdc6..2d611cff 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogParticipant.h +++ b/lib/tgchat/ext/td/td/telegram/DialogParticipant.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.cpp b/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.cpp index 32f6581c..ee78ed37 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.h b/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.h index 81298691..199d9952 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.h +++ b/lib/tgchat/ext/td/td/telegram/DialogParticipantFilter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.cpp b/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.cpp index b84ddda9..e3b3bd3c 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.h b/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.h index d0211566..9d6b1749 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.h +++ b/lib/tgchat/ext/td/td/telegram/DialogParticipantManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogSource.cpp b/lib/tgchat/ext/td/td/telegram/DialogSource.cpp index 8b9fb6e3..8977bb02 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogSource.cpp +++ b/lib/tgchat/ext/td/td/telegram/DialogSource.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DialogSource.h b/lib/tgchat/ext/td/td/telegram/DialogSource.h index dd706483..732585a1 100644 --- a/lib/tgchat/ext/td/td/telegram/DialogSource.h +++ b/lib/tgchat/ext/td/td/telegram/DialogSource.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Dimensions.cpp b/lib/tgchat/ext/td/td/telegram/Dimensions.cpp index 32426146..512fe3c6 100644 --- a/lib/tgchat/ext/td/td/telegram/Dimensions.cpp +++ b/lib/tgchat/ext/td/td/telegram/Dimensions.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Dimensions.h b/lib/tgchat/ext/td/td/telegram/Dimensions.h index 7e0aa3f1..ee90bfa4 100644 --- a/lib/tgchat/ext/td/td/telegram/Dimensions.h +++ b/lib/tgchat/ext/td/td/telegram/Dimensions.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Dimensions.hpp b/lib/tgchat/ext/td/td/telegram/Dimensions.hpp index 713863f1..6edb53f7 100644 --- a/lib/tgchat/ext/td/td/telegram/Dimensions.hpp +++ b/lib/tgchat/ext/td/td/telegram/Dimensions.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Document.cpp b/lib/tgchat/ext/td/td/telegram/Document.cpp index 8a9142e1..ad29d5dd 100644 --- a/lib/tgchat/ext/td/td/telegram/Document.cpp +++ b/lib/tgchat/ext/td/td/telegram/Document.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Document.h b/lib/tgchat/ext/td/td/telegram/Document.h index 448c372c..750f0fb5 100644 --- a/lib/tgchat/ext/td/td/telegram/Document.h +++ b/lib/tgchat/ext/td/td/telegram/Document.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Document.hpp b/lib/tgchat/ext/td/td/telegram/Document.hpp index 66e6c096..021e6e89 100644 --- a/lib/tgchat/ext/td/td/telegram/Document.hpp +++ b/lib/tgchat/ext/td/td/telegram/Document.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DocumentsManager.cpp b/lib/tgchat/ext/td/td/telegram/DocumentsManager.cpp index e1717bdb..0f0ac383 100644 --- a/lib/tgchat/ext/td/td/telegram/DocumentsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DocumentsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -72,7 +72,7 @@ tl_object_ptr DocumentsManager::get_document_object(FileId fil } Document DocumentsManager::on_get_document(RemoteDocument remote_document, DialogId owner_dialog_id, - MultiPromiseActor *load_data_multipromise_ptr, + bool is_self_destructing, MultiPromiseActor *load_data_multipromise_ptr, Document::Type default_document_type, Subtype document_subtype) { tl_object_ptr animated; tl_object_ptr video; @@ -147,7 +147,7 @@ Document DocumentsManager::on_get_document(RemoteDocument remote_document, Dialo type_attributes--; audio = nullptr; } - if (default_document_type == Document::Type::Video) { + if (animated != nullptr && default_document_type == Document::Type::Video) { type_attributes--; animated = nullptr; } @@ -171,6 +171,11 @@ Document DocumentsManager::on_get_document(RemoteDocument remote_document, Dialo type_attributes--; video = nullptr; } + } else if (animated != nullptr && default_document_type == Document::Type::Video) { + LOG(ERROR) << "Receive " << to_string(remote_document.document) << " with " << to_string(animated) + << " and without video"; + type_attributes--; + animated = nullptr; } if (animated != nullptr && audio != nullptr) { // animation send as audio @@ -208,7 +213,7 @@ Document DocumentsManager::on_get_document(RemoteDocument remote_document, Dialo } if (is_voice_note) { document_type = Document::Type::VoiceNote; - file_type = FileType::VoiceNote; + file_type = is_self_destructing ? FileType::SelfDestructingVoiceNote : FileType::VoiceNote; default_extension = Slice("oga"); file_name.clear(); } else { @@ -235,11 +240,11 @@ Document DocumentsManager::on_get_document(RemoteDocument remote_document, Dialo } if (is_video_note) { document_type = Document::Type::VideoNote; - file_type = FileType::VideoNote; + file_type = is_self_destructing ? FileType::SelfDestructingVideoNote : FileType::VideoNote; file_name.clear(); } else { document_type = Document::Type::Video; - file_type = FileType::Video; + file_type = is_self_destructing ? FileType::SelfDestructingVideo : FileType::Video; } default_extension = Slice("mp4"); } diff --git a/lib/tgchat/ext/td/td/telegram/DocumentsManager.h b/lib/tgchat/ext/td/td/telegram/DocumentsManager.h index d6c4ebf5..d48077ea 100644 --- a/lib/tgchat/ext/td/td/telegram/DocumentsManager.h +++ b/lib/tgchat/ext/td/td/telegram/DocumentsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -85,7 +85,7 @@ class DocumentsManager { enum class Subtype : int32 { Background, Pattern, Ringtone, Story, Other }; - Document on_get_document(RemoteDocument remote_document, DialogId owner_dialog_id, + Document on_get_document(RemoteDocument remote_document, DialogId owner_dialog_id, bool is_self_destructing, MultiPromiseActor *load_data_multipromise_ptr = nullptr, Document::Type default_document_type = Document::Type::General, Subtype document_subtype = Subtype::Other); diff --git a/lib/tgchat/ext/td/td/telegram/DocumentsManager.hpp b/lib/tgchat/ext/td/td/telegram/DocumentsManager.hpp index 3159cb12..106e6720 100644 --- a/lib/tgchat/ext/td/td/telegram/DocumentsManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/DocumentsManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DownloadManager.cpp b/lib/tgchat/ext/td/td/telegram/DownloadManager.cpp index 99409467..eaca24bd 100644 --- a/lib/tgchat/ext/td/td/telegram/DownloadManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/DownloadManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -297,9 +297,12 @@ class DownloadManagerImpl final : public DownloadManager { file_info.expected_size = expected_size; file_info.downloaded_size = downloaded_size; if (is_paused && file_info.is_paused != is_paused) { - file_info.is_paused = is_paused; + file_info.is_paused = true; file_info.need_save_to_database = true; need_update = true; + + // keep the state consistent + callback_->pause_file(file_info.file_id, file_info.internal_download_id); } }); if (is_search_inited_ && need_update) { diff --git a/lib/tgchat/ext/td/td/telegram/DownloadManager.h b/lib/tgchat/ext/td/td/telegram/DownloadManager.h index 76d28a3c..0770dd55 100644 --- a/lib/tgchat/ext/td/td/telegram/DownloadManager.h +++ b/lib/tgchat/ext/td/td/telegram/DownloadManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.cpp b/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.cpp index 93715082..76054309 100644 --- a/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.cpp +++ b/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.h b/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.h index af061165..b4bd6d28 100644 --- a/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.h +++ b/lib/tgchat/ext/td/td/telegram/DownloadManagerCallback.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DraftMessage.cpp b/lib/tgchat/ext/td/td/telegram/DraftMessage.cpp index a74dfda4..866b65d0 100644 --- a/lib/tgchat/ext/td/td/telegram/DraftMessage.cpp +++ b/lib/tgchat/ext/td/td/telegram/DraftMessage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DraftMessage.h b/lib/tgchat/ext/td/td/telegram/DraftMessage.h index 02446c00..09168327 100644 --- a/lib/tgchat/ext/td/td/telegram/DraftMessage.h +++ b/lib/tgchat/ext/td/td/telegram/DraftMessage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/DraftMessage.hpp b/lib/tgchat/ext/td/td/telegram/DraftMessage.hpp index c2d58da4..038bee20 100644 --- a/lib/tgchat/ext/td/td/telegram/DraftMessage.hpp +++ b/lib/tgchat/ext/td/td/telegram/DraftMessage.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmailVerification.cpp b/lib/tgchat/ext/td/td/telegram/EmailVerification.cpp index e4847ae9..96aff0dd 100644 --- a/lib/tgchat/ext/td/td/telegram/EmailVerification.cpp +++ b/lib/tgchat/ext/td/td/telegram/EmailVerification.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmailVerification.h b/lib/tgchat/ext/td/td/telegram/EmailVerification.h index d357bd50..a42557b6 100644 --- a/lib/tgchat/ext/td/td/telegram/EmailVerification.h +++ b/lib/tgchat/ext/td/td/telegram/EmailVerification.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiGroup.cpp b/lib/tgchat/ext/td/td/telegram/EmojiGroup.cpp index 0bfc32c4..804d269b 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiGroup.cpp +++ b/lib/tgchat/ext/td/td/telegram/EmojiGroup.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiGroup.h b/lib/tgchat/ext/td/td/telegram/EmojiGroup.h index 4634bbad..193e9e73 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiGroup.h +++ b/lib/tgchat/ext/td/td/telegram/EmojiGroup.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiGroup.hpp b/lib/tgchat/ext/td/td/telegram/EmojiGroup.hpp index 26b8f654..2a49f132 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiGroup.hpp +++ b/lib/tgchat/ext/td/td/telegram/EmojiGroup.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiGroupType.cpp b/lib/tgchat/ext/td/td/telegram/EmojiGroupType.cpp index 578baa78..5ec1d8d1 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiGroupType.cpp +++ b/lib/tgchat/ext/td/td/telegram/EmojiGroupType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiGroupType.h b/lib/tgchat/ext/td/td/telegram/EmojiGroupType.h index 4a66b52c..76e5157a 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiGroupType.h +++ b/lib/tgchat/ext/td/td/telegram/EmojiGroupType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiStatus.cpp b/lib/tgchat/ext/td/td/telegram/EmojiStatus.cpp index b7830619..11157cc9 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiStatus.cpp +++ b/lib/tgchat/ext/td/td/telegram/EmojiStatus.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EmojiStatus.h b/lib/tgchat/ext/td/td/telegram/EmojiStatus.h index 40a9a6f7..d80d2146 100644 --- a/lib/tgchat/ext/td/td/telegram/EmojiStatus.h +++ b/lib/tgchat/ext/td/td/telegram/EmojiStatus.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/EncryptedFile.h b/lib/tgchat/ext/td/td/telegram/EncryptedFile.h index 79e146f5..0305f588 100644 --- a/lib/tgchat/ext/td/td/telegram/EncryptedFile.h +++ b/lib/tgchat/ext/td/td/telegram/EncryptedFile.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FactCheck.cpp b/lib/tgchat/ext/td/td/telegram/FactCheck.cpp index 0f9077ef..06f37e18 100644 --- a/lib/tgchat/ext/td/td/telegram/FactCheck.cpp +++ b/lib/tgchat/ext/td/td/telegram/FactCheck.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FactCheck.h b/lib/tgchat/ext/td/td/telegram/FactCheck.h index 31b02eff..b45e3b10 100644 --- a/lib/tgchat/ext/td/td/telegram/FactCheck.h +++ b/lib/tgchat/ext/td/td/telegram/FactCheck.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FactCheck.hpp b/lib/tgchat/ext/td/td/telegram/FactCheck.hpp index a3861748..8aa31764 100644 --- a/lib/tgchat/ext/td/td/telegram/FactCheck.hpp +++ b/lib/tgchat/ext/td/td/telegram/FactCheck.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FileReferenceManager.cpp b/lib/tgchat/ext/td/td/telegram/FileReferenceManager.cpp index c40b82a1..a25db10d 100644 --- a/lib/tgchat/ext/td/td/telegram/FileReferenceManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/FileReferenceManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FileReferenceManager.h b/lib/tgchat/ext/td/td/telegram/FileReferenceManager.h index 3d568ed5..96dbc63f 100644 --- a/lib/tgchat/ext/td/td/telegram/FileReferenceManager.h +++ b/lib/tgchat/ext/td/td/telegram/FileReferenceManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FileReferenceManager.hpp b/lib/tgchat/ext/td/td/telegram/FileReferenceManager.hpp index ab6dab11..44fe387a 100644 --- a/lib/tgchat/ext/td/td/telegram/FileReferenceManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/FileReferenceManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/FolderId.h b/lib/tgchat/ext/td/td/telegram/FolderId.h index b3939cc8..e18a28bc 100644 --- a/lib/tgchat/ext/td/td/telegram/FolderId.h +++ b/lib/tgchat/ext/td/td/telegram/FolderId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopic.cpp b/lib/tgchat/ext/td/td/telegram/ForumTopic.cpp index d085f3dc..93520bff 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopic.cpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopic.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopic.h b/lib/tgchat/ext/td/td/telegram/ForumTopic.h index c8baeaba..421b12b7 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopic.h +++ b/lib/tgchat/ext/td/td/telegram/ForumTopic.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopic.hpp b/lib/tgchat/ext/td/td/telegram/ForumTopic.hpp index cc10fdc2..2eb45124 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopic.hpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopic.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.cpp b/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.cpp index 5c541ec7..037d7115 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.cpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.h b/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.h index ed2b024a..79a074de 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.h +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.hpp b/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.hpp index 536d9456..455f3ec3 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.hpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicEditedData.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.cpp b/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.cpp index c397ffc9..0d8b24ea 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.cpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.h b/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.h index 99afaa98..cf224216 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.h +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.hpp b/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.hpp index 68d3fe2b..b9a23846 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.hpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicIcon.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.cpp b/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.cpp index b247873e..006f53d1 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.h b/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.h index 639efc6b..3573ec59 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.h +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.hpp b/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.hpp index 2142859e..38447849 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicManager.cpp b/lib/tgchat/ext/td/td/telegram/ForumTopicManager.cpp index f4a9b3d4..ee5198ed 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ForumTopicManager.h b/lib/tgchat/ext/td/td/telegram/ForumTopicManager.h index 34d1ecd2..d92e02d2 100644 --- a/lib/tgchat/ext/td/td/telegram/ForumTopicManager.h +++ b/lib/tgchat/ext/td/td/telegram/ForumTopicManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Game.cpp b/lib/tgchat/ext/td/td/telegram/Game.cpp index d89dd221..71ed2b46 100644 --- a/lib/tgchat/ext/td/td/telegram/Game.cpp +++ b/lib/tgchat/ext/td/td/telegram/Game.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -44,8 +44,8 @@ Game::Game(Td *td, string title, string description, tl_object_ptrget_id(); if (document_id == telegram_api::document::ID) { - auto parsed_document = - td->documents_manager_->on_get_document(move_tl_object_as(document), owner_dialog_id); + auto parsed_document = td->documents_manager_->on_get_document( + move_tl_object_as(document), owner_dialog_id, false); if (parsed_document.type == Document::Type::Animation) { animation_file_id_ = parsed_document.file_id; } else { diff --git a/lib/tgchat/ext/td/td/telegram/Game.h b/lib/tgchat/ext/td/td/telegram/Game.h index 3d224ad9..16103c60 100644 --- a/lib/tgchat/ext/td/td/telegram/Game.h +++ b/lib/tgchat/ext/td/td/telegram/Game.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Game.hpp b/lib/tgchat/ext/td/td/telegram/Game.hpp index 346403e8..dfb4ec64 100644 --- a/lib/tgchat/ext/td/td/telegram/Game.hpp +++ b/lib/tgchat/ext/td/td/telegram/Game.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GameManager.cpp b/lib/tgchat/ext/td/td/telegram/GameManager.cpp index dae80790..76beb0e3 100644 --- a/lib/tgchat/ext/td/td/telegram/GameManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/GameManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GameManager.h b/lib/tgchat/ext/td/td/telegram/GameManager.h index 4e8c40a7..6bad590e 100644 --- a/lib/tgchat/ext/td/td/telegram/GameManager.h +++ b/lib/tgchat/ext/td/td/telegram/GameManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GitCommitHash.cpp.in b/lib/tgchat/ext/td/td/telegram/GitCommitHash.cpp.in index c39839f4..12961840 100644 --- a/lib/tgchat/ext/td/td/telegram/GitCommitHash.cpp.in +++ b/lib/tgchat/ext/td/td/telegram/GitCommitHash.cpp.in @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GitCommitHash.h b/lib/tgchat/ext/td/td/telegram/GitCommitHash.h index 58073666..bd2251a4 100644 --- a/lib/tgchat/ext/td/td/telegram/GitCommitHash.h +++ b/lib/tgchat/ext/td/td/telegram/GitCommitHash.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GiveawayParameters.cpp b/lib/tgchat/ext/td/td/telegram/GiveawayParameters.cpp index 068d6ed8..e1dc3912 100644 --- a/lib/tgchat/ext/td/td/telegram/GiveawayParameters.cpp +++ b/lib/tgchat/ext/td/td/telegram/GiveawayParameters.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GiveawayParameters.h b/lib/tgchat/ext/td/td/telegram/GiveawayParameters.h index 2080df1e..3ec47a75 100644 --- a/lib/tgchat/ext/td/td/telegram/GiveawayParameters.h +++ b/lib/tgchat/ext/td/td/telegram/GiveawayParameters.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GiveawayParameters.hpp b/lib/tgchat/ext/td/td/telegram/GiveawayParameters.hpp index 8ed30c93..04da1015 100644 --- a/lib/tgchat/ext/td/td/telegram/GiveawayParameters.hpp +++ b/lib/tgchat/ext/td/td/telegram/GiveawayParameters.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Global.cpp b/lib/tgchat/ext/td/td/telegram/Global.cpp index 4714ffba..082f38df 100644 --- a/lib/tgchat/ext/td/td/telegram/Global.cpp +++ b/lib/tgchat/ext/td/td/telegram/Global.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Global.h b/lib/tgchat/ext/td/td/telegram/Global.h index afc5bacb..4dd906a1 100644 --- a/lib/tgchat/ext/td/td/telegram/Global.h +++ b/lib/tgchat/ext/td/td/telegram/Global.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -59,6 +59,7 @@ class InlineMessageManager; class LanguagePackManager; class LinkManager; class MessageImportManager; +class MessageQueryManager; class MessagesManager; class NetQueryDispatcher; class NetQueryStats; @@ -71,6 +72,7 @@ class PeopleNearbyManager; class PromoDataManager; class QuickReplyManager; class ReactionManager; +class ReferralProgramManager; class SavedMessagesManager; class SecretChatsManager; class SponsoredMessageManager; @@ -79,6 +81,7 @@ class StateManager; class StickersManager; class StorageManager; class StoryManager; +class SuggestedActionManager; class Td; class TdDb; class TempAuthKeyWatchdog; @@ -389,6 +392,13 @@ class Global final : public ActorContext { message_import_manager_ = message_import_manager; } + ActorId message_query_manager() const { + return message_query_manager_; + } + void set_message_query_manager(ActorId message_query_manager) { + message_query_manager_ = message_query_manager; + } + ActorId messages_manager() const { return messages_manager_; } @@ -457,6 +467,13 @@ class Global final : public ActorContext { reaction_manager_ = reaction_manager; } + ActorId referral_program_manager() const { + return referral_program_manager_; + } + void set_referral_program_manager(ActorId referral_program_manager) { + referral_program_manager_ = referral_program_manager; + } + ActorId saved_messages_manager() const { return saved_messages_manager_; } @@ -506,6 +523,13 @@ class Global final : public ActorContext { story_manager_ = story_manager; } + ActorId suggested_action_manager() const { + return suggested_action_manager_; + } + void set_suggested_action_manager(ActorId suggested_action_manager) { + suggested_action_manager_ = suggested_action_manager; + } + ActorId theme_manager() const { return theme_manager_; } @@ -594,6 +618,10 @@ class Global final : public ActorContext { return gc_scheduler_id_; } + int32 get_main_session_scheduler_id() const { + return use_sqlite_pmc() ? -1 : database_scheduler_id_; + } + int32 get_slow_net_scheduler_id() const { return slow_net_scheduler_id_; } @@ -711,6 +739,7 @@ class Global final : public ActorContext { ActorId language_pack_manager_; ActorId link_manager_; ActorId message_import_manager_; + ActorId message_query_manager_; ActorId messages_manager_; ActorId notification_manager_; ActorId notification_settings_manager_; @@ -720,6 +749,7 @@ class Global final : public ActorContext { ActorId promo_data_manager_; ActorId quick_reply_manager_; ActorId reaction_manager_; + ActorId referral_program_manager_; ActorId saved_messages_manager_; ActorId secret_chats_manager_; ActorId sponsored_message_manager_; @@ -727,6 +757,7 @@ class Global final : public ActorContext { ActorId stickers_manager_; ActorId storage_manager_; ActorId story_manager_; + ActorId suggested_action_manager_; ActorId theme_manager_; ActorId time_zone_manager_; ActorId top_dialog_manager_; diff --git a/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.cpp b/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.cpp index 70ae812a..0af6898b 100644 --- a/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.cpp +++ b/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.cpp @@ -1,15 +1,15 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/GlobalPrivacySettings.h" -#include "td/telegram/ConfigManager.h" #include "td/telegram/Global.h" #include "td/telegram/net/NetQueryCreator.h" #include "td/telegram/SuggestedAction.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/Td.h" #include "td/telegram/telegram_api.h" @@ -169,7 +169,7 @@ void GlobalPrivacySettings::set_global_privacy_settings(Td *td, GlobalPrivacySet Promise &&promise) { CHECK(settings.set_type_ != SetType::None); if (settings.archive_and_mute_new_noncontact_peers_) { - send_closure(td->config_manager_, &ConfigManager::hide_suggested_action, + send_closure(td->suggested_action_manager_actor_, &SuggestedActionManager::hide_suggested_action, SuggestedAction{SuggestedAction::Type::EnableArchiveAndMuteNewChats}); } diff --git a/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.h b/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.h index 3c941b7d..dc6154a2 100644 --- a/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.h +++ b/lib/tgchat/ext/td/td/telegram/GlobalPrivacySettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallId.h b/lib/tgchat/ext/td/td/telegram/GroupCallId.h index fc397c85..b65e58ba 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallId.h +++ b/lib/tgchat/ext/td/td/telegram/GroupCallId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallManager.cpp b/lib/tgchat/ext/td/td/telegram/GroupCallManager.cpp index e2164fe7..3c3eff25 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/GroupCallManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -452,7 +452,7 @@ class JoinGroupCallQuery final : public Td::ResultHandler { } auto query = G()->net_query_creator().create(telegram_api::phone_joinGroupCall( flags, false /*ignored*/, false /*ignored*/, input_group_call_id.get_input_group_call(), - std::move(join_as_input_peer), invite_hash, make_tl_object(payload))); + std::move(join_as_input_peer), invite_hash, 0, telegram_api::make_object(payload))); auto join_query_ref = query.get_weak(); send_query(std::move(query)); return join_query_ref; @@ -3728,10 +3728,9 @@ void GroupCallManager::set_group_call_participant_is_speaking(GroupCallId group_ on_user_speaking_in_group_call(group_call_id, dialog_id, date, false, is_recursive); } - if (group_call->audio_source == audio_source && group_call->dialog_id.is_valid() && - group_call->is_speaking != is_speaking) { + if (group_call->audio_source == audio_source && group_call->is_speaking != is_speaking) { group_call->is_speaking = is_speaking; - if (is_speaking) { + if (is_speaking && group_call->dialog_id.is_valid()) { pending_send_speaking_action_timeout_.add_timeout_in(group_call_id.get(), 0.0); } } @@ -4376,7 +4375,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptris_active) { // never update ended calls } else if (!call.is_active) { - // always update to an ended call, droping also is_joined, is_speaking and other local flags + // always update to an ended call, dropping also is_joined, is_speaking and other local flags fail_promises(group_call->after_join, Status::Error(400, "Group call ended")); *group_call = std::move(call); need_update = true; diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallManager.h b/lib/tgchat/ext/td/td/telegram/GroupCallManager.h index 9539adc5..01ad95a9 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallManager.h +++ b/lib/tgchat/ext/td/td/telegram/GroupCallManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -39,6 +39,8 @@ class GroupCallManager final : public Actor { GroupCallManager &operator=(GroupCallManager &&) = delete; ~GroupCallManager() final; + Result get_input_group_call_id(GroupCallId group_call_id); + bool is_group_call_being_joined(InputGroupCallId input_group_call_id) const; bool is_group_call_joined(InputGroupCallId input_group_call_id) const; @@ -179,8 +181,6 @@ class GroupCallManager final : public Actor { void on_sync_participants_timeout(GroupCallId group_call_id); - Result get_input_group_call_id(GroupCallId group_call_id); - GroupCallId get_next_group_call_id(InputGroupCallId input_group_call_id); GroupCall *add_group_call(InputGroupCallId input_group_call_id, DialogId dialog_id); diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.cpp b/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.cpp index 2ecfcece..68411102 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.cpp +++ b/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -72,7 +72,7 @@ GroupCallParticipant::GroupCallParticipant(const tl_object_ptr &participant) { - // updates about new and left participants must be applyed as versioned, even they don't increase version + // updates about new and left participants must be applied as versioned, even they don't increase version return participant->just_joined_ || participant->left_ || participant->versioned_; } diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.h b/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.h index 0c848b45..8e1e7aa1 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.h +++ b/lib/tgchat/ext/td/td/telegram/GroupCallParticipant.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.cpp b/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.cpp index d6c2efdd..4e13a5cf 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.cpp +++ b/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.h b/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.h index 1572227b..08e9d217 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.h +++ b/lib/tgchat/ext/td/td/telegram/GroupCallParticipantOrder.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.cpp b/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.cpp index 7d7057a7..5ea238d1 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.cpp +++ b/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.h b/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.h index 3d05507e..f00bdf37 100644 --- a/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.h +++ b/lib/tgchat/ext/td/td/telegram/GroupCallVideoPayload.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/HashtagHints.cpp b/lib/tgchat/ext/td/td/telegram/HashtagHints.cpp index 2c953b25..0853acd6 100644 --- a/lib/tgchat/ext/td/td/telegram/HashtagHints.cpp +++ b/lib/tgchat/ext/td/td/telegram/HashtagHints.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/HashtagHints.h b/lib/tgchat/ext/td/td/telegram/HashtagHints.h index 1dcd6878..2f604269 100644 --- a/lib/tgchat/ext/td/td/telegram/HashtagHints.h +++ b/lib/tgchat/ext/td/td/telegram/HashtagHints.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InlineMessageManager.cpp b/lib/tgchat/ext/td/td/telegram/InlineMessageManager.cpp index cd87d2fc..66eeeb4a 100644 --- a/lib/tgchat/ext/td/td/telegram/InlineMessageManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/InlineMessageManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InlineMessageManager.h b/lib/tgchat/ext/td/td/telegram/InlineMessageManager.h index 7a6b7e3e..4a640864 100644 --- a/lib/tgchat/ext/td/td/telegram/InlineMessageManager.h +++ b/lib/tgchat/ext/td/td/telegram/InlineMessageManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.cpp b/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.cpp index 1cc7de66..461e6ad0 100644 --- a/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -364,6 +364,10 @@ class SendWebViewResultMessageQuery final : public Td::ResultHandler { InlineQueriesManager::InlineQueriesManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { drop_inline_query_result_timeout_.set_callback(on_drop_inline_query_result_timeout_callback); drop_inline_query_result_timeout_.set_callback_data(static_cast(this)); + + drop_inline_query_message_timeout_.set_callback(on_drop_inline_query_message_timeout_callback); + drop_inline_query_message_timeout_.set_callback_data(static_cast(this)); + next_inline_query_time_ = Time::now(); } @@ -393,13 +397,34 @@ void InlineQueriesManager::on_drop_inline_query_result_timeout(int64 query_hash) if (it->second.pending_request_count == 0) { if (it->second.results != nullptr) { auto query_id = it->second.results->inline_query_id_; - inline_message_contents_.erase(query_id); - query_id_to_bot_user_id_.erase(query_id); + if (query_id) { + drop_inline_query_message_timeout_.set_timeout_in(query_id, 3600); + } } inline_query_results_.erase(it); } } +void InlineQueriesManager::on_drop_inline_query_message_timeout_callback(void *inline_queries_manager_ptr, + int64 query_id) { + if (G()->close_flag()) { + return; + } + + auto inline_queries_manager = static_cast(inline_queries_manager_ptr); + send_closure_later(inline_queries_manager->actor_id(inline_queries_manager), + &InlineQueriesManager::on_drop_inline_query_message_timeout, query_id); +} + +void InlineQueriesManager::on_drop_inline_query_message_timeout(int64 query_id) { + if (G()->close_flag()) { + return; + } + + inline_message_contents_.erase(query_id); + query_id_to_bot_user_id_.erase(query_id); +} + void InlineQueriesManager::after_get_difference() { if (td_->auth_manager_->is_bot()) { return; @@ -766,13 +791,7 @@ Result> InlineQueriesManager:: auto article = move_tl_object_as(result); type = "article"; id = std::move(article->id_); - if (!article->url_.empty()) { - content_url = std::move(article->url_); - content_type = "text/html"; - if (!article->hide_url_) { - url = content_url; - } - } + url = std::move(article->url_); title = std::move(article->title_); description = std::move(article->description_); thumbnail_url = std::move(article->thumbnail_url_); @@ -1528,8 +1547,8 @@ tl_object_ptr copy(const td_api::inlineQueryRe template <> tl_object_ptr copy(const td_api::inlineQueryResultArticle &obj) { - return td_api::make_object(obj.id_, obj.url_, obj.hide_url_, obj.title_, - obj.description_, copy(obj.thumbnail_)); + return td_api::make_object(obj.id_, obj.url_, obj.title_, obj.description_, + copy(obj.thumbnail_)); } template <> @@ -1744,7 +1763,7 @@ td_api::object_ptr InlineQueriesManager::get_inline_q CHECK(document_id == telegram_api::document::ID); auto parsed_document = td_->documents_manager_->on_get_document( - telegram_api::move_object_as(document_ptr), DialogId()); + telegram_api::move_object_as(document_ptr), DialogId(), false); switch (parsed_document.type) { case Document::Type::Animation: { LOG_IF(WARNING, result->type_ != "gif") << "Wrong result type " << result->type_; @@ -1877,14 +1896,7 @@ td_api::object_ptr InlineQueriesManager::get_inline_q if (result->type_ == "article") { auto article = td_api::make_object(); article->id_ = std::move(result->id_); - article->url_ = get_web_document_url(result->content_); - if (result->url_.empty()) { - article->hide_url_ = true; - } else { - LOG_IF(ERROR, result->url_ != article->url_) - << "URL has changed from " << article->url_ << " to " << result->url_; - article->hide_url_ = false; - } + article->url_ = std::move(result->url_); article->title_ = std::move(result->title_); article->description_ = std::move(result->description_); article->thumbnail_ = register_thumbnail(std::move(result->thumb_)); @@ -2041,7 +2053,7 @@ td_api::object_ptr InlineQueriesManager::get_inline_q get_web_document_photo_size(td_->file_manager_.get(), FileType::Thumbnail, DialogId(), std::move(result->thumb_)), std::move(attributes)}, - DialogId(), nullptr, default_document_type); + DialogId(), false, nullptr, default_document_type); auto file_id = parsed_document.file_id; if (!file_id.is_valid()) { break; diff --git a/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.h b/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.h index 6a0f10dd..a8734d94 100644 --- a/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.h +++ b/lib/tgchat/ext/td/td/telegram/InlineQueriesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -140,6 +140,10 @@ class InlineQueriesManager final : public Actor { void on_drop_inline_query_result_timeout(int64 query_hash); + static void on_drop_inline_query_message_timeout_callback(void *inline_queries_manager_ptr, int64 query_id); + + void on_drop_inline_query_message_timeout(int64 query_id); + void loop() final; void tear_down() final; @@ -173,6 +177,7 @@ class InlineQueriesManager final : public Actor { }; MultiTimeout drop_inline_query_result_timeout_{"DropInlineQueryResultTimeout"}; + MultiTimeout drop_inline_query_message_timeout_{"DropInlineQueryMessageTimeout"}; FlatHashMap inline_query_results_; // query_hash -> result FlatHashMap> diff --git a/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.cpp b/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.cpp index 7645965a..91734820 100644 --- a/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.cpp +++ b/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.h b/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.h index 1cd9d1eb..8f6846a1 100644 --- a/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.h +++ b/lib/tgchat/ext/td/td/telegram/InputBusinessChatLink.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputDialogId.cpp b/lib/tgchat/ext/td/td/telegram/InputDialogId.cpp index a6696bb3..d4ae15bd 100644 --- a/lib/tgchat/ext/td/td/telegram/InputDialogId.cpp +++ b/lib/tgchat/ext/td/td/telegram/InputDialogId.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -15,25 +15,6 @@ namespace td { -InputDialogId::InputDialogId(const telegram_api::object_ptr &input_user) { - CHECK(input_user != nullptr); - switch (input_user->get_id()) { - case telegram_api::inputUser::ID: { - auto user = static_cast(input_user.get()); - UserId user_id(user->user_id_); - if (user_id.is_valid()) { - dialog_id = DialogId(user_id); - access_hash = user->access_hash_; - return; - } - break; - } - default: - break; - } - LOG(ERROR) << "Receive " << to_string(input_user); -} - InputDialogId::InputDialogId(const tl_object_ptr &input_peer) { CHECK(input_peer != nullptr); switch (input_peer->get_id()) { diff --git a/lib/tgchat/ext/td/td/telegram/InputDialogId.h b/lib/tgchat/ext/td/td/telegram/InputDialogId.h index 6a293396..cc8194fe 100644 --- a/lib/tgchat/ext/td/td/telegram/InputDialogId.h +++ b/lib/tgchat/ext/td/td/telegram/InputDialogId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -25,8 +25,6 @@ class InputDialogId { explicit constexpr InputDialogId(DialogId dialog_id) : dialog_id(dialog_id) { } - explicit InputDialogId(const telegram_api::object_ptr &input_user); - explicit InputDialogId(const tl_object_ptr &input_peer); static vector get_input_dialog_ids(const vector> &input_peers, diff --git a/lib/tgchat/ext/td/td/telegram/InputGroupCallId.cpp b/lib/tgchat/ext/td/td/telegram/InputGroupCallId.cpp index e65a9c05..37429baf 100644 --- a/lib/tgchat/ext/td/td/telegram/InputGroupCallId.cpp +++ b/lib/tgchat/ext/td/td/telegram/InputGroupCallId.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputGroupCallId.h b/lib/tgchat/ext/td/td/telegram/InputGroupCallId.h index 59d61d6f..a1be1617 100644 --- a/lib/tgchat/ext/td/td/telegram/InputGroupCallId.h +++ b/lib/tgchat/ext/td/td/telegram/InputGroupCallId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputInvoice.cpp b/lib/tgchat/ext/td/td/telegram/InputInvoice.cpp index d357f014..f9eb4f1d 100644 --- a/lib/tgchat/ext/td/td/telegram/InputInvoice.cpp +++ b/lib/tgchat/ext/td/td/telegram/InputInvoice.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputInvoice.h b/lib/tgchat/ext/td/td/telegram/InputInvoice.h index 5ef9326c..1741a620 100644 --- a/lib/tgchat/ext/td/td/telegram/InputInvoice.h +++ b/lib/tgchat/ext/td/td/telegram/InputInvoice.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputInvoice.hpp b/lib/tgchat/ext/td/td/telegram/InputInvoice.hpp index 38ad9f70..05f7a214 100644 --- a/lib/tgchat/ext/td/td/telegram/InputInvoice.hpp +++ b/lib/tgchat/ext/td/td/telegram/InputInvoice.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputMessageText.cpp b/lib/tgchat/ext/td/td/telegram/InputMessageText.cpp index c59046db..b6e20d80 100644 --- a/lib/tgchat/ext/td/td/telegram/InputMessageText.cpp +++ b/lib/tgchat/ext/td/td/telegram/InputMessageText.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputMessageText.h b/lib/tgchat/ext/td/td/telegram/InputMessageText.h index 2a9518ba..c1d2064f 100644 --- a/lib/tgchat/ext/td/td/telegram/InputMessageText.h +++ b/lib/tgchat/ext/td/td/telegram/InputMessageText.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/InputMessageText.hpp b/lib/tgchat/ext/td/td/telegram/InputMessageText.hpp index b982a08f..c7cda5bf 100644 --- a/lib/tgchat/ext/td/td/telegram/InputMessageText.hpp +++ b/lib/tgchat/ext/td/td/telegram/InputMessageText.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/JsonValue.cpp b/lib/tgchat/ext/td/td/telegram/JsonValue.cpp index 2603935c..4831f297 100644 --- a/lib/tgchat/ext/td/td/telegram/JsonValue.cpp +++ b/lib/tgchat/ext/td/td/telegram/JsonValue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/JsonValue.h b/lib/tgchat/ext/td/td/telegram/JsonValue.h index 30ddaf72..ca250dab 100644 --- a/lib/tgchat/ext/td/td/telegram/JsonValue.h +++ b/lib/tgchat/ext/td/td/telegram/JsonValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/LabeledPricePart.h b/lib/tgchat/ext/td/td/telegram/LabeledPricePart.h index 09c2219a..be8ab91a 100644 --- a/lib/tgchat/ext/td/td/telegram/LabeledPricePart.h +++ b/lib/tgchat/ext/td/td/telegram/LabeledPricePart.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/LanguagePackManager.cpp b/lib/tgchat/ext/td/td/telegram/LanguagePackManager.cpp index 4c95f337..4b157f60 100644 --- a/lib/tgchat/ext/td/td/telegram/LanguagePackManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/LanguagePackManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/LanguagePackManager.h b/lib/tgchat/ext/td/td/telegram/LanguagePackManager.h index a25ddce3..ae9bad91 100644 --- a/lib/tgchat/ext/td/td/telegram/LanguagePackManager.h +++ b/lib/tgchat/ext/td/td/telegram/LanguagePackManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/LinkManager.cpp b/lib/tgchat/ext/td/td/telegram/LinkManager.cpp index 0803849f..64e00d84 100644 --- a/lib/tgchat/ext/td/td/telegram/LinkManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/LinkManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -131,6 +131,13 @@ static string get_url_query_draft_text(const HttpUrlQuery &url_query) { return text; } +static vector get_referral_program_start_parameter_prefixes() { + if (Scheduler::context() != nullptr) { + return full_split(G()->get_option_string("starref_start_param_prefixes", "_tgr_"), ' '); + } + return vector{"_tgr_"}; +} + static AdministratorRights get_administrator_rights(Slice rights, bool for_channel) { bool can_manage_dialog = false; bool can_change_info = false; @@ -362,8 +369,7 @@ class LinkManager::InternalLinkBotStart final : public InternalLink { } else { const Td *td = G()->td().get_actor_unsafe(); auto dialog_id = td->dialog_manager_->get_resolved_dialog_by_username(bot_username_); - if (dialog_id.is_valid() && dialog_id.get_type() == DialogType::User && - td->messages_manager_->get_dialog_has_last_message(dialog_id) && + if (dialog_id.get_type() == DialogType::User && td->messages_manager_->get_dialog_has_last_message(dialog_id) && !td->messages_manager_->is_dialog_blocked(dialog_id)) { autostart = true; } @@ -486,6 +492,20 @@ class LinkManager::InternalLinkDialogInvite final : public InternalLink { } }; +class LinkManager::InternalLinkDialogReferralProgram final : public InternalLink { + string username_; + string referral_; + + td_api::object_ptr get_internal_link_type_object() const final { + return td_api::make_object(username_, referral_); + } + + public: + InternalLinkDialogReferralProgram(string username, string referral) + : username_(std::move(username)), referral_(std::move(referral)) { + } +}; + class LinkManager::InternalLinkEditProfileSettings final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); @@ -1425,7 +1445,19 @@ unique_ptr LinkManager::parse_tg_link_query(Slice que } return td::make_unique(std::move(username), arg.second, arg.first == "livestream"); } + if (arg.first == "ref" && is_valid_start_parameter(arg.second) && !arg.second.empty()) { + // resolve?domain=&ref= + return td::make_unique(std::move(username), std::move(arg.second)); + } if (arg.first == "start" && is_valid_start_parameter(arg.second)) { + auto prefixes = get_referral_program_start_parameter_prefixes(); + for (Slice prefix : prefixes) { + if (begins_with(arg.second, prefix) && arg.second.size() > prefix.size()) { + // resolve?domain=&start=_tgr_ + return td::make_unique(std::move(username), + arg.second.substr(prefix.size())); + } + } // resolve?domain=&start= return td::make_unique(std::move(username), arg.second, is_trusted); } @@ -1903,7 +1935,19 @@ unique_ptr LinkManager::parse_t_me_link_query(Slice q // /?boost return td::make_unique(PSTRING() << "tg://boost?domain=" << url_encode(username)); } + if (arg.first == "ref" && is_valid_start_parameter(arg.second) && !arg.second.empty()) { + // /?ref= + return td::make_unique(std::move(username), std::move(arg.second)); + } if (arg.first == "start" && is_valid_start_parameter(arg.second)) { + auto prefixes = get_referral_program_start_parameter_prefixes(); + for (Slice prefix : prefixes) { + if (begins_with(arg.second, prefix) && arg.second.size() > prefix.size()) { + // /?start=_tgr_ + return td::make_unique(std::move(username), + arg.second.substr(prefix.size())); + } + } // /?start= return td::make_unique(std::move(username), arg.second, is_trusted); } @@ -2244,6 +2288,22 @@ Result LinkManager::get_internal_link_impl(const td_api::InternalLinkTyp return Status::Error("HTTP link is unavailable for the link type"); } return "tg://settings/change_number"; + case td_api::internalLinkTypeChatAffiliateProgram::ID: { + auto link = static_cast(type_ptr); + if (!is_valid_username(link->username_)) { + return Status::Error(400, "Invalid username specified"); + } + if (!is_valid_start_parameter(link->referrer_) || link->referrer_.empty()) { + return Status::Error(400, "Invalid referrer specified"); + } + auto start_parameter = PSTRING() << "start=" << get_referral_program_start_parameter_prefixes()[0] + << link->referrer_; + if (is_internal) { + return PSTRING() << "tg://resolve?domain=" << link->username_ << "&" << start_parameter; + } else { + return PSTRING() << get_t_me_url() << link->username_ << "?" << start_parameter; + } + } case td_api::internalLinkTypeChatBoost::ID: { auto link = static_cast(type_ptr); auto parsed_link = parse_internal_link(link->url_); diff --git a/lib/tgchat/ext/td/td/telegram/LinkManager.h b/lib/tgchat/ext/td/td/telegram/LinkManager.h index ee477dd2..fe5b3f22 100644 --- a/lib/tgchat/ext/td/td/telegram/LinkManager.h +++ b/lib/tgchat/ext/td/td/telegram/LinkManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -137,6 +137,7 @@ class LinkManager final : public Actor { class InternalLinkDialogFolderInvite; class InternalLinkDialogFolderSettings; class InternalLinkDialogInvite; + class InternalLinkDialogReferralProgram; class InternalLinkEditProfileSettings; class InternalLinkGame; class InternalLinkInstantView; diff --git a/lib/tgchat/ext/td/td/telegram/Location.cpp b/lib/tgchat/ext/td/td/telegram/Location.cpp index 46061086..bef1b30c 100644 --- a/lib/tgchat/ext/td/td/telegram/Location.cpp +++ b/lib/tgchat/ext/td/td/telegram/Location.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Location.h b/lib/tgchat/ext/td/td/telegram/Location.h index 7eb15769..3445d8ed 100644 --- a/lib/tgchat/ext/td/td/telegram/Location.h +++ b/lib/tgchat/ext/td/td/telegram/Location.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Log.cpp b/lib/tgchat/ext/td/td/telegram/Log.cpp index 894efbb7..6d1c56e2 100644 --- a/lib/tgchat/ext/td/td/telegram/Log.cpp +++ b/lib/tgchat/ext/td/td/telegram/Log.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Log.h b/lib/tgchat/ext/td/td/telegram/Log.h index 7fc19db6..92b9b391 100644 --- a/lib/tgchat/ext/td/td/telegram/Log.h +++ b/lib/tgchat/ext/td/td/telegram/Log.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/LogDotNet.cpp b/lib/tgchat/ext/td/td/telegram/LogDotNet.cpp index adf88dab..5d8859b9 100644 --- a/lib/tgchat/ext/td/td/telegram/LogDotNet.cpp +++ b/lib/tgchat/ext/td/td/telegram/LogDotNet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Logging.cpp b/lib/tgchat/ext/td/td/telegram/Logging.cpp index 8cb7e70f..ae24d280 100644 --- a/lib/tgchat/ext/td/td/telegram/Logging.cpp +++ b/lib/tgchat/ext/td/td/telegram/Logging.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Logging.h b/lib/tgchat/ext/td/td/telegram/Logging.h index e1b286f9..9bbc8dc8 100644 --- a/lib/tgchat/ext/td/td/telegram/Logging.h +++ b/lib/tgchat/ext/td/td/telegram/Logging.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MediaArea.cpp b/lib/tgchat/ext/td/td/telegram/MediaArea.cpp index c20fab14..e176eee1 100644 --- a/lib/tgchat/ext/td/td/telegram/MediaArea.cpp +++ b/lib/tgchat/ext/td/td/telegram/MediaArea.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MediaArea.h b/lib/tgchat/ext/td/td/telegram/MediaArea.h index ed56a900..4acffa11 100644 --- a/lib/tgchat/ext/td/td/telegram/MediaArea.h +++ b/lib/tgchat/ext/td/td/telegram/MediaArea.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MediaArea.hpp b/lib/tgchat/ext/td/td/telegram/MediaArea.hpp index 06ce1161..505ea330 100644 --- a/lib/tgchat/ext/td/td/telegram/MediaArea.hpp +++ b/lib/tgchat/ext/td/td/telegram/MediaArea.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.cpp b/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.cpp index 0376d7ed..17294224 100644 --- a/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.cpp +++ b/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.h b/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.h index 90a86e79..991d968a 100644 --- a/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.h +++ b/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.hpp b/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.hpp index 6565fc01..032cff45 100644 --- a/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.hpp +++ b/lib/tgchat/ext/td/td/telegram/MediaAreaCoordinates.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageContent.cpp b/lib/tgchat/ext/td/td/telegram/MessageContent.cpp index e792c587..520583e9 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageContent.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageContent.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -75,6 +75,7 @@ #include "td/telegram/SharedDialog.hpp" #include "td/telegram/StarGift.h" #include "td/telegram/StarGift.hpp" +#include "td/telegram/StarGiftManager.h" #include "td/telegram/StarManager.h" #include "td/telegram/StickerFormat.h" #include "td/telegram/StickersManager.h" @@ -513,7 +514,7 @@ class MessageChatSetTtl final : public MessageContent { class MessageUnsupported final : public MessageContent { public: - static constexpr int32 CURRENT_VERSION = 38; + static constexpr int32 CURRENT_VERSION = 39; int32 version = CURRENT_VERSION; MessageUnsupported() = default; @@ -1249,19 +1250,30 @@ class MessageStarGift final : public MessageContent { StarGift star_gift; FormattedText text; int64 convert_star_count = 0; + int64 upgrade_star_count = 0; + MessageId upgrade_message_id; bool name_hidden = false; bool is_saved = false; + bool can_upgrade = false; bool was_converted = false; + bool was_upgraded = false; + bool was_refunded = false; MessageStarGift() = default; - MessageStarGift(StarGift &&star_gift, FormattedText &&text, int64 convert_star_count, bool name_hidden, bool is_saved, - bool was_converted) + MessageStarGift(StarGift &&star_gift, FormattedText &&text, int64 convert_star_count, int64 upgrade_star_count, + MessageId upgrade_message_id, bool name_hidden, bool is_saved, bool can_upgrade, bool was_converted, + bool was_upgraded, bool was_refunded) : star_gift(std::move(star_gift)) , text(std::move(text)) , convert_star_count(convert_star_count) + , upgrade_star_count(upgrade_star_count) + , upgrade_message_id(upgrade_message_id) , name_hidden(name_hidden) , is_saved(is_saved) - , was_converted(was_converted) { + , can_upgrade(can_upgrade) + , was_converted(was_converted) + , was_upgraded(was_upgraded) + , was_refunded(was_refunded) { } MessageContentType get_type() const final { @@ -1269,6 +1281,35 @@ class MessageStarGift final : public MessageContent { } }; +class MessageStarGiftUnique final : public MessageContent { + public: + StarGift star_gift; + int64 transfer_star_count = 0; + int32 can_export_at = 0; + bool is_saved = false; + bool is_upgrade = false; + bool can_transfer = false; + bool was_transferred = false; + bool was_refunded = false; + + MessageStarGiftUnique() = default; + MessageStarGiftUnique(StarGift &&star_gift, int64 transfer_star_count, int32 can_export_at, bool is_saved, + bool is_upgrade, bool can_transfer, bool was_transferred, bool was_refunded) + : star_gift(std::move(star_gift)) + , transfer_star_count(transfer_star_count) + , can_export_at(can_export_at) + , is_saved(is_saved) + , is_upgrade(is_upgrade) + , can_transfer(can_transfer) + , was_transferred(was_transferred) + , was_refunded(was_refunded) { + } + + MessageContentType get_type() const final { + return MessageContentType::StarGiftUnique; + } +}; + template static void store(const MessageContent *content, StorerT &storer) { CHECK(content != nullptr); @@ -1501,7 +1542,7 @@ static void store(const MessageContent *content, StorerT &storer) { END_STORE_FLAGS(); store(m->call_id, storer); store(m->duration, storer); - store(m->discard_reason, storer); + store(m->discard_reason.type_, storer); break; } case MessageContentType::PaymentSuccessful: { @@ -1952,17 +1993,52 @@ static void store(const MessageContent *content, StorerT &storer) { case MessageContentType::StarGift: { const auto *m = static_cast(content); bool has_text = !m->text.text.empty(); + bool has_upgrade_star_count = m->upgrade_star_count != 0; + bool has_upgrade_message_id = m->upgrade_message_id.is_valid(); BEGIN_STORE_FLAGS(); STORE_FLAG(m->name_hidden); STORE_FLAG(m->is_saved); STORE_FLAG(m->was_converted); STORE_FLAG(has_text); + STORE_FLAG(m->was_upgraded); + STORE_FLAG(m->can_upgrade); + STORE_FLAG(has_upgrade_star_count); + STORE_FLAG(m->was_refunded); + STORE_FLAG(has_upgrade_message_id); END_STORE_FLAGS(); store(m->star_gift, storer); if (has_text) { store(m->text, storer); } store(m->convert_star_count, storer); + if (has_upgrade_star_count) { + store(m->upgrade_star_count, storer); + } + if (has_upgrade_message_id) { + store(m->upgrade_message_id, storer); + } + break; + } + case MessageContentType::StarGiftUnique: { + const auto *m = static_cast(content); + bool has_transfer_star_count = m->transfer_star_count != 0; + bool has_can_export_at = m->can_export_at != 0; + BEGIN_STORE_FLAGS(); + STORE_FLAG(has_transfer_star_count); + STORE_FLAG(has_can_export_at); + STORE_FLAG(m->is_saved); + STORE_FLAG(m->is_upgrade); + STORE_FLAG(m->was_transferred); + STORE_FLAG(m->can_transfer); + STORE_FLAG(m->was_refunded); + END_STORE_FLAGS(); + store(m->star_gift, storer); + if (has_transfer_star_count) { + store(m->transfer_star_count, storer); + } + if (has_can_export_at) { + store(m->can_export_at, storer); + } break; } default: @@ -2305,7 +2381,7 @@ static void parse(unique_ptr &content, ParserT &parser) { } parse(m->call_id, parser); parse(m->duration, parser); - parse(m->discard_reason, parser); + parse(m->discard_reason.type_, parser); content = std::move(m); break; } @@ -2860,18 +2936,58 @@ static void parse(unique_ptr &content, ParserT &parser) { case MessageContentType::StarGift: { auto m = make_unique(); bool has_text; + bool has_upgrade_star_count; + bool has_upgrade_message_id; BEGIN_PARSE_FLAGS(); PARSE_FLAG(m->name_hidden); PARSE_FLAG(m->is_saved); PARSE_FLAG(m->was_converted); PARSE_FLAG(has_text); + PARSE_FLAG(m->was_upgraded); + PARSE_FLAG(m->can_upgrade); + PARSE_FLAG(has_upgrade_star_count); + PARSE_FLAG(m->was_refunded); + PARSE_FLAG(has_upgrade_message_id); END_PARSE_FLAGS(); parse(m->star_gift, parser); if (has_text) { parse(m->text, parser); } parse(m->convert_star_count, parser); - if (!m->star_gift.is_valid()) { + if (has_upgrade_star_count) { + parse(m->upgrade_star_count, parser); + } + if (has_upgrade_message_id) { + parse(m->upgrade_message_id, parser); + } + if (!m->star_gift.is_valid() || m->star_gift.is_unique()) { + is_bad = true; + break; + } + content = std::move(m); + break; + } + case MessageContentType::StarGiftUnique: { + auto m = make_unique(); + bool has_transfer_star_count; + bool has_can_export_at; + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(has_transfer_star_count); + PARSE_FLAG(has_can_export_at); + PARSE_FLAG(m->is_saved); + PARSE_FLAG(m->is_upgrade); + PARSE_FLAG(m->was_transferred); + PARSE_FLAG(m->can_transfer); + PARSE_FLAG(m->was_refunded); + END_PARSE_FLAGS(); + parse(m->star_gift, parser); + if (has_transfer_star_count) { + parse(m->transfer_star_count, parser); + } + if (has_can_export_at) { + parse(m->can_export_at, parser); + } + if (!m->star_gift.is_valid() || m->star_gift.is_unique() == m->was_refunded) { is_bad = true; break; } @@ -3476,7 +3592,7 @@ Result get_input_message_content( } case td_api::inputMessagePhoto::ID: { auto input_message = static_cast(input_message_content.get()); - file_type = FileType::Photo; + file_type = input_message->self_destruct_type_ != nullptr ? FileType::SelfDestructingPhoto : FileType::Photo; input_file = std::move(input_message->photo_); input_thumbnail = std::move(input_message->thumbnail_); if (!input_message->added_sticker_file_ids_.empty()) { @@ -3493,7 +3609,7 @@ Result get_input_message_content( } case td_api::inputMessageVideo::ID: { auto input_message = static_cast(input_message_content.get()); - file_type = FileType::Video; + file_type = input_message->self_destruct_type_ != nullptr ? FileType::SelfDestructingVideoNote : FileType::Video; input_file = std::move(input_message->video_); input_thumbnail = std::move(input_message->thumbnail_); if (!input_message->added_sticker_file_ids_.empty()) { @@ -3503,14 +3619,16 @@ Result get_input_message_content( } case td_api::inputMessageVideoNote::ID: { auto input_message = static_cast(input_message_content.get()); - file_type = FileType::VideoNote; + file_type = + input_message->self_destruct_type_ != nullptr ? FileType::SelfDestructingVideoNote : FileType::VideoNote; input_file = std::move(input_message->video_note_); input_thumbnail = std::move(input_message->thumbnail_); break; } case td_api::inputMessageVoiceNote::ID: { auto input_message = static_cast(input_message_content.get()); - file_type = FileType::VoiceNote; + file_type = + input_message->self_destruct_type_ != nullptr ? FileType::SelfDestructingVoiceNote : FileType::VoiceNote; input_file = std::move(input_message->voice_note_); break; } @@ -3645,6 +3763,7 @@ bool can_message_content_have_input_media(const Td *td, const MessageContent *co case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; case MessageContentType::Animation: case MessageContentType::Audio: @@ -3792,6 +3911,7 @@ SecretInputMedia get_message_content_secret_input_media( case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: break; default: UNREACHABLE(); @@ -3967,6 +4087,7 @@ static telegram_api::object_ptr get_message_content_in case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: break; default: UNREACHABLE(); @@ -4048,7 +4169,8 @@ telegram_api::object_ptr get_message_content_fake_inpu } string mime_type = MimeType::from_extension(path_view.extension()); int32 flags = 0; - if (file_type == FileType::Video || file_type == FileType::VideoStory) { + if (file_type == FileType::Video || file_type == FileType::VideoStory || + file_type == FileType::SelfDestructingVideo) { flags |= telegram_api::inputMediaUploadedDocument::NOSOUND_VIDEO_MASK; } if (file_type == FileType::DocumentAsFile) { @@ -4058,7 +4180,8 @@ telegram_api::object_ptr get_message_content_fake_inpu flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_file), nullptr, mime_type, std::move(attributes), vector>(), 0); } else { - CHECK(file_type == FileType::Photo || file_type == FileType::PhotoStory); + CHECK(file_type == FileType::Photo || file_type == FileType::PhotoStory || + file_type == FileType::SelfDestructingPhoto); int32 flags = 0; return telegram_api::make_object( flags, false /*ignored*/, std::move(input_file), @@ -4223,6 +4346,7 @@ void delete_message_content_thumbnail(MessageContent *content, Td *td, int32 med case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: break; default: UNREACHABLE(); @@ -4444,6 +4568,7 @@ Status can_send_message_content(DialogId dialog_id, const MessageContent *conten case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: UNREACHABLE(); } return Status::OK(); @@ -4528,8 +4653,8 @@ static int32 get_message_content_media_index_mask(const MessageContent *content, case MessageContentType::Call: { int32 index_mask = message_search_filter_index_mask(MessageSearchFilter::Call); const auto *m = static_cast(content); - if (!is_outgoing && - (m->discard_reason == CallDiscardReason::Declined || m->discard_reason == CallDiscardReason::Missed)) { + if (!is_outgoing && (m->discard_reason.type_ == CallDiscardReason::Type::Declined || + m->discard_reason.type_ == CallDiscardReason::Type::Missed)) { index_mask |= message_search_filter_index_mask(MessageSearchFilter::MissedCall); } return index_mask; @@ -4597,6 +4722,7 @@ static int32 get_message_content_media_index_mask(const MessageContent *content, case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return 0; default: UNREACHABLE(); @@ -4899,6 +5025,8 @@ vector get_message_content_min_user_ids(const Td *td, const MessageConte break; case MessageContentType::StarGift: break; + case MessageContentType::StarGiftUnique: + break; default: UNREACHABLE(); break; @@ -5329,6 +5457,7 @@ void merge_message_contents(Td *td, const MessageContent *old_content, MessageCo case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: break; default: UNREACHABLE(); @@ -5485,6 +5614,7 @@ bool merge_message_content_file_id(Td *td, MessageContent *message_content, File case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: LOG(ERROR) << "Receive new file " << new_file_id << " in a sent message of the type " << content_type; break; default: @@ -6091,8 +6221,22 @@ void compare_message_contents(Td *td, const MessageContent *old_content, const M const auto *lhs = static_cast(old_content); const auto *rhs = static_cast(new_content); if (lhs->star_gift != rhs->star_gift || lhs->text != rhs->text || - lhs->convert_star_count != rhs->convert_star_count || lhs->name_hidden != rhs->name_hidden || - lhs->is_saved != rhs->is_saved || lhs->was_converted != rhs->was_converted) { + lhs->convert_star_count != rhs->convert_star_count || lhs->upgrade_star_count != rhs->upgrade_star_count || + lhs->upgrade_message_id != rhs->upgrade_message_id || lhs->name_hidden != rhs->name_hidden || + lhs->is_saved != rhs->is_saved || lhs->can_upgrade != rhs->can_upgrade || + lhs->was_converted != rhs->was_converted || lhs->was_upgraded != rhs->was_upgraded || + lhs->was_refunded != rhs->was_refunded) { + need_update = true; + } + break; + } + case MessageContentType::StarGiftUnique: { + const auto *lhs = static_cast(old_content); + const auto *rhs = static_cast(new_content); + if (lhs->star_gift != rhs->star_gift || lhs->transfer_star_count != rhs->transfer_star_count || + lhs->can_export_at != rhs->can_export_at || lhs->is_saved != rhs->is_saved || + lhs->is_upgrade != rhs->is_upgrade || lhs->can_transfer != rhs->can_transfer || + lhs->was_transferred != rhs->was_transferred || lhs->was_refunded != rhs->was_refunded) { need_update = true; } break; @@ -6181,6 +6325,16 @@ void register_message_content(Td *td, const MessageContent *content, MessageFull auto star_count = static_cast(content)->star_count; return td->stickers_manager_->register_premium_gift(0, star_count, message_full_id, source); } + case MessageContentType::StarGift: { + auto star_gift = static_cast(content); + td->star_gift_manager_->on_get_star_gift(star_gift->star_gift, false); + return td->star_gift_manager_->register_gift(message_full_id, source); + } + case MessageContentType::StarGiftUnique: { + auto star_gift = static_cast(content); + td->star_gift_manager_->on_get_star_gift(star_gift->star_gift, false); + return td->star_gift_manager_->register_gift(message_full_id, source); + } default: return; } @@ -6329,6 +6483,10 @@ void unregister_message_content(Td *td, const MessageContent *content, MessageFu auto star_count = static_cast(content)->star_count; return td->stickers_manager_->unregister_premium_gift(0, star_count, message_full_id, source); } + case MessageContentType::StarGift: + return td->star_gift_manager_->unregister_gift(message_full_id, source); + case MessageContentType::StarGiftUnique: + return td->star_gift_manager_->unregister_gift(message_full_id, source); default: return; } @@ -6596,13 +6754,14 @@ static unique_ptr get_document_message_content(Document &&parsed } static unique_ptr get_document_message_content(Td *td, tl_object_ptr &&document, - DialogId owner_dialog_id, FormattedText &&caption, - bool is_opened, bool is_premium, bool has_spoiler, - vector &&alternative_file_ids, + DialogId owner_dialog_id, bool is_self_destructing, + FormattedText &&caption, bool is_opened, bool is_premium, + bool has_spoiler, vector &&alternative_file_ids, vector &&hls_file_ids, MultiPromiseActor *load_data_multipromise_ptr) { return get_document_message_content( - td->documents_manager_->on_get_document(std::move(document), owner_dialog_id, load_data_multipromise_ptr), + td->documents_manager_->on_get_document(std::move(document), owner_dialog_id, is_self_destructing, + load_data_multipromise_ptr), std::move(caption), is_opened, is_premium, has_spoiler, std::move(alternative_file_ids), std::move(hls_file_ids)); } @@ -6768,7 +6927,7 @@ unique_ptr get_secret_message_content( } case secret_api::decryptedMessageMediaExternalDocument::ID: { auto media = move_tl_object_as(media_ptr); - return get_document_message_content(td, secret_to_telegram_document(*media), owner_dialog_id, + return get_document_message_content(td, secret_to_telegram_document(*media), owner_dialog_id, false, FormattedText{std::move(message_text), std::move(entities)}, false, is_premium, false, {}, {}, &load_data_multipromise); } @@ -6809,7 +6968,7 @@ unique_ptr get_secret_message_content( media->attributes_.clear(); auto document = td->documents_manager_->on_get_document( - {std::move(file), std::move(media), std::move(attributes)}, owner_dialog_id); + {std::move(file), std::move(media), std::move(attributes)}, owner_dialog_id, false); return get_document_message_content(std::move(document), {std::move(message_text), std::move(entities)}, false, false, false, {}, {}); } @@ -6854,12 +7013,14 @@ unique_ptr get_message_content(Td *td, FormattedText message, return make_unique(); } - auto photo = get_photo(td, std::move(media->photo_), owner_dialog_id); + bool is_self_destructing = (media->flags_ & telegram_api::messageMediaPhoto::TTL_SECONDS_MASK) != 0; + auto photo = get_photo(td, std::move(media->photo_), owner_dialog_id, + is_self_destructing ? FileType::SelfDestructingPhoto : FileType::Photo); if (photo.is_empty()) { return make_unique(); } - if (ttl != nullptr && (media->flags_ & telegram_api::messageMediaPhoto::TTL_SECONDS_MASK) != 0) { + if (ttl != nullptr && is_self_destructing) { *ttl = MessageSelfDestructType(media->ttl_seconds_, true); } return make_unique(std::move(photo), std::move(message), media->spoiler_); @@ -6950,7 +7111,8 @@ unique_ptr get_message_content(Td *td, FormattedText message, } CHECK(document_id == telegram_api::document::ID); - if (ttl != nullptr && (media->flags_ & telegram_api::messageMediaDocument::TTL_SECONDS_MASK) != 0) { + bool is_self_destructing = (media->flags_ & telegram_api::messageMediaDocument::TTL_SECONDS_MASK) != 0; + if (ttl != nullptr && is_self_destructing) { *ttl = MessageSelfDestructType(media->ttl_seconds_, true); } vector alternative_file_ids; @@ -6963,7 +7125,7 @@ unique_ptr get_message_content(Td *td, FormattedText message, CHECK(alt_document_id == telegram_api::document::ID); auto document = move_tl_object_as(alt_document_ptr); if (document->mime_type_ == "application/x-mpegurl") { - auto parsed_hls_file = td->documents_manager_->on_get_document(std::move(document), owner_dialog_id); + auto parsed_hls_file = td->documents_manager_->on_get_document(std::move(document), owner_dialog_id, false); if (parsed_hls_file.empty() || parsed_hls_file.type != Document::Type::General) { LOG(ERROR) << "Receive invalid HLS file " << parsed_hls_file; } else { @@ -6972,7 +7134,7 @@ unique_ptr get_message_content(Td *td, FormattedText message, continue; } auto parsed_alt_document = td->documents_manager_->on_get_document(std::move(document), owner_dialog_id, - nullptr, Document::Type::Video); + false, nullptr, Document::Type::Video); if (parsed_alt_document.empty() || parsed_alt_document.type != Document::Type::Video) { LOG(ERROR) << "Receive invalid alternative video " << parsed_alt_document; } else { @@ -6981,8 +7143,9 @@ unique_ptr get_message_content(Td *td, FormattedText message, } } return get_document_message_content(td, move_tl_object_as(document_ptr), owner_dialog_id, - std::move(message), is_content_read, !media->nopremium_, media->spoiler_, - std::move(alternative_file_ids), std::move(hls_file_ids), nullptr); + is_self_destructing, std::move(message), is_content_read, !media->nopremium_, + media->spoiler_, std::move(alternative_file_ids), std::move(hls_file_ids), + nullptr); } case telegram_api::messageMediaGame::ID: { auto media = move_tl_object_as(media_ptr); @@ -7340,6 +7503,7 @@ unique_ptr dup_message_content(Td *td, DialogId dialog_id, const case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return nullptr; default: UNREACHABLE(); @@ -7381,7 +7545,6 @@ unique_ptr get_action_message_content(Td *td, tl_object_ptr get_action_message_content(Td *td, tl_object_ptr get_action_message_content(Td *td, tl_object_ptr(action_ptr); - StarGift star_gift(td, std::move(action->gift_)); - if (!star_gift.is_valid()) { + StarGift star_gift(td, std::move(action->gift_), false); + if (!star_gift.is_valid() || star_gift.is_unique()) { break; } + auto upgrade_message_id = MessageId(ServerMessageId(action->upgrade_msg_id_)); + if (upgrade_message_id != MessageId() && !upgrade_message_id.is_valid()) { + LOG(ERROR) << "Receive " << upgrade_message_id; + upgrade_message_id = MessageId(); + } FormattedText text = get_formatted_text(td->user_manager_.get(), std::move(action->message_), true, false, "messageActionStarGift"); - return td::make_unique(std::move(star_gift), std::move(text), - StarManager::get_star_count(action->convert_stars_), action->name_hidden_, - action->saved_, action->converted_); + return td::make_unique( + std::move(star_gift), std::move(text), StarManager::get_star_count(action->convert_stars_), + StarManager::get_star_count(action->upgrade_stars_), upgrade_message_id, action->name_hidden_, action->saved_, + action->can_upgrade_, action->converted_, action->upgraded_, action->refunded_); + } + case telegram_api::messageActionStarGiftUnique::ID: { + auto action = move_tl_object_as(action_ptr); + StarGift star_gift(td, std::move(action->gift_), true); + if (!star_gift.is_valid() || star_gift.is_unique() == action->refunded_) { + break; + } + return td::make_unique( + std::move(star_gift), StarManager::get_star_count(action->transfer_stars_), max(0, action->can_export_at_), + action->saved_, action->upgrade_, + (action->flags_ & telegram_api::messageActionStarGiftUnique::TRANSFER_STARS_MASK) != 0, action->transferred_, + action->refunded_); } default: UNREACHABLE(); @@ -7997,10 +8180,12 @@ td_api::object_ptr get_message_content_object(const Mess case MessageContentType::Video: { const auto *m = static_cast(content); vector> alternative_videos; - for (auto file_id : m->alternative_file_ids) { - auto video = td->videos_manager_->get_alternative_video_object(file_id, m->hls_file_ids); - if (video != nullptr) { - alternative_videos.push_back(std::move(video)); + if (!td->option_manager_->get_option_boolean("video_ignore_alt_documents")) { + for (auto file_id : m->alternative_file_ids) { + auto video = td->videos_manager_->get_alternative_video_object(file_id, m->hls_file_ids); + if (video != nullptr) { + alternative_videos.push_back(std::move(video)); + } } } return make_tl_object(td->videos_manager_->get_video_object(m->file_id), @@ -8365,8 +8550,19 @@ td_api::object_ptr get_message_content_object(const Mess case MessageContentType::StarGift: { const auto *m = static_cast(content); return td_api::make_object(m->star_gift.get_gift_object(td), get_text_object(m->text), - m->convert_star_count, m->name_hidden, m->is_saved, - m->was_converted); + m->convert_star_count, m->upgrade_star_count, m->name_hidden, + m->is_saved, m->can_upgrade, m->was_converted, m->was_upgraded, + m->was_refunded, m->upgrade_message_id.get()); + } + case MessageContentType::StarGiftUnique: { + const auto *m = static_cast(content); + if (m->was_refunded) { + return td_api::make_object(m->star_gift.get_gift_object(td), + m->is_upgrade); + } + return td_api::make_object(m->star_gift.get_upgraded_gift_object(td), m->is_upgrade, + m->is_saved, m->can_transfer, m->was_transferred, + m->transfer_star_count, m->can_export_at); } default: UNREACHABLE(); @@ -8376,6 +8572,36 @@ td_api::object_ptr get_message_content_object(const Mess return nullptr; } +td_api::object_ptr get_message_content_upgrade_gift_result_object( + const MessageContent *content, Td *td) { + switch (content->get_type()) { + case MessageContentType::StarGiftUnique: { + const auto *m = static_cast(content); + return td_api::make_object(m->star_gift.get_upgraded_gift_object(td), m->is_saved, + m->can_transfer, m->transfer_star_count, m->can_export_at); + } + default: + UNREACHABLE(); + return nullptr; + } +} + +int64 get_message_content_gift_upgrade_star_count(const MessageContent *content) { + switch (content->get_type()) { + case MessageContentType::StarGift: { + const auto *m = static_cast(content); + if (m->upgrade_star_count > 0) { + // upgrade was prepaid + return 0; + } + return m->star_gift.get_upgrade_star_count(); + } + default: + UNREACHABLE(); + return -1; + } +} + FormattedText *get_message_content_text_mutable(MessageContent *content) { return const_cast(get_message_content_text(content)); } @@ -8460,7 +8686,9 @@ unique_ptr get_uploaded_message_content( auto content = make_unique(*paid_media); auto media = MessageExtendedMedia(td, std::move(media_ptr), owner_dialog_id); if (!media.has_input_media()) { - LOG(ERROR) << "Receive invalid uploaded paid media"; + if (!media.is_unsupported()) { + LOG(ERROR) << "Receive invalid uploaded paid media"; + } } else { bool is_content_changed = false; bool need_update = false; @@ -9342,6 +9570,8 @@ void add_message_content_dependencies(Dependencies &dependencies, const MessageC } case MessageContentType::StarGift: break; + case MessageContentType::StarGiftUnique: + break; default: UNREACHABLE(); break; diff --git a/lib/tgchat/ext/td/td/telegram/MessageContent.h b/lib/tgchat/ext/td/td/telegram/MessageContent.h index 29f9f721..44e7d2e6 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageContent.h +++ b/lib/tgchat/ext/td/td/telegram/MessageContent.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -275,6 +275,11 @@ td_api::object_ptr get_message_content_object(const Mess int32 max_media_timestamp, bool invert_media, bool disable_web_page_preview); +td_api::object_ptr get_message_content_upgrade_gift_result_object( + const MessageContent *content, Td *td); + +int64 get_message_content_gift_upgrade_star_count(const MessageContent *content); + FormattedText *get_message_content_text_mutable(MessageContent *content); const FormattedText *get_message_content_text(const MessageContent *content); diff --git a/lib/tgchat/ext/td/td/telegram/MessageContentType.cpp b/lib/tgchat/ext/td/td/telegram/MessageContentType.cpp index 20718b7b..c9c446ba 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageContentType.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageContentType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -156,6 +156,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, MessageContentType cont return string_builder << "PrizeStars"; case MessageContentType::StarGift: return string_builder << "StarGift"; + case MessageContentType::StarGiftUnique: + return string_builder << "UpgradedStarGift"; default: return string_builder << "Invalid type " << static_cast(content_type); } @@ -248,6 +250,7 @@ bool is_allowed_media_group_content(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; default: UNREACHABLE(); @@ -334,6 +337,7 @@ bool can_be_secret_message_content(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; default: UNREACHABLE(); @@ -416,6 +420,7 @@ bool can_be_local_message_content(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; default: UNREACHABLE(); @@ -498,6 +503,7 @@ bool is_service_message_content(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return true; default: UNREACHABLE(); @@ -580,6 +586,7 @@ bool is_editable_message_content(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; default: UNREACHABLE(); @@ -726,6 +733,7 @@ bool can_have_message_content_caption(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: return false; default: UNREACHABLE(); @@ -810,6 +818,7 @@ bool can_send_message_content_to_secret_chat(MessageContentType content_type) { case MessageContentType::GiftStars: case MessageContentType::PrizeStars: case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: default: UNREACHABLE(); return false; @@ -834,4 +843,87 @@ uint64 get_message_content_chain_id(MessageContentType content_type) { } } +bool get_default_service_message_content_reactions_are_possible(MessageContentType content_type) { + switch (content_type) { + case MessageContentType::Animation: + case MessageContentType::Audio: + case MessageContentType::Contact: + case MessageContentType::Dice: + case MessageContentType::Document: + case MessageContentType::ExpiredPhoto: + case MessageContentType::ExpiredVideo: + case MessageContentType::ExpiredVideoNote: + case MessageContentType::ExpiredVoiceNote: + case MessageContentType::Game: + case MessageContentType::Giveaway: + case MessageContentType::GiveawayWinners: + case MessageContentType::Invoice: + case MessageContentType::LiveLocation: + case MessageContentType::Location: + case MessageContentType::PaidMedia: + case MessageContentType::Photo: + case MessageContentType::Poll: + case MessageContentType::Sticker: + case MessageContentType::Story: + case MessageContentType::Text: + case MessageContentType::Unsupported: + case MessageContentType::Venue: + case MessageContentType::Video: + case MessageContentType::VideoNote: + case MessageContentType::VoiceNote: + case MessageContentType::ChatCreate: + case MessageContentType::ChatDeleteHistory: + case MessageContentType::ChatMigrateTo: + case MessageContentType::ChannelCreate: + case MessageContentType::ChannelMigrateFrom: + case MessageContentType::CustomServiceAction: + case MessageContentType::PassportDataSent: + case MessageContentType::PassportDataReceived: + case MessageContentType::WebViewDataSent: + case MessageContentType::WebViewDataReceived: + case MessageContentType::RequestedDialog: + case MessageContentType::GiveawayLaunch: + case MessageContentType::DialogShared: + return false; + case MessageContentType::ChatChangeTitle: + case MessageContentType::ChatChangePhoto: + case MessageContentType::ChatDeletePhoto: + case MessageContentType::ChatAddUsers: + case MessageContentType::ChatJoinedByLink: + case MessageContentType::ChatDeleteUser: + case MessageContentType::PinMessage: + case MessageContentType::GameScore: + case MessageContentType::ScreenshotTaken: + case MessageContentType::ChatSetTtl: + case MessageContentType::Call: + case MessageContentType::PaymentSuccessful: + case MessageContentType::ContactRegistered: + case MessageContentType::WebsiteConnected: + case MessageContentType::ProximityAlertTriggered: + case MessageContentType::GroupCall: + case MessageContentType::InviteToGroupCall: + case MessageContentType::ChatSetTheme: + case MessageContentType::GiftPremium: + case MessageContentType::TopicCreate: + case MessageContentType::TopicEdit: + case MessageContentType::SuggestProfilePhoto: + case MessageContentType::WriteAccessAllowed: + case MessageContentType::WebViewWriteAccessAllowed: + case MessageContentType::SetBackground: + case MessageContentType::WriteAccessAllowedByRequest: + case MessageContentType::GiftCode: + case MessageContentType::GiveawayResults: + case MessageContentType::BoostApply: + case MessageContentType::PaymentRefunded: + case MessageContentType::GiftStars: + case MessageContentType::PrizeStars: + case MessageContentType::StarGift: + case MessageContentType::StarGiftUnique: + return true; + default: + UNREACHABLE(); + return false; + } +} + } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/MessageContentType.h b/lib/tgchat/ext/td/td/telegram/MessageContentType.h index 4e078e31..95fd3cb3 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageContentType.h +++ b/lib/tgchat/ext/td/td/telegram/MessageContentType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -85,7 +85,8 @@ enum class MessageContentType : int32 { PaymentRefunded, GiftStars, PrizeStars, - StarGift + StarGift, + StarGiftUnique }; // increase MessageUnsupported::CURRENT_VERSION each time a new message content type is added @@ -117,6 +118,8 @@ bool can_send_message_content_to_secret_chat(MessageContentType content_type); uint64 get_message_content_chain_id(MessageContentType content_type); +bool get_default_service_message_content_reactions_are_possible(MessageContentType content_type); + struct MessageContentTypeHash { uint32 operator()(MessageContentType content_type) const { return Hash()(static_cast(content_type)); diff --git a/lib/tgchat/ext/td/td/telegram/MessageCopyOptions.h b/lib/tgchat/ext/td/td/telegram/MessageCopyOptions.h index 33051b01..365b1a4b 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageCopyOptions.h +++ b/lib/tgchat/ext/td/td/telegram/MessageCopyOptions.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,6 +7,7 @@ #pragma once #include "td/telegram/MessageEntity.h" +#include "td/telegram/MessageId.h" #include "td/telegram/MessageInputReplyTo.h" #include "td/telegram/ReplyMarkup.h" @@ -27,11 +28,15 @@ struct MessageCopyOptions { MessageCopyOptions(bool send_copy, bool remove_caption) : send_copy(send_copy), replace_caption(remove_caption) { } - bool is_supported_server_side() const { + bool is_supported_server_side(MessageId top_thread_message_id) const { if (!send_copy) { return true; } - if ((replace_caption && !new_caption.text.empty()) || input_reply_to.is_valid() || reply_markup != nullptr) { + if ((replace_caption && !new_caption.text.empty()) || reply_markup != nullptr) { + return false; + } + if (input_reply_to.is_valid() && (top_thread_message_id == MessageId() || input_reply_to.has_quote() || + input_reply_to.get_same_chat_reply_to_message_id() != top_thread_message_id)) { return false; } return true; diff --git a/lib/tgchat/ext/td/td/telegram/MessageDb.cpp b/lib/tgchat/ext/td/td/telegram/MessageDb.cpp index 6277b2e9..dc04ca91 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageDb.h b/lib/tgchat/ext/td/td/telegram/MessageDb.h index 412fc245..c6f6424c 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageDb.h +++ b/lib/tgchat/ext/td/td/telegram/MessageDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageEffectId.h b/lib/tgchat/ext/td/td/telegram/MessageEffectId.h index f41017e8..9aa7e9e7 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageEffectId.h +++ b/lib/tgchat/ext/td/td/telegram/MessageEffectId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageEntity.cpp b/lib/tgchat/ext/td/td/telegram/MessageEntity.cpp index a470273e..52c4bd43 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageEntity.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageEntity.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -4235,7 +4235,7 @@ static std::pair remove_invalid_entities(const string &text, vect return {last_non_whitespace_pos, last_non_whitespace_utf16_offset}; } -// enitities must contain only splittable entities +// entities must contain only splittable entities static void split_entities(vector &entities, const vector &other_entities) { check_is_sorted(entities); check_is_sorted(other_entities); @@ -4494,8 +4494,12 @@ Status fix_formatted_text(string &text, vector &entities, bool al } LOG_CHECK(check_utf8(text)) << text; - if (!allow_empty && is_empty_string(text)) { - return Status::Error(400, "Text must be non-empty"); + if (is_empty_string(text)) { + if (!allow_empty) { + return Status::Error(400, "Text must be non-empty"); + } + text.clear(); + entities.clear(); } constexpr size_t LENGTH_LIMIT = 35000; // server side limit @@ -4752,6 +4756,11 @@ vector> get_input_message_entities(co return {}; } +void keep_only_custom_emoji(FormattedText &text) { + td::remove_if(text.entities, + [&](const MessageEntity &entity) { return entity.type != MessageEntity::Type::CustomEmoji; }); +} + void remove_premium_custom_emoji_entities(const Td *td, vector &entities, bool remove_unknown) { td::remove_if(entities, [&](const MessageEntity &entity) { return entity.type == MessageEntity::Type::CustomEmoji && diff --git a/lib/tgchat/ext/td/td/telegram/MessageEntity.h b/lib/tgchat/ext/td/td/telegram/MessageEntity.h index c310076a..58a3c82f 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageEntity.h +++ b/lib/tgchat/ext/td/td/telegram/MessageEntity.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -168,6 +168,8 @@ td_api::object_ptr get_formatted_text_object(const UserMa const FormattedText &text, bool skip_bot_commands, int32 max_media_timestamp); +void keep_only_custom_emoji(FormattedText &text); + void remove_premium_custom_emoji_entities(const Td *td, vector &entities, bool remove_unknown); void remove_unallowed_entities(const Td *td, FormattedText &text, DialogId dialog_id); diff --git a/lib/tgchat/ext/td/td/telegram/MessageEntity.hpp b/lib/tgchat/ext/td/td/telegram/MessageEntity.hpp index a6d95261..175ab99f 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageEntity.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageEntity.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.cpp b/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.cpp index f3e490d0..85851e03 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -94,7 +94,7 @@ void MessageExtendedMedia::init_from_media(Td *td, telegram_api::object_ptrdocuments_manager_->on_get_document( - move_tl_object_as(document_ptr), owner_dialog_id); + move_tl_object_as(document_ptr), owner_dialog_id, false); if (parsed_document.empty() || parsed_document.type != Document::Type::Video) { break; } diff --git a/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.h b/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.h index b953e81a..2440a9f7 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.h +++ b/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -80,6 +80,10 @@ class MessageExtendedMedia { void delete_thumbnail(Td *td); + bool is_unsupported() const { + return type_ == Type::Unsupported; + } + bool need_reget() const { return type_ == Type::Unsupported && unsupported_version_ < CURRENT_VERSION; } diff --git a/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.hpp b/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.hpp index eaa4a9e7..4208b38e 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageExtendedMedia.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.cpp b/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.cpp index d3312d40..c214c297 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.h b/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.h index fd29c863..9bc984ea 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.h +++ b/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.hpp b/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.hpp index 9a2ad859..02e418ec 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageForwardInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageFullId.h b/lib/tgchat/ext/td/td/telegram/MessageFullId.h index 5ed2fa0a..4b79d1e9 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageFullId.h +++ b/lib/tgchat/ext/td/td/telegram/MessageFullId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -45,6 +45,10 @@ struct MessageFullId { } static MessageFullId get_message_full_id(const tl_object_ptr &message_ptr, bool is_scheduled) { + return get_message_full_id(message_ptr.get(), is_scheduled); + } + + static MessageFullId get_message_full_id(const telegram_api::Message *message_ptr, bool is_scheduled) { return {DialogId::get_message_dialog_id(message_ptr), MessageId::get_message_id(message_ptr, is_scheduled)}; } diff --git a/lib/tgchat/ext/td/td/telegram/MessageId.cpp b/lib/tgchat/ext/td/td/telegram/MessageId.cpp index d4c568ac..e8a1bd94 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageId.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageId.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageId.h b/lib/tgchat/ext/td/td/telegram/MessageId.h index 23386e7f..c832e973 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageId.h +++ b/lib/tgchat/ext/td/td/telegram/MessageId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageImportManager.cpp b/lib/tgchat/ext/td/td/telegram/MessageImportManager.cpp index 1e920536..0bce37c9 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageImportManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageImportManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageImportManager.h b/lib/tgchat/ext/td/td/telegram/MessageImportManager.h index fd5812d2..6bc7f0a1 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageImportManager.h +++ b/lib/tgchat/ext/td/td/telegram/MessageImportManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.cpp b/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.cpp index 8b7065d6..9e1c6f96 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.h b/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.h index c0dfaba3..b96a10c2 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.h +++ b/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.hpp b/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.hpp index 54420463..5930e14b 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageInputReplyTo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageLinkInfo.h b/lib/tgchat/ext/td/td/telegram/MessageLinkInfo.h index f98a5c60..215165ba 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageLinkInfo.h +++ b/lib/tgchat/ext/td/td/telegram/MessageLinkInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageOrigin.cpp b/lib/tgchat/ext/td/td/telegram/MessageOrigin.cpp index 41843023..14c4d339 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageOrigin.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageOrigin.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageOrigin.h b/lib/tgchat/ext/td/td/telegram/MessageOrigin.h index afb45cd7..bdd5d155 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageOrigin.h +++ b/lib/tgchat/ext/td/td/telegram/MessageOrigin.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageOrigin.hpp b/lib/tgchat/ext/td/td/telegram/MessageOrigin.hpp index f5c233b2..1d96d159 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageOrigin.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageOrigin.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageQueryManager.cpp b/lib/tgchat/ext/td/td/telegram/MessageQueryManager.cpp new file mode 100644 index 00000000..5b702b2c --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/MessageQueryManager.cpp @@ -0,0 +1,550 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/MessageQueryManager.h" + +#include "td/telegram/AccessRights.h" +#include "td/telegram/DialogId.h" +#include "td/telegram/DialogManager.h" +#include "td/telegram/FolderId.h" +#include "td/telegram/Global.h" +#include "td/telegram/HashtagHints.h" +#include "td/telegram/MessageSearchOffset.h" +#include "td/telegram/MessagesInfo.h" +#include "td/telegram/MessagesManager.h" +#include "td/telegram/Td.h" +#include "td/telegram/telegram_api.h" + +#include "td/utils/algorithm.h" +#include "td/utils/buffer.h" +#include "td/utils/logging.h" +#include "td/utils/misc.h" +#include "td/utils/SliceBuilder.h" +#include "td/utils/Status.h" + +namespace td { + +class ReportMessageDeliveryQuery final : public Td::ResultHandler { + DialogId dialog_id_; + + public: + void send(MessageFullId message_full_id, bool from_push) { + dialog_id_ = message_full_id.get_dialog_id(); + auto input_peer = td_->dialog_manager_->get_input_peer(message_full_id.get_dialog_id(), AccessRights::Read); + if (input_peer == nullptr) { + return; + } + int32 flags = 0; + if (from_push) { + flags |= telegram_api::messages_reportMessagesDelivery::PUSH_MASK; + } + auto message_id = message_full_id.get_message_id(); + CHECK(message_id.is_valid()); + CHECK(message_id.is_server()); + send_query(G()->net_query_creator().create(telegram_api::messages_reportMessagesDelivery( + flags, false /*ignored*/, std::move(input_peer), {message_id.get_server_message_id().get()}))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + // ok + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ReportMessageDeliveryQuery"); + } +}; + +class SearchMessagesGlobalQuery final : public Td::ResultHandler { + Promise> promise_; + string query_; + int32 offset_date_; + DialogId offset_dialog_id_; + MessageId offset_message_id_; + int32 limit_; + MessageSearchFilter filter_; + int32 min_date_; + int32 max_date_; + + public: + explicit SearchMessagesGlobalQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(FolderId folder_id, bool ignore_folder_id, const string &query, int32 offset_date, + DialogId offset_dialog_id, MessageId offset_message_id, int32 limit, MessageSearchFilter filter, + const td_api::object_ptr &dialog_type_filter, int32 min_date, + int32 max_date) { + query_ = query; + offset_date_ = offset_date; + offset_dialog_id_ = offset_dialog_id; + offset_message_id_ = offset_message_id; + limit_ = limit; + filter_ = filter; + min_date_ = min_date; + max_date_ = max_date; + + auto input_peer = DialogManager::get_input_peer_force(offset_dialog_id); + CHECK(input_peer != nullptr); + + int32 flags = 0; + if (!ignore_folder_id) { + flags |= telegram_api::messages_searchGlobal::FOLDER_ID_MASK; + } + if (dialog_type_filter != nullptr) { + switch (dialog_type_filter->get_id()) { + case td_api::searchMessagesChatTypeFilterPrivate::ID: + flags |= telegram_api::messages_searchGlobal::USERS_ONLY_MASK; + break; + case td_api::searchMessagesChatTypeFilterGroup::ID: + flags |= telegram_api::messages_searchGlobal::GROUPS_ONLY_MASK; + break; + case td_api::searchMessagesChatTypeFilterChannel::ID: + flags |= telegram_api::messages_searchGlobal::BROADCASTS_ONLY_MASK; + break; + default: + UNREACHABLE(); + } + } + send_query(G()->net_query_creator().create(telegram_api::messages_searchGlobal( + flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, folder_id.get(), query, + get_input_messages_filter(filter), min_date_, max_date_, offset_date_, std::move(input_peer), + offset_message_id.get_server_message_id().get(), limit))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto info = get_messages_info(td_, DialogId(), result_ptr.move_as_ok(), "SearchMessagesGlobalQuery"); + td_->messages_manager_->get_channel_differences_if_needed( + std::move(info), + PromiseCreator::lambda([actor_id = td_->message_query_manager_actor_.get(), query = std::move(query_), + offset_date = offset_date_, offset_dialog_id = offset_dialog_id_, + offset_message_id = offset_message_id_, limit = limit_, filter = std::move(filter_), + min_date = min_date_, max_date = max_date_, + promise = std::move(promise_)](Result &&result) mutable { + if (result.is_error()) { + promise.set_error(result.move_as_error()); + } else { + auto info = result.move_as_ok(); + send_closure(actor_id, &MessageQueryManager::on_get_messages_search_result, query, offset_date, + offset_dialog_id, offset_message_id, limit, filter, min_date, max_date, info.total_count, + std::move(info.messages), info.next_rate, std::move(promise)); + } + }), + "SearchMessagesGlobalQuery"); + } + + void on_error(Status status) final { + if (status.message() == "SEARCH_QUERY_EMPTY") { + return promise_.set_value(td_->messages_manager_->get_found_messages_object({}, "SearchMessagesGlobalQuery")); + } + promise_.set_error(std::move(status)); + } +}; + +class SearchSentMediaQuery final : public Td::ResultHandler { + Promise> promise_; + + public: + explicit SearchSentMediaQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(const string &query, int32 limit) { + send_query(G()->net_query_creator().create(telegram_api::messages_searchSentMedia( + query, telegram_api::make_object(), limit))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto info = get_messages_info(td_, DialogId(), result_ptr.move_as_ok(), "SearchSentMediaQuery"); + td_->messages_manager_->get_channel_differences_if_needed( + std::move(info), + PromiseCreator::lambda([actor_id = td_->message_query_manager_actor_.get(), + promise = std::move(promise_)](Result &&result) mutable { + if (result.is_error()) { + promise.set_error(result.move_as_error()); + } else { + auto info = result.move_as_ok(); + send_closure(actor_id, &MessageQueryManager::on_get_outgoing_document_messages, std::move(info.messages), + std::move(promise)); + } + }), + "SearchSentMediaQuery"); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +class SearchPostsQuery final : public Td::ResultHandler { + Promise> promise_; + string hashtag_; + MessageSearchOffset offset_; + int32 limit_; + + public: + explicit SearchPostsQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(const string &hashtag, MessageSearchOffset offset, int32 limit) { + hashtag_ = hashtag; + offset_ = offset; + limit_ = limit; + + auto input_peer = DialogManager::get_input_peer_force(offset.dialog_id_); + CHECK(input_peer != nullptr); + + send_query(G()->net_query_creator().create(telegram_api::channels_searchPosts( + hashtag, offset.date_, std::move(input_peer), offset.message_id_.get_server_message_id().get(), limit))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto info = get_messages_info(td_, DialogId(), result_ptr.move_as_ok(), "SearchPostsQuery"); + td_->messages_manager_->get_channel_differences_if_needed( + std::move(info), + PromiseCreator::lambda([actor_id = td_->message_query_manager_actor_.get(), hashtag = std::move(hashtag_), + offset = offset_, limit = limit_, + promise = std::move(promise_)](Result &&result) mutable { + if (result.is_error()) { + promise.set_error(result.move_as_error()); + } else { + auto info = result.move_as_ok(); + send_closure(actor_id, &MessageQueryManager::on_get_hashtag_search_result, hashtag, offset, limit, + info.total_count, std::move(info.messages), info.next_rate, std::move(promise)); + } + }), + "SearchPostsQuery"); + } + + void on_error(Status status) final { + if (status.message() == "SEARCH_QUERY_EMPTY") { + return promise_.set_value(td_->messages_manager_->get_found_messages_object({}, "SearchPostsQuery")); + } + promise_.set_error(std::move(status)); + } +}; + +class GetRecentLocationsQuery final : public Td::ResultHandler { + Promise> promise_; + DialogId dialog_id_; + int32 limit_; + + public: + explicit GetRecentLocationsQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(DialogId dialog_id, int32 limit) { + dialog_id_ = dialog_id; + limit_ = limit; + + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); + CHECK(input_peer != nullptr); + + send_query( + G()->net_query_creator().create(telegram_api::messages_getRecentLocations(std::move(input_peer), limit, 0))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto info = get_messages_info(td_, dialog_id_, result_ptr.move_as_ok(), "GetRecentLocationsQuery"); + td_->messages_manager_->get_channel_difference_if_needed( + dialog_id_, std::move(info), + PromiseCreator::lambda([actor_id = td_->message_query_manager_actor_.get(), dialog_id = dialog_id_, + limit = limit_, promise = std::move(promise_)](Result &&result) mutable { + if (result.is_error()) { + promise.set_error(result.move_as_error()); + } else { + auto info = result.move_as_ok(); + send_closure(actor_id, &MessageQueryManager::on_get_recent_locations, dialog_id, limit, info.total_count, + std::move(info.messages), std::move(promise)); + } + }), + "GetRecentLocationsQuery"); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "GetRecentLocationsQuery"); + promise_.set_error(std::move(status)); + } +}; + +MessageQueryManager::MessageQueryManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { +} + +void MessageQueryManager::tear_down() { + parent_.reset(); +} + +void MessageQueryManager::report_message_delivery(MessageFullId message_full_id, int32 until_date, bool from_push) { + if (G()->unix_time() > until_date) { + return; + } + td_->create_handler()->send(message_full_id, from_push); +} + +void MessageQueryManager::search_messages(DialogListId dialog_list_id, bool ignore_folder_id, const string &query, + const string &offset_str, int32 limit, MessageSearchFilter filter, + td_api::object_ptr &&dialog_type_filter, + int32 min_date, int32 max_date, + Promise> &&promise) { + if (!dialog_list_id.is_folder()) { + return promise.set_error(Status::Error(400, "Wrong chat list specified")); + } + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Parameter limit must be positive")); + } + if (limit > MAX_SEARCH_MESSAGES) { + limit = MAX_SEARCH_MESSAGES; + } + + TRY_RESULT_PROMISE(promise, offset, MessageSearchOffset::from_string(offset_str)); + + CHECK(filter != MessageSearchFilter::Call && filter != MessageSearchFilter::MissedCall); + if (filter == MessageSearchFilter::Mention || filter == MessageSearchFilter::UnreadMention || + filter == MessageSearchFilter::UnreadReaction || filter == MessageSearchFilter::FailedToSend || + filter == MessageSearchFilter::Pinned) { + return promise.set_error(Status::Error(400, "The filter is not supported")); + } + + if (query.empty() && filter == MessageSearchFilter::Empty) { + return promise.set_value(td_->messages_manager_->get_found_messages_object({}, "search_messages")); + } + + td_->create_handler(std::move(promise)) + ->send(dialog_list_id.get_folder_id(), ignore_folder_id, query, offset.date_, offset.dialog_id_, + offset.message_id_, limit, filter, dialog_type_filter, min_date, max_date); +} + +void MessageQueryManager::on_get_messages_search_result( + const string &query, int32 offset_date, DialogId offset_dialog_id, MessageId offset_message_id, int32 limit, + MessageSearchFilter filter, int32 min_date, int32 max_date, int32 total_count, + vector> &&messages, int32 next_rate, + Promise> &&promise) { + TRY_STATUS_PROMISE(promise, G()->close_status()); + + LOG(INFO) << "Receive " << messages.size() << " found messages"; + + MessagesManager::FoundMessages found_messages; + auto &result = found_messages.message_full_ids; + MessageSearchOffset next_offset; + for (auto &message : messages) { + next_offset.update_from_message(message); + + bool is_channel_message = DialogId::get_message_dialog_id(message).get_type() == DialogType::Channel; + auto new_message_full_id = + td_->messages_manager_->on_get_message(std::move(message), false, is_channel_message, false, "search messages"); + if (new_message_full_id != MessageFullId()) { + result.push_back(new_message_full_id); + } else { + total_count--; + } + } + if (total_count < static_cast(result.size())) { + LOG(ERROR) << "Receive " << result.size() << " valid messages out of " << total_count << " in " << messages.size() + << " messages"; + total_count = static_cast(result.size()); + } + found_messages.total_count = total_count; + if (!result.empty()) { + if (next_rate > 0) { + next_offset.date_ = next_rate; + } + found_messages.next_offset = next_offset.to_string(); + } + promise.set_value(td_->messages_manager_->get_found_messages_object(found_messages, "on_get_messages_search_result")); +} + +void MessageQueryManager::search_outgoing_document_messages( + const string &query, int32 limit, Promise> &&promise) { + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Parameter limit must be positive")); + } + if (limit > MAX_SEARCH_MESSAGES) { + limit = MAX_SEARCH_MESSAGES; + } + + td_->create_handler(std::move(promise))->send(query, limit); +} + +void MessageQueryManager::on_get_outgoing_document_messages( + vector> &&messages, + Promise> &&promise) { + TRY_STATUS_PROMISE(promise, G()->close_status()); + + MessagesManager::FoundMessages found_messages; + for (auto &message : messages) { + auto dialog_id = DialogId::get_message_dialog_id(message); + auto message_full_id = + td_->messages_manager_->on_get_message(std::move(message), false, dialog_id.get_type() == DialogType::Channel, + false, "on_get_outgoing_document_messages"); + if (message_full_id != MessageFullId()) { + CHECK(dialog_id == message_full_id.get_dialog_id()); + found_messages.message_full_ids.push_back(message_full_id); + } + } + auto result = td_->messages_manager_->get_found_messages_object(found_messages, "on_get_outgoing_document_messages"); + td::remove_if(result->messages_, + [](const auto &message) { return message->content_->get_id() != td_api::messageDocument::ID; }); + result->total_count_ = narrow_cast(result->messages_.size()); + promise.set_value(std::move(result)); +} + +void MessageQueryManager::search_hashtag_posts(string hashtag, string offset_str, int32 limit, + Promise> &&promise) { + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Parameter limit must be positive")); + } + if (limit > MAX_SEARCH_MESSAGES) { + limit = MAX_SEARCH_MESSAGES; + } + + TRY_RESULT_PROMISE(promise, offset, MessageSearchOffset::from_string(offset_str)); + + bool is_cashtag = false; + if (hashtag[0] == '#' || hashtag[0] == '$') { + is_cashtag = (hashtag[0] == '$'); + hashtag = hashtag.substr(1); + } + if (hashtag.empty()) { + return promise.set_value(td_->messages_manager_->get_found_messages_object({}, "search_hashtag_posts")); + } + send_closure(is_cashtag ? td_->cashtag_search_hints_ : td_->hashtag_search_hints_, &HashtagHints::hashtag_used, + hashtag); + + td_->create_handler(std::move(promise)) + ->send(PSTRING() << (is_cashtag ? '$' : '#') << hashtag, offset, limit); +} + +void MessageQueryManager::on_get_hashtag_search_result( + const string &hashtag, const MessageSearchOffset &old_offset, int32 limit, int32 total_count, + vector> &&messages, int32 next_rate, + Promise> &&promise) { + TRY_STATUS_PROMISE(promise, G()->close_status()); + + MessagesManager::FoundMessages found_messages; + auto &result = found_messages.message_full_ids; + MessageSearchOffset next_offset; + for (auto &message : messages) { + next_offset.update_from_message(message); + + auto new_message_full_id = + td_->messages_manager_->on_get_message(std::move(message), false, true, false, "search hashtag"); + if (new_message_full_id != MessageFullId()) { + result.push_back(new_message_full_id); + } else { + total_count--; + } + } + if (total_count < static_cast(result.size())) { + LOG(ERROR) << "Receive " << result.size() << " valid messages out of " << total_count << " in " << messages.size() + << " messages"; + total_count = static_cast(result.size()); + } + found_messages.total_count = total_count; + if (!result.empty()) { + if (next_rate > 0) { + next_offset.date_ = next_rate; + } + found_messages.next_offset = next_offset.to_string(); + } + promise.set_value(td_->messages_manager_->get_found_messages_object(found_messages, "on_get_hashtag_search_result")); +} + +void MessageQueryManager::search_dialog_recent_location_messages( + DialogId dialog_id, int32 limit, Promise> &&promise) { + LOG(INFO) << "Search recent location messages in " << dialog_id << " with limit " << limit; + + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Parameter limit must be positive")); + } + if (limit > MAX_SEARCH_MESSAGES) { + limit = MAX_SEARCH_MESSAGES; + } + + TRY_STATUS_PROMISE(promise, td_->dialog_manager_->check_dialog_access(dialog_id, true, AccessRights::Read, + "search_dialog_recent_location_messages")); + + switch (dialog_id.get_type()) { + case DialogType::User: + case DialogType::Chat: + case DialogType::Channel: + return td_->create_handler(std::move(promise))->send(dialog_id, limit); + case DialogType::SecretChat: + return promise.set_value(td_->messages_manager_->get_messages_object(0, dialog_id, {}, false, + "search_dialog_recent_location_messages")); + default: + UNREACHABLE(); + promise.set_error(Status::Error(500, "Message search is not supported")); + } +} + +void MessageQueryManager::on_get_recent_locations(DialogId dialog_id, int32 limit, int32 total_count, + vector> &&messages, + Promise> &&promise) { + TRY_STATUS_PROMISE(promise, G()->close_status()); + + LOG(INFO) << "Receive " << messages.size() << " recent locations in " << dialog_id; + vector message_ids; + for (auto &message : messages) { + auto new_message_full_id = td_->messages_manager_->on_get_message( + std::move(message), false, dialog_id.get_type() == DialogType::Channel, false, "get recent locations"); + if (new_message_full_id != MessageFullId()) { + if (new_message_full_id.get_dialog_id() != dialog_id) { + LOG(ERROR) << "Receive " << new_message_full_id << " instead of a message in " << dialog_id; + total_count--; + continue; + } + + message_ids.push_back(new_message_full_id.get_message_id()); + } else { + total_count--; + } + } + if (total_count < static_cast(message_ids.size())) { + LOG(ERROR) << "Receive " << message_ids.size() << " valid messages out of " << total_count << " in " + << messages.size() << " messages"; + total_count = static_cast(message_ids.size()); + } + auto result = + td_->messages_manager_->get_messages_object(total_count, dialog_id, message_ids, true, "on_get_recent_locations"); + td::remove_if(result->messages_, [&](const auto &message) { + if (message->content_->get_id() != td_api::messageLocation::ID || + static_cast(message->content_.get())->live_period_ <= 0) { + result->total_count_--; + return true; + } + return false; + }); + + promise.set_value(std::move(result)); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/MessageQueryManager.h b/lib/tgchat/ext/td/td/telegram/MessageQueryManager.h new file mode 100644 index 00000000..1e27884a --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/MessageQueryManager.h @@ -0,0 +1,74 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/DialogId.h" +#include "td/telegram/DialogListId.h" +#include "td/telegram/MessageFullId.h" +#include "td/telegram/MessageId.h" +#include "td/telegram/MessageSearchFilter.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" + +#include "td/actor/actor.h" + +#include "td/utils/common.h" +#include "td/utils/Promise.h" + +namespace td { + +struct MessageSearchOffset; +class Td; + +class MessageQueryManager final : public Actor { + public: + MessageQueryManager(Td *td, ActorShared<> parent); + + void report_message_delivery(MessageFullId message_full_id, int32 until_date, bool from_push); + + void search_messages(DialogListId dialog_list_id, bool ignore_folder_id, const string &query, + const string &offset_str, int32 limit, MessageSearchFilter filter, + td_api::object_ptr &&dialog_type_filter, int32 min_date, + int32 max_date, Promise> &&promise); + + void on_get_messages_search_result(const string &query, int32 offset_date, DialogId offset_dialog_id, + MessageId offset_message_id, int32 limit, MessageSearchFilter filter, + int32 min_date, int32 max_date, int32 total_count, + vector> &&messages, + int32 next_rate, Promise> &&promise); + + void search_outgoing_document_messages(const string &query, int32 limit, + Promise> &&promise); + + void on_get_outgoing_document_messages(vector> &&messages, + Promise> &&promise); + + void search_hashtag_posts(string hashtag, string offset_str, int32 limit, + Promise> &&promise); + + void on_get_hashtag_search_result(const string &hashtag, const MessageSearchOffset &old_offset, int32 limit, + int32 total_count, + vector> &&messages, int32 next_rate, + Promise> &&promise); + + void search_dialog_recent_location_messages(DialogId dialog_id, int32 limit, + Promise> &&promise); + + void on_get_recent_locations(DialogId dialog_id, int32 limit, int32 total_count, + vector> &&messages, + Promise> &&promise); + + private: + static constexpr int32 MAX_SEARCH_MESSAGES = 100; // server-side limit + + void tear_down() final; + + Td *td_; + ActorShared<> parent_; +}; + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/MessageQuote.cpp b/lib/tgchat/ext/td/td/telegram/MessageQuote.cpp index 34d83cae..9a51474d 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageQuote.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageQuote.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageQuote.h b/lib/tgchat/ext/td/td/telegram/MessageQuote.h index 2ee071f4..dad9e78a 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageQuote.h +++ b/lib/tgchat/ext/td/td/telegram/MessageQuote.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageQuote.hpp b/lib/tgchat/ext/td/td/telegram/MessageQuote.hpp index ea29ad5b..9ca5ceff 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageQuote.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageQuote.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReaction.cpp b/lib/tgchat/ext/td/td/telegram/MessageReaction.cpp index 05ca8b51..97b11ade 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReaction.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReaction.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReaction.h b/lib/tgchat/ext/td/td/telegram/MessageReaction.h index 854ecc18..df516cca 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReaction.h +++ b/lib/tgchat/ext/td/td/telegram/MessageReaction.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReaction.hpp b/lib/tgchat/ext/td/td/telegram/MessageReaction.hpp index 588a2540..b2ed67b5 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReaction.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReaction.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReactor.cpp b/lib/tgchat/ext/td/td/telegram/MessageReactor.cpp index b79c7727..59778e08 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReactor.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReactor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReactor.h b/lib/tgchat/ext/td/td/telegram/MessageReactor.h index a92865f3..bacaa8e9 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReactor.h +++ b/lib/tgchat/ext/td/td/telegram/MessageReactor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReactor.hpp b/lib/tgchat/ext/td/td/telegram/MessageReactor.hpp index d50f21ba..c4e9f4ac 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReactor.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReactor.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.cpp b/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.cpp index 8ecf6530..a18da56c 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.h b/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.h index fcd0eb79..58e2f9dc 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.h +++ b/lib/tgchat/ext/td/td/telegram/MessageReplyHeader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.cpp b/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.cpp index de0ff551..a550069b 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.h b/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.h index a644467c..7074428b 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.h +++ b/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.hpp b/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.hpp index 7f3c4c1e..22256293 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/MessageReplyInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.cpp b/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.cpp index 004c0b6a..6990e251 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.h b/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.h index 3ebda82c..4ab10fdb 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.h +++ b/lib/tgchat/ext/td/td/telegram/MessageSearchFilter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.cpp b/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.cpp index 9d08b8ae..c276e94a 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.h b/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.h index 91a88e64..8889ed51 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.h +++ b/lib/tgchat/ext/td/td/telegram/MessageSearchOffset.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.cpp b/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.cpp index 4abee576..5a5c5ca6 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.h b/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.h index 3939039b..66b04fbe 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.h +++ b/lib/tgchat/ext/td/td/telegram/MessageSelfDestructType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSender.cpp b/lib/tgchat/ext/td/td/telegram/MessageSender.cpp index 7b375554..0281bf78 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSender.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageSender.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSender.h b/lib/tgchat/ext/td/td/telegram/MessageSender.h index 088b449b..9f0516f4 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSender.h +++ b/lib/tgchat/ext/td/td/telegram/MessageSender.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSource.cpp b/lib/tgchat/ext/td/td/telegram/MessageSource.cpp index 65224699..a115a88e 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSource.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageSource.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageSource.h b/lib/tgchat/ext/td/td/telegram/MessageSource.h index 190f72f3..a9f5a50f 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageSource.h +++ b/lib/tgchat/ext/td/td/telegram/MessageSource.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageThreadDb.cpp b/lib/tgchat/ext/td/td/telegram/MessageThreadDb.cpp index 9bcb0a91..66a1a7ed 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageThreadDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageThreadDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageThreadDb.h b/lib/tgchat/ext/td/td/telegram/MessageThreadDb.h index 7980ac9d..c651f384 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageThreadDb.h +++ b/lib/tgchat/ext/td/td/telegram/MessageThreadDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageThreadInfo.h b/lib/tgchat/ext/td/td/telegram/MessageThreadInfo.h index beb9c478..9c5a44c5 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageThreadInfo.h +++ b/lib/tgchat/ext/td/td/telegram/MessageThreadInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageTtl.cpp b/lib/tgchat/ext/td/td/telegram/MessageTtl.cpp index 5cbe61ce..c9f9a941 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageTtl.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageTtl.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageTtl.h b/lib/tgchat/ext/td/td/telegram/MessageTtl.h index f1149095..802cbf61 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageTtl.h +++ b/lib/tgchat/ext/td/td/telegram/MessageTtl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageViewer.cpp b/lib/tgchat/ext/td/td/telegram/MessageViewer.cpp index 1cb01195..263c6e8b 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageViewer.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessageViewer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessageViewer.h b/lib/tgchat/ext/td/td/telegram/MessageViewer.h index f3ddaffb..653b8bcd 100644 --- a/lib/tgchat/ext/td/td/telegram/MessageViewer.h +++ b/lib/tgchat/ext/td/td/telegram/MessageViewer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessagesInfo.cpp b/lib/tgchat/ext/td/td/telegram/MessagesInfo.cpp index e7a1c4b5..ae1bac06 100644 --- a/lib/tgchat/ext/td/td/telegram/MessagesInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessagesInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessagesInfo.h b/lib/tgchat/ext/td/td/telegram/MessagesInfo.h index ab6e551e..7fe6e7fa 100644 --- a/lib/tgchat/ext/td/td/telegram/MessagesInfo.h +++ b/lib/tgchat/ext/td/td/telegram/MessagesInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MessagesManager.cpp b/lib/tgchat/ext/td/td/telegram/MessagesManager.cpp index 0f5a84fb..cf1babf6 100644 --- a/lib/tgchat/ext/td/td/telegram/MessagesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/MessagesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -39,7 +39,6 @@ #include "td/telegram/ForumTopicManager.h" #include "td/telegram/Global.h" #include "td/telegram/GroupCallManager.h" -#include "td/telegram/HashtagHints.h" #include "td/telegram/InlineQueriesManager.h" #include "td/telegram/InputDialogId.h" #include "td/telegram/InputMessageText.h" @@ -53,11 +52,11 @@ #include "td/telegram/MessageForwardInfo.h" #include "td/telegram/MessageForwardInfo.hpp" #include "td/telegram/MessageOrigin.hpp" +#include "td/telegram/MessageQueryManager.h" #include "td/telegram/MessageQuote.h" #include "td/telegram/MessageReaction.h" #include "td/telegram/MessageReaction.hpp" #include "td/telegram/MessageReplyInfo.hpp" -#include "td/telegram/MessageSearchOffset.h" #include "td/telegram/MessageSender.h" #include "td/telegram/misc.h" #include "td/telegram/MissingInvitee.h" @@ -73,6 +72,7 @@ #include "td/telegram/OptionManager.h" #include "td/telegram/Photo.h" #include "td/telegram/PollId.h" +#include "td/telegram/PromoDataManager.h" #include "td/telegram/PublicDialogType.h" #include "td/telegram/QuickReplyManager.h" #include "td/telegram/ReactionManager.h" @@ -736,68 +736,6 @@ class SearchPublicDialogsQuery final : public Td::ResultHandler { } }; -class GetBlockedDialogsQuery final : public Td::ResultHandler { - Promise> promise_; - int32 offset_; - int32 limit_; - - public: - explicit GetBlockedDialogsQuery(Promise> &&promise) - : promise_(std::move(promise)) { - } - - void send(BlockListId block_list_id, int32 offset, int32 limit) { - offset_ = offset; - limit_ = limit; - - int32 flags = 0; - if (block_list_id == BlockListId::stories()) { - flags |= telegram_api::contacts_getBlocked::MY_STORIES_FROM_MASK; - } - - send_query( - G()->net_query_creator().create(telegram_api::contacts_getBlocked(flags, false /*ignored*/, offset, limit))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for GetBlockedDialogsQuery: " << to_string(ptr); - - switch (ptr->get_id()) { - case telegram_api::contacts_blocked::ID: { - auto blocked_peers = move_tl_object_as(ptr); - - td_->user_manager_->on_get_users(std::move(blocked_peers->users_), "GetBlockedDialogsQuery"); - td_->chat_manager_->on_get_chats(std::move(blocked_peers->chats_), "GetBlockedDialogsQuery"); - td_->messages_manager_->on_get_blocked_dialogs(offset_, limit_, - narrow_cast(blocked_peers->blocked_.size()), - std::move(blocked_peers->blocked_), std::move(promise_)); - break; - } - case telegram_api::contacts_blockedSlice::ID: { - auto blocked_peers = move_tl_object_as(ptr); - - td_->user_manager_->on_get_users(std::move(blocked_peers->users_), "GetBlockedDialogsQuery slice"); - td_->chat_manager_->on_get_chats(std::move(blocked_peers->chats_), "GetBlockedDialogsQuery slice"); - td_->messages_manager_->on_get_blocked_dialogs(offset_, limit_, blocked_peers->count_, - std::move(blocked_peers->blocked_), std::move(promise_)); - break; - } - default: - UNREACHABLE(); - } - } - - void on_error(Status status) final { - promise_.set_error(std::move(status)); - } -}; - class SetChatAvailableReactionsQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -926,56 +864,6 @@ class SetHistoryTtlQuery final : public Td::ResultHandler { } }; -class ToggleDialogPinQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - bool is_pinned_; - - public: - explicit ToggleDialogPinQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, bool is_pinned) { - dialog_id_ = dialog_id; - is_pinned_ = is_pinned; - - auto input_peer = td_->dialog_manager_->get_input_dialog_peer(dialog_id, AccessRights::Read); - if (input_peer == nullptr) { - return on_error(Status::Error(400, "Can't access the chat")); - } - - int32 flags = 0; - if (is_pinned) { - flags |= telegram_api::messages_toggleDialogPin::PINNED_MASK; - } - send_query(G()->net_query_creator().create( - telegram_api::messages_toggleDialogPin(flags, false /*ignored*/, std::move(input_peer)), {{dialog_id}})); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - bool result = result_ptr.ok(); - if (!result) { - return on_error(Status::Error(400, "Toggle dialog pin failed")); - } - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogPinQuery")) { - LOG(ERROR) << "Receive error for ToggleDialogPinQuery: " << status; - } - td_->messages_manager_->on_update_pinned_dialogs(FolderId::main()); - td_->messages_manager_->on_update_pinned_dialogs(FolderId::archive()); - promise_.set_error(std::move(status)); - } -}; - class ReorderPinnedDialogsQuery final : public Td::ResultHandler { FolderId folder_id_; Promise promise_; @@ -1014,205 +902,6 @@ class ReorderPinnedDialogsQuery final : public Td::ResultHandler { } }; -class ToggleViewForumAsMessagesQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - bool view_as_messages_; - - public: - explicit ToggleViewForumAsMessagesQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, bool view_as_messages) { - dialog_id_ = dialog_id; - view_as_messages_ = view_as_messages; - - CHECK(dialog_id.get_type() == DialogType::Channel); - auto input_channel = td_->chat_manager_->get_input_channel(dialog_id.get_channel_id()); - CHECK(input_channel != nullptr); - send_query(G()->net_query_creator().create( - telegram_api::channels_toggleViewForumAsMessages(std::move(input_channel), view_as_messages), {{dialog_id}})); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for ToggleViewForumAsMessagesQuery: " << to_string(ptr); - td_->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_)); - } - - void on_error(Status status) final { - if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleViewForumAsMessagesQuery")) { - LOG(ERROR) << "Receive error for ToggleViewForumAsMessagesQuery: " << status; - } - if (!G()->close_flag()) { - td_->messages_manager_->on_update_dialog_view_as_messages(dialog_id_, !view_as_messages_); - } - promise_.set_error(std::move(status)); - } -}; - -class ToggleDialogUnreadMarkQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - bool is_marked_as_unread_; - - public: - explicit ToggleDialogUnreadMarkQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, bool is_marked_as_unread) { - dialog_id_ = dialog_id; - is_marked_as_unread_ = is_marked_as_unread; - - auto input_peer = td_->dialog_manager_->get_input_dialog_peer(dialog_id, AccessRights::Read); - if (input_peer == nullptr) { - return on_error(Status::Error(400, "Can't access the chat")); - } - - int32 flags = 0; - if (is_marked_as_unread) { - flags |= telegram_api::messages_markDialogUnread::UNREAD_MASK; - } - send_query(G()->net_query_creator().create( - telegram_api::messages_markDialogUnread(flags, false /*ignored*/, std::move(input_peer)), {{dialog_id}})); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - bool result = result_ptr.ok(); - if (!result) { - return on_error(Status::Error(400, "Toggle dialog mark failed")); - } - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogUnreadMarkQuery")) { - LOG(ERROR) << "Receive error for ToggleDialogUnreadMarkQuery: " << status; - } - if (!G()->close_flag()) { - td_->messages_manager_->on_update_dialog_is_marked_as_unread(dialog_id_, !is_marked_as_unread_); - } - promise_.set_error(std::move(status)); - } -}; - -class ToggleDialogTranslationsQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - bool is_translatable_; - - public: - explicit ToggleDialogTranslationsQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, bool is_translatable) { - dialog_id_ = dialog_id; - is_translatable_ = is_translatable; - - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); - if (input_peer == nullptr) { - return on_error(Status::Error(400, "Can't access the chat")); - } - - int32 flags = 0; - if (!is_translatable) { - flags |= telegram_api::messages_togglePeerTranslations::DISABLED_MASK; - } - send_query(G()->net_query_creator().create( - telegram_api::messages_togglePeerTranslations(flags, false /*ignored*/, std::move(input_peer)), {{dialog_id}})); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - bool result = result_ptr.ok(); - if (!result) { - return on_error(Status::Error(400, "Toggle dialog translations failed")); - } - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogTranslationsQuery")) { - LOG(ERROR) << "Receive error for ToggleDialogTranslationsQuery: " << status; - } - if (!G()->close_flag()) { - td_->messages_manager_->on_update_dialog_is_translatable(dialog_id_, !is_translatable_); - } - promise_.set_error(std::move(status)); - } -}; - -class ToggleDialogIsBlockedQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - - public: - explicit ToggleDialogIsBlockedQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, bool is_blocked, bool is_blocked_for_stories) { - dialog_id_ = dialog_id; - - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Know); - CHECK(input_peer != nullptr && input_peer->get_id() != telegram_api::inputPeerEmpty::ID); - - int32 flags = 0; - if (is_blocked_for_stories) { - flags |= telegram_api::contacts_block::MY_STORIES_FROM_MASK; - } - vector chain_ids{{dialog_id, MessageContentType::Photo}, {dialog_id, MessageContentType::Text}}; - auto query = - is_blocked || is_blocked_for_stories - ? G()->net_query_creator().create( - telegram_api::contacts_block(flags, false /*ignored*/, std::move(input_peer)), std::move(chain_ids)) - : G()->net_query_creator().create( - telegram_api::contacts_unblock(flags, false /*ignored*/, std::move(input_peer)), - std::move(chain_ids)); - send_query(std::move(query)); - } - - void on_result(BufferSlice packet) final { - static_assert( - std::is_same::value, ""); - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - bool result = result_ptr.ok(); - LOG_IF(WARNING, !result) << "Block/Unblock " << dialog_id_ << " has failed"; - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ToggleDialogIsBlockedQuery")) { - LOG(ERROR) << "Receive error for ToggleDialogIsBlockedQuery: " << status; - } - if (!G()->close_flag()) { - td_->dialog_manager_->get_dialog_info_full(dialog_id_, Auto(), "ToggleDialogIsBlockedQuery"); - td_->messages_manager_->reget_dialog_action_bar(dialog_id_, "ToggleDialogIsBlockedQuery"); - } - promise_.set_error(std::move(status)); - } -}; - class GetMessagesViewsQuery final : public Td::ResultHandler { DialogId dialog_id_; vector message_ids_; @@ -2193,137 +1882,6 @@ class GetSearchCountersQuery final : public Td::ResultHandler { } }; -class SearchMessagesGlobalQuery final : public Td::ResultHandler { - Promise> promise_; - string query_; - int32 offset_date_; - DialogId offset_dialog_id_; - MessageId offset_message_id_; - int32 limit_; - MessageSearchFilter filter_; - int32 min_date_; - int32 max_date_; - - public: - explicit SearchMessagesGlobalQuery(Promise> &&promise) - : promise_(std::move(promise)) { - } - - void send(FolderId folder_id, bool ignore_folder_id, bool broadcasts_only, const string &query, int32 offset_date, - DialogId offset_dialog_id, MessageId offset_message_id, int32 limit, MessageSearchFilter filter, - int32 min_date, int32 max_date) { - query_ = query; - offset_date_ = offset_date; - offset_dialog_id_ = offset_dialog_id; - offset_message_id_ = offset_message_id; - limit_ = limit; - filter_ = filter; - min_date_ = min_date; - max_date_ = max_date; - - auto input_peer = DialogManager::get_input_peer_force(offset_dialog_id); - CHECK(input_peer != nullptr); - - int32 flags = 0; - if (!ignore_folder_id) { - flags |= telegram_api::messages_searchGlobal::FOLDER_ID_MASK; - } - if (broadcasts_only) { - flags |= telegram_api::messages_searchGlobal::BROADCASTS_ONLY_MASK; - } - send_query(G()->net_query_creator().create(telegram_api::messages_searchGlobal( - flags, false /*ignored*/, folder_id.get(), query, get_input_messages_filter(filter), min_date_, max_date_, - offset_date_, std::move(input_peer), offset_message_id.get_server_message_id().get(), limit))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto info = get_messages_info(td_, DialogId(), result_ptr.move_as_ok(), "SearchMessagesGlobalQuery"); - td_->messages_manager_->get_channel_differences_if_needed( - std::move(info), - PromiseCreator::lambda([actor_id = td_->messages_manager_actor_.get(), query = std::move(query_), - offset_date = offset_date_, offset_dialog_id = offset_dialog_id_, - offset_message_id = offset_message_id_, limit = limit_, filter = std::move(filter_), - min_date = min_date_, max_date = max_date_, - promise = std::move(promise_)](Result &&result) mutable { - if (result.is_error()) { - promise.set_error(result.move_as_error()); - } else { - auto info = result.move_as_ok(); - send_closure(actor_id, &MessagesManager::on_get_messages_search_result, query, offset_date, - offset_dialog_id, offset_message_id, limit, filter, min_date, max_date, info.total_count, - std::move(info.messages), info.next_rate, std::move(promise)); - } - }), - "SearchMessagesGlobalQuery"); - } - - void on_error(Status status) final { - if (status.message() == "SEARCH_QUERY_EMPTY") { - return promise_.set_value(td_->messages_manager_->get_found_messages_object({}, "SearchMessagesGlobalQuery")); - } - promise_.set_error(std::move(status)); - } -}; - -class SearchPostsQuery final : public Td::ResultHandler { - Promise> promise_; - string hashtag_; - MessageSearchOffset offset_; - int32 limit_; - - public: - explicit SearchPostsQuery(Promise> &&promise) - : promise_(std::move(promise)) { - } - - void send(const string &hashtag, MessageSearchOffset offset, int32 limit) { - hashtag_ = hashtag; - offset_ = offset; - limit_ = limit; - - auto input_peer = DialogManager::get_input_peer_force(offset.dialog_id_); - CHECK(input_peer != nullptr); - - send_query(G()->net_query_creator().create(telegram_api::channels_searchPosts( - hashtag, offset.date_, std::move(input_peer), offset.message_id_.get_server_message_id().get(), limit))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto info = get_messages_info(td_, DialogId(), result_ptr.move_as_ok(), "SearchPostsQuery"); - td_->messages_manager_->get_channel_differences_if_needed( - std::move(info), - PromiseCreator::lambda([actor_id = td_->messages_manager_actor_.get(), hashtag = std::move(hashtag_), - offset = offset_, limit = limit_, - promise = std::move(promise_)](Result &&result) mutable { - if (result.is_error()) { - promise.set_error(result.move_as_error()); - } else { - auto info = result.move_as_ok(); - send_closure(actor_id, &MessagesManager::on_get_hashtag_search_result, hashtag, offset, limit, - info.total_count, std::move(info.messages), info.next_rate, std::move(promise)); - } - }), - "SearchPostsQuery"); - } - - void on_error(Status status) final { - if (status.message() == "SEARCH_QUERY_EMPTY") { - return promise_.set_value(td_->messages_manager_->get_found_messages_object({}, "SearchPostsQuery")); - } - promise_.set_error(std::move(status)); - } -}; - class GetAllScheduledMessagesQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -2367,124 +1925,6 @@ class GetAllScheduledMessagesQuery final : public Td::ResultHandler { } }; -class SearchSentMediaQuery final : public Td::ResultHandler { - Promise> promise_; - - public: - explicit SearchSentMediaQuery(Promise> &&promise) - : promise_(std::move(promise)) { - } - - void send(const string &query, int32 limit) { - send_query(G()->net_query_creator().create(telegram_api::messages_searchSentMedia( - query, telegram_api::make_object(), limit))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto info = get_messages_info(td_, DialogId(), result_ptr.move_as_ok(), "SearchSentMediaQuery"); - td_->messages_manager_->get_channel_differences_if_needed( - std::move(info), - PromiseCreator::lambda([actor_id = td_->messages_manager_actor_.get(), - promise = std::move(promise_)](Result &&result) mutable { - if (result.is_error()) { - promise.set_error(result.move_as_error()); - } else { - auto info = result.move_as_ok(); - send_closure(actor_id, &MessagesManager::on_get_outgoing_document_messages, std::move(info.messages), - std::move(promise)); - } - }), - "SearchSentMediaQuery"); - } - - void on_error(Status status) final { - promise_.set_error(std::move(status)); - } -}; - -class GetRecentLocationsQuery final : public Td::ResultHandler { - Promise> promise_; - DialogId dialog_id_; - int32 limit_; - - public: - explicit GetRecentLocationsQuery(Promise> &&promise) - : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, int32 limit) { - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); - if (input_peer == nullptr) { - return on_error(Status::Error(400, "Chat is not accessible")); - } - - dialog_id_ = dialog_id; - limit_ = limit; - - send_query( - G()->net_query_creator().create(telegram_api::messages_getRecentLocations(std::move(input_peer), limit, 0))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto info = get_messages_info(td_, dialog_id_, result_ptr.move_as_ok(), "GetRecentLocationsQuery"); - td_->messages_manager_->get_channel_difference_if_needed( - dialog_id_, std::move(info), - PromiseCreator::lambda([actor_id = td_->messages_manager_actor_.get(), dialog_id = dialog_id_, limit = limit_, - promise = std::move(promise_)](Result &&result) mutable { - if (result.is_error()) { - promise.set_error(result.move_as_error()); - } else { - auto info = result.move_as_ok(); - send_closure(actor_id, &MessagesManager::on_get_recent_locations, dialog_id, limit, info.total_count, - std::move(info.messages), std::move(promise)); - } - }), - "GetRecentLocationsQuery"); - } - - void on_error(Status status) final { - td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "GetRecentLocationsQuery"); - promise_.set_error(std::move(status)); - } -}; - -class HidePromoDataQuery final : public Td::ResultHandler { - DialogId dialog_id_; - - public: - void send(DialogId dialog_id) { - dialog_id_ = dialog_id; - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); - CHECK(input_peer != nullptr); - send_query(G()->net_query_creator().create(telegram_api::help_hidePromoData(std::move(input_peer)))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - // we are not interested in the result - } - - void on_error(Status status) final { - if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "HidePromoDataQuery")) { - LOG(ERROR) << "Receive error for sponsored chat hiding: " << status; - } - } -}; - class DeleteHistoryQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -3997,120 +3437,6 @@ class DeleteScheduledMessagesQuery final : public Td::ResultHandler { } }; -class GetPeerSettingsQuery final : public Td::ResultHandler { - DialogId dialog_id_; - - public: - void send(DialogId dialog_id) { - dialog_id_ = dialog_id; - - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); - CHECK(input_peer != nullptr); - - send_query(G()->net_query_creator().create(telegram_api::messages_getPeerSettings(std::move(input_peer)))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - auto ptr = result_ptr.move_as_ok(); - td_->user_manager_->on_get_users(std::move(ptr->users_), "GetPeerSettingsQuery"); - td_->chat_manager_->on_get_chats(std::move(ptr->chats_), "GetPeerSettingsQuery"); - td_->messages_manager_->on_get_peer_settings(dialog_id_, std::move(ptr->settings_)); - } - - void on_error(Status status) final { - LOG(INFO) << "Receive error for get peer settings: " << status; - td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "GetPeerSettingsQuery"); - } -}; - -class UpdatePeerSettingsQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - - public: - explicit UpdatePeerSettingsQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id, bool is_spam_dialog) { - dialog_id_ = dialog_id; - - auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); - if (input_peer == nullptr) { - return promise_.set_value(Unit()); - } - - if (is_spam_dialog) { - send_query(G()->net_query_creator().create(telegram_api::messages_reportSpam(std::move(input_peer)))); - } else { - send_query(G()->net_query_creator().create(telegram_api::messages_hidePeerSettingsBar(std::move(input_peer)))); - } - } - - void on_result(BufferSlice packet) final { - static_assert(std::is_same::value, - ""); - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - td_->messages_manager_->on_get_peer_settings(dialog_id_, make_tl_object(), true); - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - LOG(INFO) << "Receive error for update peer settings: " << status; - td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "UpdatePeerSettingsQuery"); - td_->messages_manager_->reget_dialog_action_bar(dialog_id_, "UpdatePeerSettingsQuery"); - promise_.set_error(std::move(status)); - } -}; - -class ReportEncryptedSpamQuery final : public Td::ResultHandler { - Promise promise_; - DialogId dialog_id_; - - public: - explicit ReportEncryptedSpamQuery(Promise &&promise) : promise_(std::move(promise)) { - } - - void send(DialogId dialog_id) { - dialog_id_ = dialog_id; - - auto input_peer = td_->dialog_manager_->get_input_encrypted_chat(dialog_id, AccessRights::Read); - CHECK(input_peer != nullptr); - - send_query(G()->net_query_creator().create(telegram_api::messages_reportEncryptedSpam(std::move(input_peer)))); - } - - void on_result(BufferSlice packet) final { - auto result_ptr = fetch_result(packet); - if (result_ptr.is_error()) { - return on_error(result_ptr.move_as_error()); - } - - td_->messages_manager_->on_get_peer_settings(dialog_id_, make_tl_object(), true); - - promise_.set_value(Unit()); - } - - void on_error(Status status) final { - LOG(INFO) << "Receive error for report encrypted spam: " << status; - td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "ReportEncryptedSpamQuery"); - td_->messages_manager_->reget_dialog_action_bar( - DialogId(td_->user_manager_->get_secret_chat_user_id(dialog_id_.get_secret_chat_id())), - "ReportEncryptedSpamQuery"); - promise_.set_error(std::move(status)); - } -}; - class EditPeerFoldersQuery final : public Td::ResultHandler { Promise promise_; DialogId dialog_id_; @@ -4274,6 +3600,7 @@ void MessagesManager::Message::store(StorerT &storer) const { bool has_effect_id = effect_id.is_valid(); bool has_fact_check = fact_check != nullptr; bool has_initial_sender_dialog_id = !message_id.is_any_server() && initial_sender_dialog_id.is_valid(); + bool has_reactions_are_possible = true; BEGIN_STORE_FLAGS(); STORE_FLAG(is_channel_post); STORE_FLAG(is_outgoing); @@ -4365,6 +3692,8 @@ void MessagesManager::Message::store(StorerT &storer) const { STORE_FLAG(has_initial_sender_dialog_id); // 20 STORE_FLAG(allow_paid); STORE_FLAG(video_processing_pending); + STORE_FLAG(has_reactions_are_possible); + STORE_FLAG(reactions_are_possible); END_STORE_FLAGS(); } @@ -4560,6 +3889,7 @@ void MessagesManager::Message::parse(ParserT &parser) { bool has_effect_id = false; bool has_fact_check = false; bool has_initial_sender_dialog_id = false; + bool has_reactions_are_possible = false; BEGIN_PARSE_FLAGS(); PARSE_FLAG(is_channel_post); PARSE_FLAG(is_outgoing); @@ -4651,6 +3981,8 @@ void MessagesManager::Message::parse(ParserT &parser) { PARSE_FLAG(has_initial_sender_dialog_id); PARSE_FLAG(allow_paid); PARSE_FLAG(video_processing_pending); + PARSE_FLAG(has_reactions_are_possible); + PARSE_FLAG(reactions_are_possible); END_PARSE_FLAGS(); } @@ -4856,6 +4188,9 @@ void MessagesManager::Message::parse(ParserT &parser) { if (hide_edit_date && content->get_type() == MessageContentType::LiveLocation) { hide_edit_date = false; } + if (!has_reactions_are_possible) { + reactions_are_possible = get_default_service_message_content_reactions_are_possible(content->get_type()); + } } template @@ -6009,7 +5344,7 @@ void MessagesManager::skip_old_pending_pts_update(tl_object_ptrpts; - if (new_pts <= old_pts) { // very old or unuseful update + if (new_pts <= old_pts) { // very old or useless update if (update->get_id() == telegram_api::updateNewChannelMessage::ID) { auto update_new_channel_message = static_cast(update.get()); auto message_id = MessageId::get_message_id(update_new_channel_message->message_, false); @@ -7853,8 +7180,10 @@ ChatReactions MessagesManager::get_dialog_active_reactions(const Dialog *d) cons ChatReactions MessagesManager::get_message_active_reactions(const Dialog *d, const Message *m) const { CHECK(d != nullptr); CHECK(m != nullptr); - if (is_service_message_content(m->content->get_type()) || !m->ttl.is_empty() || !m->message_id.is_valid() || - !m->message_id.is_server()) { + if (!m->ttl.is_empty() || !m->message_id.is_valid() || !m->message_id.is_server()) { + return ChatReactions(); + } + if (!m->reactions_are_possible && is_service_message_content(m->content->get_type())) { return ChatReactions(); } auto dialog_id = d->dialog_id; @@ -7898,7 +7227,7 @@ bool MessagesManager::need_poll_message_reactions(const Dialog *d, const Message if (m->available_reactions_generation == d->available_reactions_generation) { return false; } - if (is_service_message_content(m->content->get_type())) { + if (is_service_message_content(m->content->get_type()) && !m->reactions_are_possible) { return false; } return true; @@ -8010,11 +7339,7 @@ void MessagesManager::reget_dialog_action_bar(DialogId dialog_id, const char *so return; case DialogType::Chat: case DialogType::Channel: - if (!td_->dialog_manager_->have_input_peer(dialog_id, false, AccessRights::Read)) { - return; - } - - return td_->create_handler()->send(dialog_id); + return td_->dialog_manager_->reget_peer_settings(dialog_id); case DialogType::SecretChat: case DialogType::None: default: @@ -8085,7 +7410,7 @@ void MessagesManager::remove_dialog_action_bar(DialogId dialog_id, Promise d->action_bar = nullptr; send_update_chat_action_bar(d); - toggle_dialog_report_spam_state_on_server(dialog_id, false, 0, std::move(promise)); + td_->dialog_manager_->toggle_dialog_report_spam_state_on_server(dialog_id, false, 0, std::move(promise)); } void MessagesManager::hide_all_business_bot_manager_bars() { @@ -8130,62 +7455,6 @@ void MessagesManager::do_repair_dialog_active_group_call_id(DialogId dialog_id) td_->dialog_manager_->reload_dialog_info_full(dialog_id, "do_repair_dialog_active_group_call_id"); } -class MessagesManager::ToggleDialogReportSpamStateOnServerLogEvent { - public: - DialogId dialog_id_; - bool is_spam_dialog_; - - template - void store(StorerT &storer) const { - td::store(dialog_id_, storer); - td::store(is_spam_dialog_, storer); - } - - template - void parse(ParserT &parser) { - td::parse(dialog_id_, parser); - td::parse(is_spam_dialog_, parser); - } -}; - -uint64 MessagesManager::save_toggle_dialog_report_spam_state_on_server_log_event(DialogId dialog_id, - bool is_spam_dialog) { - ToggleDialogReportSpamStateOnServerLogEvent log_event{dialog_id, is_spam_dialog}; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::toggle_dialog_report_spam_state_on_server(DialogId dialog_id, bool is_spam_dialog, - uint64 log_event_id, Promise &&promise) { - if (log_event_id == 0 && G()->use_message_database()) { - log_event_id = save_toggle_dialog_report_spam_state_on_server_log_event(dialog_id, is_spam_dialog); - } - - auto new_promise = get_erase_log_event_promise(log_event_id, std::move(promise)); - promise = std::move(new_promise); // to prevent self-move - - switch (dialog_id.get_type()) { - case DialogType::User: - case DialogType::Chat: - case DialogType::Channel: - return td_->create_handler(std::move(promise))->send(dialog_id, is_spam_dialog); - case DialogType::SecretChat: - if (is_spam_dialog) { - return td_->create_handler(std::move(promise))->send(dialog_id); - } else { - auto user_id = td_->user_manager_->get_secret_chat_user_id(dialog_id.get_secret_chat_id()); - if (!user_id.is_valid()) { - return promise.set_error(Status::Error(400, "Peer user not found")); - } - return td_->create_handler(std::move(promise))->send(DialogId(user_id), false); - } - case DialogType::None: - default: - UNREACHABLE(); - return; - } -} - void MessagesManager::on_get_peer_settings(DialogId dialog_id, tl_object_ptr &&peer_settings, bool ignore_privacy_exception) { @@ -9531,102 +8800,6 @@ void MessagesManager::on_get_dialog_message_count(DialogId dialog_id, SavedMessa promise.set_value(std::move(total_count)); } -void MessagesManager::on_get_messages_search_result(const string &query, int32 offset_date, DialogId offset_dialog_id, - MessageId offset_message_id, int32 limit, - MessageSearchFilter filter, int32 min_date, int32 max_date, - int32 total_count, - vector> &&messages, - int32 next_rate, - Promise> &&promise) { - TRY_STATUS_PROMISE(promise, G()->close_status()); - - LOG(INFO) << "Receive " << messages.size() << " found messages"; - - FoundMessages found_messages; - auto &result = found_messages.message_full_ids; - MessageSearchOffset next_offset; - for (auto &message : messages) { - next_offset.update_from_message(message); - - bool is_channel_message = DialogId::get_message_dialog_id(message).get_type() == DialogType::Channel; - auto new_message_full_id = on_get_message(std::move(message), false, is_channel_message, false, "search messages"); - if (new_message_full_id != MessageFullId()) { - result.push_back(new_message_full_id); - } else { - total_count--; - } - } - if (total_count < static_cast(result.size())) { - LOG(ERROR) << "Receive " << result.size() << " valid messages out of " << total_count << " in " << messages.size() - << " messages"; - total_count = static_cast(result.size()); - } - found_messages.total_count = total_count; - if (!result.empty()) { - if (next_rate > 0) { - next_offset.date_ = next_rate; - } - found_messages.next_offset = next_offset.to_string(); - } - promise.set_value(get_found_messages_object(found_messages, "on_get_messages_search_result")); -} - -void MessagesManager::on_get_hashtag_search_result(const string &hashtag, const MessageSearchOffset &old_offset, - int32 limit, int32 total_count, - vector> &&messages, - int32 next_rate, - Promise> &&promise) { - TRY_STATUS_PROMISE(promise, G()->close_status()); - - FoundMessages found_messages; - auto &result = found_messages.message_full_ids; - MessageSearchOffset next_offset; - for (auto &message : messages) { - next_offset.update_from_message(message); - - auto new_message_full_id = on_get_message(std::move(message), false, true, false, "search hashtag"); - if (new_message_full_id != MessageFullId()) { - result.push_back(new_message_full_id); - } else { - total_count--; - } - } - if (total_count < static_cast(result.size())) { - LOG(ERROR) << "Receive " << result.size() << " valid messages out of " << total_count << " in " << messages.size() - << " messages"; - total_count = static_cast(result.size()); - } - found_messages.total_count = total_count; - if (!result.empty()) { - if (next_rate > 0) { - next_offset.date_ = next_rate; - } - found_messages.next_offset = next_offset.to_string(); - } - promise.set_value(get_found_messages_object(found_messages, "on_get_hashtag_search_result")); -} - -void MessagesManager::on_get_outgoing_document_messages(vector> &&messages, - Promise> &&promise) { - TRY_STATUS_PROMISE(promise, G()->close_status()); - - FoundMessages found_messages; - for (auto &message : messages) { - auto dialog_id = DialogId::get_message_dialog_id(message); - auto message_full_id = on_get_message(std::move(message), false, dialog_id.get_type() == DialogType::Channel, false, - "on_get_outgoing_document_messages"); - if (message_full_id != MessageFullId()) { - CHECK(dialog_id == message_full_id.get_dialog_id()); - found_messages.message_full_ids.push_back(message_full_id); - } - } - auto result = get_found_messages_object(found_messages, "on_get_outgoing_document_messages"); - td::remove_if(result->messages_, - [](const auto &message) { return message->content_->get_id() != td_api::messageDocument::ID; }); - result->total_count_ = narrow_cast(result->messages_.size()); - promise.set_value(std::move(result)); -} - void MessagesManager::on_get_scheduled_server_messages(DialogId dialog_id, uint32 generation, vector> &&messages, bool is_not_modified) { @@ -9640,7 +8813,7 @@ void MessagesManager::on_get_scheduled_server_messages(DialogId dialog_id, uint3 d->scheduled_messages_sync_generation = generation; if (is_not_modified) { - LOG(INFO) << "Scheduled messages are mot modified in " << dialog_id; + LOG(INFO) << "Scheduled messages are not modified in " << dialog_id; return; } @@ -9692,44 +8865,6 @@ void MessagesManager::on_get_scheduled_server_messages(DialogId dialog_id, uint3 send_update_chat_has_scheduled_messages(d, false); } -void MessagesManager::on_get_recent_locations(DialogId dialog_id, int32 limit, int32 total_count, - vector> &&messages, - Promise> &&promise) { - TRY_STATUS_PROMISE(promise, G()->close_status()); - - LOG(INFO) << "Receive " << messages.size() << " recent locations in " << dialog_id; - vector result; - for (auto &message : messages) { - auto new_message_full_id = on_get_message(std::move(message), false, dialog_id.get_type() == DialogType::Channel, - false, "get recent locations"); - if (new_message_full_id != MessageFullId()) { - if (new_message_full_id.get_dialog_id() != dialog_id) { - LOG(ERROR) << "Receive " << new_message_full_id << " instead of a message in " << dialog_id; - total_count--; - continue; - } - auto m = get_message(new_message_full_id); - CHECK(m != nullptr); - if (m->content->get_type() != MessageContentType::LiveLocation) { - LOG(ERROR) << "Receive a message of wrong type " << m->content->get_type() << " in on_get_recent_locations in " - << dialog_id; - total_count--; - continue; - } - - result.push_back(m->message_id); - } else { - total_count--; - } - } - if (total_count < static_cast(result.size())) { - LOG(ERROR) << "Receive " << result.size() << " valid messages out of " << total_count << " in " << messages.size() - << " messages"; - total_count = static_cast(result.size()); - } - promise.set_value(get_messages_object(total_count, dialog_id, result, true, "on_get_recent_locations")); -} - void MessagesManager::delete_messages_from_updates(const vector &message_ids, bool is_permanent) { FlatHashMap, DialogIdHash> deleted_message_ids; FlatHashMap need_update_dialog_pos; @@ -10415,11 +9550,9 @@ void MessagesManager::delete_dialog_history(DialogId dialog_id, bool remove_from } removed_sponsored_dialog_id_ = dialog_id; - remove_sponsored_dialog(); - if (dialog_id.get_type() != DialogType::SecretChat) { - td_->create_handler()->send(dialog_id); - } + td_->promo_data_manager_->hide_promo_data(dialog_id); + promise.set_value(Unit()); return; } @@ -10700,7 +9833,7 @@ void MessagesManager::delete_dialog_messages_by_sender(DialogId dialog_id, Dialo } channel_status = td_->chat_manager_->get_channel_permissions(channel_id); if (!channel_status.can_delete_messages()) { - return promise.set_error(Status::Error(400, "Need delete messages administator right in the supergroup chat")); + return promise.set_error(Status::Error(400, "Need delete messages administrator right in the supergroup chat")); } channel_id = dialog_id.get_channel_id(); break; @@ -12230,7 +11363,7 @@ vector MessagesManager::get_message_user_ids(const Message *m) const { vector MessagesManager::get_message_channel_ids(const Message *m) const { vector channel_ids; - if (m->sender_dialog_id.is_valid() && m->sender_dialog_id.get_type() == DialogType::Channel) { + if (m->sender_dialog_id.get_type() == DialogType::Channel) { channel_ids.push_back(m->sender_dialog_id.get_channel_id()); } if (m->forward_info != nullptr) { @@ -13184,7 +12317,7 @@ void MessagesManager::on_resolve_secret_chat_message_via_bot_username(const stri Promise &&promise) { if (!G()->close_flag()) { auto dialog_id = td_->dialog_manager_->get_resolved_dialog_by_username(via_bot_username); - if (dialog_id.is_valid() && dialog_id.get_type() == DialogType::User) { + if (dialog_id.get_type() == DialogType::User) { auto user_id = dialog_id.get_user_id(); auto r_bot_data = td_->user_manager_->get_bot_data(user_id); if (r_bot_data.is_ok() && r_bot_data.ok().is_inline) { @@ -13452,6 +12585,7 @@ MessagesManager::MessageInfo MessagesManager::parse_telegram_api_message( message_info.sender_dialog_id = message_info.dialog_id; } message_info.date = message->date_; + message_info.reactions = std::move(message->reactions_); message_info.ttl_period = message->ttl_period_; message_info.is_outgoing = message->out_; message_info.is_silent = message->silent_; @@ -13459,6 +12593,7 @@ MessagesManager::MessageInfo MessagesManager::parse_telegram_api_message( message_info.is_legacy = message->legacy_; message_info.has_mention = message->mentioned_; message_info.has_unread_content = message->media_unread_; + message_info.reactions_are_possible = message->reactions_are_possible_; bool can_have_thread = message_info.dialog_id.get_type() == DialogType::Channel && !td->dialog_manager_->is_broadcast_channel(message_info.dialog_id); message_info.reply_header = MessageReplyHeader(td, std::move(message->reply_to_), message_info.dialog_id, @@ -13477,7 +12612,7 @@ MessagesManager::MessageInfo MessagesManager::parse_telegram_api_message( UNREACHABLE(); break; } - if (message_info.sender_dialog_id.is_valid() && message_info.sender_dialog_id.get_type() == DialogType::User) { + if (message_info.sender_dialog_id.get_type() == DialogType::User) { message_info.sender_user_id = message_info.sender_dialog_id.get_user_id(); message_info.sender_dialog_id = DialogId(); } @@ -13742,6 +12877,7 @@ std::pair> MessagesManager::creat message->is_pinned = is_pinned; message->noforwards = noforwards; message->video_processing_pending = message_info.video_processing_pending; + message->reactions_are_possible = message_info.reactions_are_possible; message->interaction_info_update_date = G()->unix_time(); message->view_count = view_count; message->forward_count = forward_count; @@ -13850,11 +12986,15 @@ MessageFullId MessagesManager::on_get_message(MessageInfo &&message_info, const const bool is_channel_message, const char *source) { DialogId dialog_id; unique_ptr new_message; + auto report_delivery_until_date = message_info.report_delivery_until_date; std::tie(dialog_id, new_message) = create_message(td_, std::move(message_info), is_channel_message, false, source); if (new_message == nullptr) { return MessageFullId(); } MessageId message_id = new_message->message_id; + if (report_delivery_until_date != 0 && message_id.is_valid() && message_id.is_server()) { + td_->message_query_manager_->report_message_delivery({dialog_id, message_id}, report_delivery_until_date, false); + } bool need_update = from_update; bool need_update_dialog_pos = false; @@ -16616,44 +15756,6 @@ bool MessagesManager::is_dialog_blocked(DialogId dialog_id) const { return d != nullptr && d->is_blocked; } -void MessagesManager::get_blocked_dialogs(const td_api::object_ptr &block_list, int32 offset, - int32 limit, Promise> &&promise) { - if (offset < 0) { - return promise.set_error(Status::Error(400, "Parameter offset must be non-negative")); - } - - if (limit <= 0) { - return promise.set_error(Status::Error(400, "Parameter limit must be positive")); - } - - auto block_list_id = BlockListId(block_list); - if (!block_list_id.is_valid()) { - return promise.set_error(Status::Error(400, "Block list must be non-empty")); - } - - td_->create_handler(std::move(promise))->send(block_list_id, offset, limit); -} - -void MessagesManager::on_get_blocked_dialogs(int32 offset, int32 limit, int32 total_count, - vector> &&blocked_peers, - Promise> &&promise) { - LOG(INFO) << "Receive " << blocked_peers.size() << " blocked chats from offset " << offset << " out of " - << total_count; - auto peers = transform(std::move(blocked_peers), [](tl_object_ptr &&blocked_peer) { - return std::move(blocked_peer->peer_id_); - }); - auto dialog_ids = get_message_sender_dialog_ids(td_, std::move(peers)); - if (!dialog_ids.empty() && offset + dialog_ids.size() > static_cast(total_count)) { - LOG(ERROR) << "Fix total count of blocked chats from " << total_count << " to " << offset + dialog_ids.size(); - total_count = offset + narrow_cast(dialog_ids.size()); - } - - auto senders = transform(dialog_ids, [td = td_](DialogId dialog_id) { - return get_message_sender_object(td, dialog_id, "on_get_blocked_dialogs"); - }); - promise.set_value(td_api::make_object(total_count, std::move(senders))); -} - void MessagesManager::add_edited_message(DialogId dialog_id, MessageId message_id, unique_ptr edited_message) { if (message_id.is_scheduled()) { @@ -17647,7 +16749,7 @@ MessagesManager::ReportDialogFromActionBar MessagesManager::report_dialog_from_a } promise.set_value(td_api::make_object()); }); - toggle_dialog_report_spam_state_on_server(dialog_id, true, 0, std::move(query_promise)); + td_->dialog_manager_->toggle_dialog_report_spam_state_on_server(dialog_id, true, 0, std::move(query_promise)); } return result; } @@ -18305,55 +17407,11 @@ Status MessagesManager::toggle_dialog_is_pinned(DialogListId dialog_list_id, Dia } if (set_dialog_is_pinned(dialog_list_id, d, is_pinned)) { - toggle_dialog_is_pinned_on_server(dialog_id, is_pinned, 0); + td_->dialog_manager_->toggle_dialog_is_pinned_on_server(dialog_id, is_pinned, 0); } return Status::OK(); } -class MessagesManager::ToggleDialogIsPinnedOnServerLogEvent { - public: - DialogId dialog_id_; - bool is_pinned_; - - template - void store(StorerT &storer) const { - BEGIN_STORE_FLAGS(); - STORE_FLAG(is_pinned_); - END_STORE_FLAGS(); - - td::store(dialog_id_, storer); - } - - template - void parse(ParserT &parser) { - BEGIN_PARSE_FLAGS(); - PARSE_FLAG(is_pinned_); - END_PARSE_FLAGS(); - - td::parse(dialog_id_, parser); - } -}; - -uint64 MessagesManager::save_toggle_dialog_is_pinned_on_server_log_event(DialogId dialog_id, bool is_pinned) { - ToggleDialogIsPinnedOnServerLogEvent log_event{dialog_id, is_pinned}; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsPinnedOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::toggle_dialog_is_pinned_on_server(DialogId dialog_id, bool is_pinned, uint64 log_event_id) { - CHECK(!td_->auth_manager_->is_bot()); - if (log_event_id == 0 && dialog_id.get_type() == DialogType::SecretChat) { - // don't even create new binlog events - return; - } - - if (log_event_id == 0 && G()->use_message_database()) { - log_event_id = save_toggle_dialog_is_pinned_on_server_log_event(dialog_id, is_pinned); - } - - td_->create_handler(get_erase_log_event_promise(log_event_id))->send(dialog_id, is_pinned); -} - bool MessagesManager::set_folder_pinned_dialogs(FolderId folder_id, vector old_dialog_ids, vector new_dialog_ids) { LOG(INFO) << "Reorder pinned chats in " << folder_id << " from " << old_dialog_ids << " to " << new_dialog_ids; @@ -18519,52 +17577,11 @@ Status MessagesManager::toggle_dialog_view_as_messages(DialogId dialog_id, bool set_dialog_view_as_messages(d, view_as_messages, "toggle_dialog_view_as_messages"); if (!is_saved_messages) { - toggle_dialog_view_as_messages_on_server(dialog_id, view_as_messages, 0); + td_->dialog_manager_->toggle_dialog_view_as_messages_on_server(dialog_id, view_as_messages, 0); } return Status::OK(); } -class MessagesManager::ToggleDialogViewAsMessagesOnServerLogEvent { - public: - DialogId dialog_id_; - bool view_as_messages_; - - template - void store(StorerT &storer) const { - BEGIN_STORE_FLAGS(); - STORE_FLAG(view_as_messages_); - END_STORE_FLAGS(); - - td::store(dialog_id_, storer); - } - - template - void parse(ParserT &parser) { - BEGIN_PARSE_FLAGS(); - PARSE_FLAG(view_as_messages_); - END_PARSE_FLAGS(); - - td::parse(dialog_id_, parser); - } -}; - -uint64 MessagesManager::save_toggle_dialog_view_as_messages_on_server_log_event(DialogId dialog_id, - bool view_as_messages) { - ToggleDialogViewAsMessagesOnServerLogEvent log_event{dialog_id, view_as_messages}; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogViewAsMessagesOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::toggle_dialog_view_as_messages_on_server(DialogId dialog_id, bool view_as_messages, - uint64 log_event_id) { - if (log_event_id == 0 && G()->use_message_database()) { - log_event_id = save_toggle_dialog_view_as_messages_on_server_log_event(dialog_id, view_as_messages); - } - - td_->create_handler(get_erase_log_event_promise(log_event_id)) - ->send(dialog_id, view_as_messages); -} - Status MessagesManager::toggle_dialog_is_marked_as_unread(DialogId dialog_id, bool is_marked_as_unread) { TRY_RESULT(d, check_dialog_access(dialog_id, true, AccessRights::Read, "toggle_dialog_is_marked_as_unread")); if (is_marked_as_unread == d->is_marked_as_unread) { @@ -18573,56 +17590,10 @@ Status MessagesManager::toggle_dialog_is_marked_as_unread(DialogId dialog_id, bo set_dialog_is_marked_as_unread(d, is_marked_as_unread); - toggle_dialog_is_marked_as_unread_on_server(dialog_id, is_marked_as_unread, 0); + td_->dialog_manager_->toggle_dialog_is_marked_as_unread_on_server(dialog_id, is_marked_as_unread, 0); return Status::OK(); } -class MessagesManager::ToggleDialogIsMarkedAsUnreadOnServerLogEvent { - public: - DialogId dialog_id_; - bool is_marked_as_unread_; - - template - void store(StorerT &storer) const { - BEGIN_STORE_FLAGS(); - STORE_FLAG(is_marked_as_unread_); - END_STORE_FLAGS(); - - td::store(dialog_id_, storer); - } - - template - void parse(ParserT &parser) { - BEGIN_PARSE_FLAGS(); - PARSE_FLAG(is_marked_as_unread_); - END_PARSE_FLAGS(); - - td::parse(dialog_id_, parser); - } -}; - -uint64 MessagesManager::save_toggle_dialog_is_marked_as_unread_on_server_log_event(DialogId dialog_id, - bool is_marked_as_unread) { - ToggleDialogIsMarkedAsUnreadOnServerLogEvent log_event{dialog_id, is_marked_as_unread}; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::toggle_dialog_is_marked_as_unread_on_server(DialogId dialog_id, bool is_marked_as_unread, - uint64 log_event_id) { - if (log_event_id == 0 && dialog_id.get_type() == DialogType::SecretChat) { - // don't even create new binlog events - return; - } - - if (log_event_id == 0 && G()->use_message_database()) { - log_event_id = save_toggle_dialog_is_marked_as_unread_on_server_log_event(dialog_id, is_marked_as_unread); - } - - td_->create_handler(get_erase_log_event_promise(log_event_id)) - ->send(dialog_id, is_marked_as_unread); -} - Status MessagesManager::toggle_dialog_is_translatable(DialogId dialog_id, bool is_translatable) { TRY_RESULT(d, check_dialog_access(dialog_id, true, AccessRights::Read, "toggle_dialog_is_translatable")); if (is_translatable == d->is_translatable) { @@ -18631,56 +17602,10 @@ Status MessagesManager::toggle_dialog_is_translatable(DialogId dialog_id, bool i set_dialog_is_translatable(d, is_translatable); - toggle_dialog_is_translatable_on_server(dialog_id, is_translatable, 0); + td_->dialog_manager_->toggle_dialog_is_translatable_on_server(dialog_id, is_translatable, 0); return Status::OK(); } -class MessagesManager::ToggleDialogIsTranslatableOnServerLogEvent { - public: - DialogId dialog_id_; - bool is_translatable_; - - template - void store(StorerT &storer) const { - BEGIN_STORE_FLAGS(); - STORE_FLAG(is_translatable_); - END_STORE_FLAGS(); - - td::store(dialog_id_, storer); - } - - template - void parse(ParserT &parser) { - BEGIN_PARSE_FLAGS(); - PARSE_FLAG(is_translatable_); - END_PARSE_FLAGS(); - - td::parse(dialog_id_, parser); - } -}; - -uint64 MessagesManager::save_toggle_dialog_is_translatable_on_server_log_event(DialogId dialog_id, - bool is_translatable) { - ToggleDialogIsTranslatableOnServerLogEvent log_event{dialog_id, is_translatable}; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsTranslatableOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::toggle_dialog_is_translatable_on_server(DialogId dialog_id, bool is_translatable, - uint64 log_event_id) { - if (log_event_id == 0 && dialog_id.get_type() == DialogType::SecretChat) { - // don't even create new binlog events - return; - } - - if (log_event_id == 0 && G()->use_message_database()) { - log_event_id = save_toggle_dialog_is_translatable_on_server_log_event(dialog_id, is_translatable); - } - - td_->create_handler(get_erase_log_event_promise(log_event_id)) - ->send(dialog_id, is_translatable); -} - Status MessagesManager::set_message_sender_block_list(const td_api::object_ptr &sender, const td_api::object_ptr &block_list) { TRY_RESULT(dialog_id, get_message_sender_dialog_id(td_, sender, true, false)); @@ -18726,54 +17651,10 @@ Status MessagesManager::set_message_sender_block_list(const td_api::object_ptruser_manager_->on_update_user_is_blocked(dialog_id.get_user_id(), is_blocked, is_blocked_for_stories); } - toggle_dialog_is_blocked_on_server(dialog_id, is_blocked, is_blocked_for_stories, 0); + td_->dialog_manager_->toggle_dialog_is_blocked_on_server(dialog_id, is_blocked, is_blocked_for_stories, 0); return Status::OK(); } -class MessagesManager::ToggleDialogIsBlockedOnServerLogEvent { - public: - DialogId dialog_id_; - bool is_blocked_; - bool is_blocked_for_stories_; - - template - void store(StorerT &storer) const { - BEGIN_STORE_FLAGS(); - STORE_FLAG(is_blocked_); - STORE_FLAG(is_blocked_for_stories_); - END_STORE_FLAGS(); - - td::store(dialog_id_, storer); - } - - template - void parse(ParserT &parser) { - BEGIN_PARSE_FLAGS(); - PARSE_FLAG(is_blocked_); - PARSE_FLAG(is_blocked_for_stories_); - END_PARSE_FLAGS(); - - td::parse(dialog_id_, parser); - } -}; - -uint64 MessagesManager::save_toggle_dialog_is_blocked_on_server_log_event(DialogId dialog_id, bool is_blocked, - bool is_blocked_for_stories) { - ToggleDialogIsBlockedOnServerLogEvent log_event{dialog_id, is_blocked, is_blocked_for_stories}; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ToggleDialogIsBlockedOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::toggle_dialog_is_blocked_on_server(DialogId dialog_id, bool is_blocked, - bool is_blocked_for_stories, uint64 log_event_id) { - if (log_event_id == 0 && G()->use_message_database()) { - log_event_id = save_toggle_dialog_is_blocked_on_server_log_event(dialog_id, is_blocked, is_blocked_for_stories); - } - - td_->create_handler(get_erase_log_event_promise(log_event_id)) - ->send(dialog_id, is_blocked, is_blocked_for_stories); -} - Status MessagesManager::toggle_dialog_silent_send_message(DialogId dialog_id, bool silent_send_message) { CHECK(!td_->auth_manager_->is_bot()); @@ -20020,46 +18901,13 @@ Status MessagesManager::set_dialog_notification_settings( return Status::OK(); } -void MessagesManager::reset_all_notification_settings() { - CHECK(!td_->auth_manager_->is_bot()); - +void MessagesManager::reset_all_dialog_notification_settings() { dialogs_.foreach([&](const DialogId &dialog_id, unique_ptr &dialog) { DialogNotificationSettings new_dialog_settings; new_dialog_settings.is_synchronized = true; Dialog *d = dialog.get(); update_dialog_notification_settings(dialog_id, &d->notification_settings, std::move(new_dialog_settings)); }); - - td_->notification_settings_manager_->reset_scope_notification_settings(); - - reset_all_notification_settings_on_server(0); -} - -class MessagesManager::ResetAllNotificationSettingsOnServerLogEvent { - public: - template - void store(StorerT &storer) const { - } - - template - void parse(ParserT &parser) { - } -}; - -uint64 MessagesManager::save_reset_all_notification_settings_on_server_log_event() { - ResetAllNotificationSettingsOnServerLogEvent log_event; - return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ResetAllNotificationSettingsOnServer, - get_log_event_storer(log_event)); -} - -void MessagesManager::reset_all_notification_settings_on_server(uint64 log_event_id) { - CHECK(!td_->auth_manager_->is_bot()); - if (log_event_id == 0) { - log_event_id = save_reset_all_notification_settings_on_server_log_event(); - } - - LOG(INFO) << "Reset all notification settings"; - td_->notification_settings_manager_->reset_notify_settings(get_erase_log_event_promise(log_event_id)); } tl_object_ptr MessagesManager::get_dialog_history(DialogId dialog_id, MessageId from_message_id, @@ -20978,73 +19826,6 @@ void MessagesManager::search_call_messages(const string &offset, int32 limit, bo td_->create_handler(std::move(promise))->send(offset_message_id, limit, filter); } -void MessagesManager::search_outgoing_document_messages(const string &query, int32 limit, - Promise> &&promise) { - if (limit <= 0) { - return promise.set_error(Status::Error(400, "Parameter limit must be positive")); - } - if (limit > MAX_SEARCH_MESSAGES) { - limit = MAX_SEARCH_MESSAGES; - } - - td_->create_handler(std::move(promise))->send(query, limit); -} - -void MessagesManager::search_hashtag_posts(string hashtag, string offset_str, int32 limit, - Promise> &&promise) { - if (limit <= 0) { - return promise.set_error(Status::Error(400, "Parameter limit must be positive")); - } - if (limit > MAX_SEARCH_MESSAGES) { - limit = MAX_SEARCH_MESSAGES; - } - - TRY_RESULT_PROMISE(promise, offset, MessageSearchOffset::from_string(offset_str)); - - bool is_cashtag = false; - if (hashtag[0] == '#' || hashtag[0] == '$') { - is_cashtag = (hashtag[0] == '$'); - hashtag = hashtag.substr(1); - } - if (hashtag.empty()) { - return promise.set_value(get_found_messages_object({}, "search_hashtag_posts")); - } - send_closure(is_cashtag ? td_->cashtag_search_hints_ : td_->hashtag_search_hints_, &HashtagHints::hashtag_used, - hashtag); - - td_->create_handler(std::move(promise)) - ->send(PSTRING() << (is_cashtag ? '$' : '#') << hashtag, offset, limit); -} - -void MessagesManager::search_dialog_recent_location_messages(DialogId dialog_id, int32 limit, - Promise> &&promise) { - LOG(INFO) << "Search recent location messages in " << dialog_id << " with limit " << limit; - - if (limit <= 0) { - return promise.set_error(Status::Error(400, "Parameter limit must be positive")); - } - if (limit > MAX_SEARCH_MESSAGES) { - limit = MAX_SEARCH_MESSAGES; - } - - const Dialog *d = get_dialog_force(dialog_id, "search_dialog_recent_location_messages"); - if (d == nullptr) { - return promise.set_error(Status::Error(400, "Chat not found")); - } - - switch (dialog_id.get_type()) { - case DialogType::User: - case DialogType::Chat: - case DialogType::Channel: - return td_->create_handler(std::move(promise))->send(dialog_id, limit); - case DialogType::SecretChat: - return promise.set_value(get_messages_object(0, vector>(), false)); - default: - UNREACHABLE(); - promise.set_error(Status::Error(500, "Message search is not supported")); - } -} - void MessagesManager::load_active_live_location_messages(Promise &&promise) { if (!G()->use_message_database() || td_->auth_manager_->is_bot()) { are_active_live_location_messages_loaded_ = true; @@ -21629,38 +20410,6 @@ void MessagesManager::on_message_db_calls_result(Result re promise.set_value(get_found_messages_object(found_messages, "on_message_db_calls_result")); } -void MessagesManager::search_messages(DialogListId dialog_list_id, bool ignore_folder_id, bool broadcasts_only, - const string &query, const string &offset_str, int32 limit, - MessageSearchFilter filter, int32 min_date, int32 max_date, - Promise> &&promise) { - if (!dialog_list_id.is_folder()) { - return promise.set_error(Status::Error(400, "Wrong chat list specified")); - } - if (limit <= 0) { - return promise.set_error(Status::Error(400, "Parameter limit must be positive")); - } - if (limit > MAX_SEARCH_MESSAGES) { - limit = MAX_SEARCH_MESSAGES; - } - - TRY_RESULT_PROMISE(promise, offset, MessageSearchOffset::from_string(offset_str)); - - CHECK(filter != MessageSearchFilter::Call && filter != MessageSearchFilter::MissedCall); - if (filter == MessageSearchFilter::Mention || filter == MessageSearchFilter::UnreadMention || - filter == MessageSearchFilter::UnreadReaction || filter == MessageSearchFilter::FailedToSend || - filter == MessageSearchFilter::Pinned) { - return promise.set_error(Status::Error(400, "The filter is not supported")); - } - - if (query.empty() && filter == MessageSearchFilter::Empty) { - return promise.set_value(get_found_messages_object({}, "search_messages")); - } - - td_->create_handler(std::move(promise)) - ->send(dialog_list_id.get_folder_id(), ignore_folder_id, broadcasts_only, query, offset.date_, offset.dialog_id_, - offset.message_id_, limit, filter, min_date, max_date); -} - void MessagesManager::get_dialog_message_by_date(DialogId dialog_id, int32 date, Promise> &&promise) { TRY_RESULT_PROMISE(promise, d, @@ -24555,7 +23304,7 @@ void MessagesManager::do_send_message(DialogId dialog_id, const Message *m, int3 if (!is_secret) { for (size_t i = 0; i < thumbnail_file_ids.size(); i++) { FileView file_view = td_->file_manager_->get_file_view(file_ids[i]); - if (get_main_file_type(file_view.get_type()) == FileType::Photo) { + if (get_file_type_class(file_view.get_type()) == FileTypeClass::Photo) { thumbnail_file_ids[i] = FileId(); } } @@ -26464,7 +25213,7 @@ void MessagesManager::register_message_reply(DialogId dialog_id, const Message * } void MessagesManager::reregister_message_reply(DialogId dialog_id, const Message *m) { - // reply itself wan't changed, so there is nothing to reregister + // reply itself wasn't changed, so there is nothing to reregister if (!can_register_message_reply(m)) { return; } @@ -26977,7 +25726,7 @@ Result MessagesManager::get_forwarded_messag bool can_use_server_forward = true; for (auto ©_option : copy_options) { - if (!copy_option.is_supported_server_side()) { + if (!copy_option.is_supported_server_side(top_thread_message_id)) { can_use_server_forward = false; break; } @@ -30202,10 +28951,12 @@ bool MessagesManager::process_send_message_fail_error(int32 &error_code, string } else if (content_type == MessageContentType::Contact) { error_message = "Wrong phone number specified"; } else if (content_type == MessageContentType::Story) { - error_message = "Wrong story data specified"; + error_message = "Wrong story file specified"; } else { error_message = "Wrong file identifier/HTTP URL specified"; } + } else if (error_message == "EXTENDED_MEDIA_INVALID") { + error_message = "Invalid paid media file specified"; } else if (error_message == "PHOTO_EXT_INVALID") { error_message = "Photo has unsupported extension. Use one of .jpg, .jpeg, .gif, .png, .tif or .bmp"; } else { @@ -32782,7 +31533,7 @@ MessagesManager::Message *MessagesManager::on_get_message_from_database(Dialog * // data in the database is always outdated, so return a message from the memory if (dialog_id.get_type() == DialogType::SecretChat) { CHECK(!is_scheduled); - // just in case restore random_id to message_id corespondence + // just in case restore random_id to message_id correspondence // can be needed if there was newer unloaded message with the same random_id add_random_id_to_message_id_correspondence(d, old_message->random_id, old_message->message_id); } @@ -34608,6 +33359,9 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr old_message->video_processing_pending = new_message->video_processing_pending; need_send_update = true; } + if (old_message->reactions_are_possible != new_message->reactions_are_possible) { + old_message->reactions_are_possible = new_message->reactions_are_possible; + } if (old_message->edit_date > 0) { // inline keyboard can be edited @@ -38491,25 +37245,6 @@ void MessagesManager::on_binlog_events(vector &&events) { read_all_dialog_reactions_on_server(dialog_id, event.id_, Promise()); break; } - case LogEvent::HandlerType::ToggleDialogIsPinnedOnServer: { - if (!have_old_message_database) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - ToggleDialogIsPinnedOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - auto dialog_id = log_event.dialog_id_; - Dialog *d = get_dialog_force(dialog_id, "ToggleDialogIsPinnedOnServerLogEvent"); - if (d == nullptr || !td_->dialog_manager_->have_input_peer(dialog_id, true, AccessRights::Read)) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - toggle_dialog_is_pinned_on_server(dialog_id, log_event.is_pinned_, event.id_); - break; - } case LogEvent::HandlerType::ReorderPinnedDialogsOnServer: { if (!have_old_message_database) { binlog_erase(G()->td_db()->get_binlog(), event.id_); @@ -38534,84 +37269,6 @@ void MessagesManager::on_binlog_events(vector &&events) { reorder_pinned_dialogs_on_server(log_event.folder_id_, dialog_ids, event.id_); break; } - case LogEvent::HandlerType::ToggleDialogViewAsMessagesOnServer: { - if (!have_old_message_database) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - ToggleDialogViewAsMessagesOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - auto dialog_id = log_event.dialog_id_; - if (!have_dialog_force(dialog_id, "ToggleDialogViewAsMessagesOnServerLogEvent") || - !td_->dialog_manager_->have_input_peer(dialog_id, true, AccessRights::Read)) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - toggle_dialog_view_as_messages_on_server(dialog_id, log_event.view_as_messages_, event.id_); - break; - } - case LogEvent::HandlerType::ToggleDialogIsTranslatableOnServer: { - if (!have_old_message_database) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - ToggleDialogIsTranslatableOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - auto dialog_id = log_event.dialog_id_; - if (!have_dialog_force(dialog_id, "ToggleDialogIsTranslatableOnServerLogEvent") || - !td_->dialog_manager_->have_input_peer(dialog_id, true, AccessRights::Read)) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - toggle_dialog_is_translatable_on_server(dialog_id, log_event.is_translatable_, event.id_); - break; - } - case LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer: { - if (!have_old_message_database) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - ToggleDialogIsMarkedAsUnreadOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - auto dialog_id = log_event.dialog_id_; - if (!have_dialog_force(dialog_id, "ToggleDialogIsMarkedAsUnreadOnServerLogEvent") || - !td_->dialog_manager_->have_input_peer(dialog_id, true, AccessRights::Read)) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - toggle_dialog_is_marked_as_unread_on_server(dialog_id, log_event.is_marked_as_unread_, event.id_); - break; - } - case LogEvent::HandlerType::ToggleDialogIsBlockedOnServer: { - if (!have_old_message_database) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - ToggleDialogIsBlockedOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - auto dialog_id = log_event.dialog_id_; - if (dialog_id.get_type() == DialogType::SecretChat || - !td_->dialog_manager_->have_dialog_info_force(dialog_id, "ToggleDialogIsBlockedOnServerLogEvent") || - !td_->dialog_manager_->have_input_peer(dialog_id, true, AccessRights::Know)) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - toggle_dialog_is_blocked_on_server(dialog_id, log_event.is_blocked_, log_event.is_blocked_for_stories_, - event.id_); - break; - } case LogEvent::HandlerType::SaveDialogDraftMessageOnServer: { if (!have_old_message_database) { binlog_erase(G()->td_db()->get_binlog(), event.id_); @@ -38652,32 +37309,6 @@ void MessagesManager::on_binlog_events(vector &&events) { update_dialog_notification_settings_on_server(dialog_id, true); break; } - case LogEvent::HandlerType::ResetAllNotificationSettingsOnServer: { - ResetAllNotificationSettingsOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - reset_all_notification_settings_on_server(event.id_); - break; - } - case LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer: { - if (!have_old_message_database) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - ToggleDialogReportSpamStateOnServerLogEvent log_event; - log_event_parse(log_event, event.get_data()).ensure(); - - auto dialog_id = log_event.dialog_id_; - Dialog *d = get_dialog_force(dialog_id, "ToggleDialogReportSpamStateOnServerLogEvent"); - if (d == nullptr || !td_->dialog_manager_->have_input_peer(dialog_id, true, AccessRights::Read)) { - binlog_erase(G()->td_db()->get_binlog(), event.id_); - break; - } - - toggle_dialog_report_spam_state_on_server(dialog_id, log_event.is_spam_dialog_, event.id_, Promise()); - break; - } case LogEvent::HandlerType::SetDialogFolderIdOnServer: { if (!have_old_message_database) { binlog_erase(G()->td_db()->get_binlog(), event.id_); @@ -38963,6 +37594,23 @@ void MessagesManager::stop_poll(MessageFullId message_full_id, td_api::object_pt stop_message_content_poll(td_, m->content.get(), message_full_id, std::move(new_reply_markup), std::move(promise)); } +int64 MessagesManager::get_message_gift_upgrade_star_count(MessageFullId message_full_id) { + auto m = get_message_force(message_full_id, "stop_poll"); + if (m == nullptr || m->content->get_type() != MessageContentType::StarGift) { + return -1; + } + return get_message_content_gift_upgrade_star_count(m->content.get()); +} + +void MessagesManager::finish_gift_upgrade(MessageFullId message_full_id, + Promise> &&promise) { + auto m = get_message_force(message_full_id, "stop_poll"); + if (m == nullptr || m->content->get_type() != MessageContentType::StarGiftUnique) { + return promise.set_error(Status::Error(500, "Gift not found")); + } + promise.set_value(get_message_content_upgrade_gift_result_object(m->content.get(), td_)); +} + Result MessagesManager::get_invoice_message_info(MessageFullId message_full_id) { auto m = get_message_force(message_full_id, "get_invoice_message_info"); if (m == nullptr) { @@ -39039,21 +37687,6 @@ Result MessagesManager::get_giveaway_message_id(MessageFullId m return m->message_id.get_server_message_id(); } -void MessagesManager::remove_sponsored_dialog() { - set_sponsored_dialog(DialogId(), DialogSource()); -} - -void MessagesManager::on_get_sponsored_dialog(tl_object_ptr peer, DialogSource source, - vector> users, - vector> chats) { - CHECK(peer != nullptr); - - td_->user_manager_->on_get_users(std::move(users), "on_get_sponsored_dialog"); - td_->chat_manager_->on_get_chats(std::move(chats), "on_get_sponsored_dialog"); - - set_sponsored_dialog(DialogId(peer), std::move(source)); -} - void MessagesManager::add_sponsored_dialog(const Dialog *d, DialogSource source) { if (td_->auth_manager_->is_bot()) { return; diff --git a/lib/tgchat/ext/td/td/telegram/MessagesManager.h b/lib/tgchat/ext/td/td/telegram/MessagesManager.h index 72f76728..afe493e8 100644 --- a/lib/tgchat/ext/td/td/telegram/MessagesManager.h +++ b/lib/tgchat/ext/td/td/telegram/MessagesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -120,7 +120,6 @@ struct InputMessageContent; class MessageContent; class MessageForwardInfo; struct MessageReactions; -struct MessageSearchOffset; class MissingInvitees; class Td; class Usernames; @@ -205,26 +204,9 @@ class MessagesManager final : public Actor { void on_get_dialog_message_count(DialogId dialog_id, SavedMessagesTopicId saved_messages_topic_id, MessageSearchFilter filter, int32 total_count, Promise &&promise); - void on_get_messages_search_result(const string &query, int32 offset_date, DialogId offset_dialog_id, - MessageId offset_message_id, int32 limit, MessageSearchFilter filter, - int32 min_date, int32 max_date, int32 total_count, - vector> &&messages, int32 next_rate, - Promise> &&promise); - - void on_get_hashtag_search_result(const string &hashtag, const MessageSearchOffset &old_offset, int32 limit, - int32 total_count, vector> &&messages, - int32 next_rate, Promise> &&promise); - - void on_get_outgoing_document_messages(vector> &&messages, - Promise> &&promise); - void on_get_scheduled_server_messages(DialogId dialog_id, uint32 generation, vector> &&messages, bool is_not_modified); - void on_get_recent_locations(DialogId dialog_id, int32 limit, int32 total_count, - vector> &&messages, - Promise> &&promise); - MessageFullId on_get_message(tl_object_ptr message_ptr, bool from_update, bool is_channel_message, bool is_scheduled, const char *source); @@ -366,8 +348,6 @@ class MessagesManager final : public Actor { void on_read_channel_inbox(ChannelId channel_id, MessageId max_message_id, int32 server_unread_count, int32 pts, const char *source); - void on_read_channel_outbox(ChannelId channel_id, MessageId max_message_id); - void on_update_channel_max_unavailable_message_id(ChannelId channel_id, MessageId max_unavailable_message_id, const char *source); @@ -379,6 +359,8 @@ class MessagesManager final : public Actor { void read_history_inbox(DialogId dialog_id, MessageId max_message_id, int32 unread_count, const char *source); + void read_history_outbox(DialogId dialog_id, MessageId max_message_id, int32 read_date = -1); + void delete_messages(DialogId dialog_id, const vector &message_ids, bool revoke, Promise &&promise); void on_failed_message_deletion(DialogId dialog_id, const vector &server_message_ids); @@ -562,13 +544,6 @@ class MessagesManager final : public Actor { bool is_dialog_blocked(DialogId dialog_id) const; - void get_blocked_dialogs(const td_api::object_ptr &block_list, int32 offset, int32 limit, - Promise> &&promise); - - void on_get_blocked_dialogs(int32 offset, int32 limit, int32 total_count, - vector> &&blocked_peers, - Promise> &&promise); - static Status can_report_message(MessageId message_id); bool can_share_message_in_story(MessageFullId message_full_id); @@ -695,7 +670,7 @@ class MessagesManager final : public Actor { tl_object_ptr &¬ification_settings) TD_WARN_UNUSED_RESULT; - void reset_all_notification_settings(); + void reset_all_dialog_notification_settings(); void update_story_max_reply_media_timestamp_in_replied_messages(StoryFullId story_full_id); @@ -747,22 +722,9 @@ class MessagesManager final : public Actor { MessageSearchFilter filter, Promise> &&promise); - void search_messages(DialogListId dialog_list_id, bool ignore_folder_id, bool broadcasts_only, const string &query, - const string &offset_str, int32 limit, MessageSearchFilter filter, int32 min_date, - int32 max_date, Promise> &&promise); - void search_call_messages(const string &offset, int32 limit, bool only_missed, Promise> &&promise); - void search_outgoing_document_messages(const string &query, int32 limit, - Promise> &&promise); - - void search_hashtag_posts(string hashtag, string offset_str, int32 limit, - Promise> &&promise); - - void search_dialog_recent_location_messages(DialogId dialog_id, int32 limit, - Promise> &&promise); - void load_active_live_location_messages(Promise &&promise); void get_dialog_message_by_date(DialogId dialog_id, int32 date, @@ -929,11 +891,7 @@ class MessagesManager final : public Actor { void on_get_dialog_query_finished(DialogId dialog_id, Status &&status); - void remove_sponsored_dialog(); - - void on_get_sponsored_dialog(tl_object_ptr peer, DialogSource source, - vector> users, - vector> chats); + void set_sponsored_dialog(DialogId dialog_id, DialogSource source); FileSourceId get_message_file_source_id(MessageFullId message_full_id, bool force = false); @@ -978,6 +936,11 @@ class MessagesManager final : public Actor { void stop_poll(MessageFullId message_full_id, td_api::object_ptr &&reply_markup, Promise &&promise); + int64 get_message_gift_upgrade_star_count(MessageFullId message_full_id); + + void finish_gift_upgrade(MessageFullId message_full_id, + Promise> &&promise); + Result get_login_button_url(MessageFullId message_full_id, int64 button_id); struct InvoiceMessageInfo { @@ -1038,6 +1001,7 @@ class MessagesManager final : public Actor { string author_signature; int64 media_album_id = 0; MessageEffectId effect_id; + int32 report_delivery_until_date = 0; bool is_outgoing = false; bool is_silent = false; bool is_channel_post = false; @@ -1051,6 +1015,7 @@ class MessagesManager final : public Actor { bool has_unread_content = false; bool invert_media = false; bool video_processing_pending = false; + bool reactions_are_possible = false; unique_ptr content; tl_object_ptr reply_markup; @@ -1114,6 +1079,7 @@ class MessagesManager final : public Actor { bool invert_media = false; bool disable_web_page_preview = false; bool video_processing_pending = false; + bool reactions_are_possible = false; bool has_explicit_sender = false; // for send_message bool is_copy = false; // for send_message @@ -1610,7 +1576,6 @@ class MessagesManager final : public Actor { class ReadMessageThreadHistoryOnServerLogEvent; class RegetDialogLogEvent; class ReorderPinnedDialogsOnServerLogEvent; - class ResetAllNotificationSettingsOnServerLogEvent; class SaveDialogDraftMessageOnServerLogEvent; class SendBotStartMessageLogEvent; class SendInlineQueryResultMessageLogEvent; @@ -1618,12 +1583,6 @@ class MessagesManager final : public Actor { class SendQuickReplyShortcutMessagesLogEvent; class SendScreenshotTakenNotificationMessageLogEvent; class SetDialogFolderIdOnServerLogEvent; - class ToggleDialogIsBlockedOnServerLogEvent; - class ToggleDialogViewAsMessagesOnServerLogEvent; - class ToggleDialogIsMarkedAsUnreadOnServerLogEvent; - class ToggleDialogIsTranslatableOnServerLogEvent; - class ToggleDialogIsPinnedOnServerLogEvent; - class ToggleDialogReportSpamStateOnServerLogEvent; class UnpinAllDialogMessagesOnServerLogEvent; class UpdateDialogNotificationSettingsOnServerLogEvent; @@ -1665,7 +1624,7 @@ class MessagesManager final : public Actor { static constexpr int32 AUTH_NOTIFICATION_ID_CACHE_TIME = 7 * 86400; static constexpr size_t MAX_SAVED_AUTH_NOTIFICATION_IDS = 100; - static constexpr int32 MAX_RESEND_DELAY = 86400; // seconds, some resonable limit + static constexpr int32 MAX_RESEND_DELAY = 86400; // seconds, some reasonable limit static constexpr int32 SCHEDULE_WHEN_ONLINE_DATE = 2147483646; @@ -2141,8 +2100,6 @@ class MessagesManager final : public Actor { void repair_dialog_unread_mention_count(Dialog *d, const char *source); - void read_history_outbox(DialogId dialog_id, MessageId max_message_id, int32 read_date = -1); - void read_history_on_server(Dialog *d, MessageId max_message_id); void do_read_history_on_server(DialogId dialog_id); @@ -2605,17 +2562,6 @@ class MessagesManager final : public Actor { void do_set_dialog_folder_id(Dialog *d, FolderId folder_id); - void toggle_dialog_is_pinned_on_server(DialogId dialog_id, bool is_pinned, uint64 log_event_id); - - void toggle_dialog_view_as_messages_on_server(DialogId dialog_id, bool view_as_messages, uint64 log_event_id); - - void toggle_dialog_is_marked_as_unread_on_server(DialogId dialog_id, bool is_marked_as_unread, uint64 log_event_id); - - void toggle_dialog_is_translatable_on_server(DialogId dialog_id, bool is_translatable, uint64 log_event_id); - - void toggle_dialog_is_blocked_on_server(DialogId dialog_id, bool is_blocked, bool is_blocked_for_stories, - uint64 log_event_id); - void reorder_pinned_dialogs_on_server(FolderId folder_id, const vector &dialog_ids, uint64 log_event_id); void set_dialog_reply_markup(Dialog *d, MessageId message_id); @@ -3018,11 +2964,6 @@ class MessagesManager final : public Actor { void on_updated_dialog_notification_settings(DialogId dialog_id, uint64 generation); - void reset_all_notification_settings_on_server(uint64 log_event_id); - - void toggle_dialog_report_spam_state_on_server(DialogId dialog_id, bool is_spam_dialog, uint64 log_event_id, - Promise &&promise); - void set_dialog_folder_id_on_server(DialogId dialog_id, bool from_binlog); void on_updated_dialog_folder_id(DialogId dialog_id, uint64 generation); @@ -3142,8 +3083,6 @@ class MessagesManager final : public Actor { void save_sponsored_dialog(); - void set_sponsored_dialog(DialogId dialog_id, DialogSource source); - Dialog *get_service_notifications_dialog(); static void extract_authentication_codes(DialogId dialog_id, const Message *m, vector &authentication_codes); @@ -3190,8 +3129,6 @@ class MessagesManager final : public Actor { static void save_send_message_log_event(DialogId dialog_id, const Message *m); - static uint64 save_toggle_dialog_report_spam_state_on_server_log_event(DialogId dialog_id, bool is_spam_dialog); - static uint64 save_delete_messages_on_server_log_event(DialogId dialog_id, const vector &message_ids, bool revoke); @@ -3220,25 +3157,11 @@ class MessagesManager final : public Actor { static uint64 save_read_all_dialog_reactions_on_server_log_event(DialogId dialog_id); - static uint64 save_toggle_dialog_is_pinned_on_server_log_event(DialogId dialog_id, bool is_pinned); - static uint64 save_reorder_pinned_dialogs_on_server_log_event(FolderId folder_id, const vector &dialog_ids); - static uint64 save_toggle_dialog_view_as_messages_on_server_log_event(DialogId dialog_id, bool view_as_messages); - - static uint64 save_toggle_dialog_is_marked_as_unread_on_server_log_event(DialogId dialog_id, - bool is_marked_as_unread); - - static uint64 save_toggle_dialog_is_translatable_on_server_log_event(DialogId dialog_id, bool is_translatable); - - static uint64 save_toggle_dialog_is_blocked_on_server_log_event(DialogId dialog_id, bool is_blocked, - bool is_blocked_for_stories); - static uint64 save_read_message_contents_on_server_log_event(DialogId dialog_id, const vector &message_ids); - static uint64 save_reset_all_notification_settings_on_server_log_event(); - static uint64 save_reget_dialog_log_event(DialogId dialog_id); static uint64 save_forward_messages_log_event(DialogId to_dialog_id, DialogId from_dialog_id, diff --git a/lib/tgchat/ext/td/td/telegram/MinChannel.h b/lib/tgchat/ext/td/td/telegram/MinChannel.h index ea2fdb22..6e1ac436 100644 --- a/lib/tgchat/ext/td/td/telegram/MinChannel.h +++ b/lib/tgchat/ext/td/td/telegram/MinChannel.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MinChannel.hpp b/lib/tgchat/ext/td/td/telegram/MinChannel.hpp index 4b8f1f25..85ceb55e 100644 --- a/lib/tgchat/ext/td/td/telegram/MinChannel.hpp +++ b/lib/tgchat/ext/td/td/telegram/MinChannel.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MissingInvitee.cpp b/lib/tgchat/ext/td/td/telegram/MissingInvitee.cpp index 2d83021d..1ffb65c9 100644 --- a/lib/tgchat/ext/td/td/telegram/MissingInvitee.cpp +++ b/lib/tgchat/ext/td/td/telegram/MissingInvitee.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/MissingInvitee.h b/lib/tgchat/ext/td/td/telegram/MissingInvitee.h index 73ff7a75..18440239 100644 --- a/lib/tgchat/ext/td/td/telegram/MissingInvitee.h +++ b/lib/tgchat/ext/td/td/telegram/MissingInvitee.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NewPasswordState.cpp b/lib/tgchat/ext/td/td/telegram/NewPasswordState.cpp index b4e4a19f..dacbd43c 100644 --- a/lib/tgchat/ext/td/td/telegram/NewPasswordState.cpp +++ b/lib/tgchat/ext/td/td/telegram/NewPasswordState.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NewPasswordState.h b/lib/tgchat/ext/td/td/telegram/NewPasswordState.h index 5daff025..f2724a25 100644 --- a/lib/tgchat/ext/td/td/telegram/NewPasswordState.h +++ b/lib/tgchat/ext/td/td/telegram/NewPasswordState.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Notification.h b/lib/tgchat/ext/td/td/telegram/Notification.h index 966ee540..e198f2fd 100644 --- a/lib/tgchat/ext/td/td/telegram/Notification.h +++ b/lib/tgchat/ext/td/td/telegram/Notification.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupFromDatabase.h b/lib/tgchat/ext/td/td/telegram/NotificationGroupFromDatabase.h index ae7774fc..b5527ec4 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupFromDatabase.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupFromDatabase.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupId.h b/lib/tgchat/ext/td/td/telegram/NotificationGroupId.h index 73865cc9..6ce23653 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupId.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.cpp b/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.cpp index 781fbb24..ef884539 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.h b/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.h index ddc8438c..a56b7621 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.hpp b/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.hpp index f62f2c2f..03c867e4 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupKey.h b/lib/tgchat/ext/td/td/telegram/NotificationGroupKey.h index c9819692..7b4c6ee0 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupKey.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupKey.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupType.cpp b/lib/tgchat/ext/td/td/telegram/NotificationGroupType.cpp index 510ec3c0..4bccc732 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupType.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationGroupType.h b/lib/tgchat/ext/td/td/telegram/NotificationGroupType.h index 543ef46c..55f7d1ad 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationGroupType.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationGroupType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationId.h b/lib/tgchat/ext/td/td/telegram/NotificationId.h index a7971b91..2aa7bbd0 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationId.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationManager.cpp b/lib/tgchat/ext/td/td/telegram/NotificationManager.cpp index 01883a27..2869597a 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,6 +17,7 @@ #include "td/telegram/files/FileManager.h" #include "td/telegram/Global.h" #include "td/telegram/logevent/LogEvent.h" +#include "td/telegram/MessageQueryManager.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/misc.h" #include "td/telegram/net/ConnectionCreator.h" @@ -2814,268 +2815,84 @@ void NotificationManager::process_push_notification(string payload, Promise loc_keys = { + {"CHAT_ADD_MEMBER", "MESSAGE_CHAT_ADD_MEMBERS"}, + {"CHAT_ADD_YOU", "MESSAGE_CHAT_ADD_MEMBERS_YOU"}, + {"CHAT_CREATED", "MESSAGE_BASIC_GROUP_CHAT_CREATE"}, + {"CHAT_DELETE_MEMBER", "MESSAGE_CHAT_DELETE_MEMBER"}, + {"CHAT_DELETE_YOU", "MESSAGE_CHAT_DELETE_MEMBER_YOU"}, + {"CHAT_JOINED", "MESSAGE_CHAT_JOIN_BY_LINK"}, + {"CHAT_LEFT", "MESSAGE_CHAT_DELETE_MEMBER_LEFT"}, + {"CHAT_PHOTO_EDITED", "MESSAGE_CHAT_CHANGE_PHOTO"}, + {"CHAT_REQ_JOINED", "MESSAGE_CHAT_JOIN_BY_REQUEST"}, + {"CHAT_RETURNED", "MESSAGE_CHAT_ADD_MEMBERS_RETURNED"}, + {"CHAT_TITLE_EDITED", "MESSAGE_CHAT_CHANGE_TITLE"}, + {"CONTACT_JOINED", "MESSAGE_CONTACT_REGISTERED"}, + {"ENCRYPTED_MESSAGE", "MESSAGE"}, + {"MESSAGES", "MESSAGES"}, + {"MESSAGE_AUDIO", "MESSAGE_VOICE_NOTE"}, + {"MESSAGE_CONTACT", "MESSAGE_CONTACT"}, + {"MESSAGE_DOC", "MESSAGE_DOCUMENT"}, + {"MESSAGE_DOCS", "MESSAGE_DOCUMENTS"}, + {"MESSAGE_FWDS", "MESSAGE_FORWARDS"}, + {"MESSAGE_GAME", "MESSAGE_GAME"}, + {"MESSAGE_GAME_SCORE", "MESSAGE_GAME_SCORE"}, + {"MESSAGE_GEO", "MESSAGE_LOCATION"}, + {"MESSAGE_GEOLIVE", "MESSAGE_LIVE_LOCATION"}, + {"MESSAGE_GIF", "MESSAGE_ANIMATION"}, + {"MESSAGE_GIFTCODE", "MESSAGE_GIFTCODE"}, + {"MESSAGE_GIVEAWAY", "MESSAGE_GIVEAWAY"}, + {"MESSAGE_GIVEAWAY_STARS", "MESSAGE_GIVEAWAY_STARS"}, + {"MESSAGE_INVOICE", "MESSAGE_INVOICE"}, + {"MESSAGE_NOTEXT", "MESSAGE"}, + {"MESSAGE_NOTHEME", "MESSAGE_CHAT_CHANGE_THEME"}, + {"MESSAGE_PAID_MEDIA", "MESSAGE_PAID_MEDIA"}, + {"MESSAGE_PHOTO", "MESSAGE_PHOTO"}, + {"MESSAGE_PHOTOS", "MESSAGE_PHOTOS"}, + {"MESSAGE_PHOTO_SECRET", "MESSAGE_SECRET_PHOTO"}, + {"MESSAGE_PLAYLIST", "MESSAGE_AUDIOS"}, + {"MESSAGE_POLL", "MESSAGE_POLL"}, + {"MESSAGE_QUIZ", "MESSAGE_QUIZ"}, + {"MESSAGE_RECURRING_PAY", "MESSAGE_RECURRING_PAYMENT"}, + {"MESSAGE_ROUND", "MESSAGE_VIDEO_NOTE"}, + {"MESSAGE_SAME_WALLPAPER", "MESSAGE_SAME_WALLPAPER"}, + {"MESSAGE_SCREENSHOT", "MESSAGE_SCREENSHOT_TAKEN"}, + {"MESSAGE_STARGIFT", "MESSAGE_STARGIFT"}, + {"MESSAGE_STARGIFT_UPGRADE", "MESSAGE_STARGIFT_UPGRADE"}, + {"MESSAGE_STICKER", "MESSAGE_STICKER"}, + {"MESSAGE_STORY", "MESSAGE_STORY"}, + {"MESSAGE_SUGGEST_PHOTO", "MESSAGE_SUGGEST_PHOTO"}, + {"MESSAGE_TEXT", "MESSAGE_TEXT"}, + {"MESSAGE_THEME", "MESSAGE_CHAT_CHANGE_THEME"}, + {"MESSAGE_UNIQUE_STARGIFT", "MESSAGE_STARGIFT_TRANSFER"}, + {"MESSAGE_VIDEO", "MESSAGE_VIDEO"}, + {"MESSAGE_VIDEOS", "MESSAGE_VIDEOS"}, + {"MESSAGE_VIDEO_SECRET", "MESSAGE_SECRET_VIDEO"}, + {"MESSAGE_WALLPAPER", "MESSAGE_WALLPAPER"}, + {"PINNED_AUDIO", "PINNED_MESSAGE_VOICE_NOTE"}, + {"PINNED_CONTACT", "PINNED_MESSAGE_CONTACT"}, + {"PINNED_DOC", "PINNED_MESSAGE_DOCUMENT"}, + {"PINNED_GAME", "PINNED_MESSAGE_GAME"}, + {"PINNED_GAME_SCORE", "PINNED_MESSAGE_GAME_SCORE"}, + {"PINNED_GEO", "PINNED_MESSAGE_LOCATION"}, + {"PINNED_GEOLIVE", "PINNED_MESSAGE_LIVE_LOCATION"}, + {"PINNED_GIF", "PINNED_MESSAGE_ANIMATION"}, + {"PINNED_GIVEAWAY", "PINNED_MESSAGE_GIVEAWAY"}, + {"PINNED_GIVEAWAY_STARS", "PINNED_MESSAGE_GIVEAWAY_STARS"}, + {"PINNED_INVOICE", "PINNED_MESSAGE_INVOICE"}, + {"PINNED_NOTEXT", "PINNED_MESSAGE"}, + {"PINNED_PAID_MEDIA", "PINNED_MESSAGE_PAID_MEDIA"}, + {"PINNED_PHOTO", "PINNED_MESSAGE_PHOTO"}, + {"PINNED_POLL", "PINNED_MESSAGE_POLL"}, + {"PINNED_QUIZ", "PINNED_MESSAGE_QUIZ"}, + {"PINNED_ROUND", "PINNED_MESSAGE_VIDEO_NOTE"}, + {"PINNED_STICKER", "PINNED_MESSAGE_STICKER"}, + {"PINNED_STORY", "PINNED_MESSAGE_STORY"}, + {"PINNED_TEXT", "PINNED_MESSAGE_TEXT"}, + {"PINNED_VIDEO", "PINNED_MESSAGE_VIDEO"}}; + auto it = loc_keys.find(loc_key); + if (it != loc_keys.end()) { + return it->second.str(); } return string(); } @@ -3098,7 +2915,7 @@ void NotificationManager::add_push_notification_user( false /*ignored*/, 0, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, sender_user_id.get(), sender_access_hash, user_name, string(), string(), string(), std::move(sender_photo), nullptr, 0, Auto(), string(), string(), nullptr, - vector>(), 0, nullptr, nullptr, 0); + vector>(), 0, nullptr, nullptr, 0, 0); td_->user_manager_->on_get_user(std::move(user), "add_push_notification_user"); } @@ -3158,7 +2975,7 @@ Status NotificationManager::parse_push_notification_attach(DialogId dialog_id, s ends_with(loc_key, "MESSAGE_VOICE_NOTE") || ends_with(loc_key, "MESSAGE_TEXT")) { VLOG(notifications) << "Have attached document"; attached_document = td_->documents_manager_->on_get_document( - telegram_api::move_object_as(result), dialog_id); + telegram_api::move_object_as(result), dialog_id, false); if (!attached_document.empty()) { if (ends_with(loc_key, "_NOTE")) { loc_key.resize(loc_key.rfind('_')); @@ -3680,11 +3497,16 @@ Status NotificationManager::process_push_notification_payload(string payload, bo } else if (custom.has_field("ringtone")) { TRY_RESULT_ASSIGN(ringtone_id, custom.get_optional_long_field("ringtone")); } - add_message_push_notification(dialog_id, MessageId(server_message_id), random_id, sender_user_id, sender_dialog_id, - std::move(sender_name), sent_date, is_from_scheduled, contains_mention, - disable_notification, ringtone_id, std::move(loc_key), std::move(arg), - std::move(attached_photo), std::move(attached_document), NotificationId(), 0, - std::move(promise)); + auto message_id = MessageId(server_message_id); + + TRY_RESULT(report_delivery_until_date, custom.get_optional_int_field("report_delivery_until_date")); + if (report_delivery_until_date > 0) { + td_->message_query_manager_->report_message_delivery({dialog_id, message_id}, report_delivery_until_date, true); + } + add_message_push_notification( + dialog_id, message_id, random_id, sender_user_id, sender_dialog_id, std::move(sender_name), sent_date, + is_from_scheduled, contains_mention, disable_notification, ringtone_id, std::move(loc_key), std::move(arg), + std::move(attached_photo), std::move(attached_document), NotificationId(), 0, std::move(promise)); } return Status::OK(); } diff --git a/lib/tgchat/ext/td/td/telegram/NotificationManager.h b/lib/tgchat/ext/td/td/telegram/NotificationManager.h index 526e7c5e..89968649 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationManager.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationObjectFullId.h b/lib/tgchat/ext/td/td/telegram/NotificationObjectFullId.h index dcd27254..325d11c2 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationObjectFullId.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationObjectFullId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationObjectId.h b/lib/tgchat/ext/td/td/telegram/NotificationObjectId.h index 79032a3b..c77f8a46 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationObjectId.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationObjectId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.cpp b/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.cpp index 836c501f..82f82d2b 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1325,8 +1325,8 @@ Result NotificationSettingsManager::get_ringtone( CHECK(document_id == telegram_api::document::ID); auto parsed_document = - td_->documents_manager_->on_get_document(move_tl_object_as(ringtone), DialogId(), nullptr, - Document::Type::Audio, DocumentsManager::Subtype::Ringtone); + td_->documents_manager_->on_get_document(move_tl_object_as(ringtone), DialogId(), false, + nullptr, Document::Type::Audio, DocumentsManager::Subtype::Ringtone); if (parsed_document.type != Document::Type::Audio) { return Status::Error("Receive ringtone of a wrong type"); } @@ -1358,7 +1358,7 @@ void NotificationSettingsManager::load_saved_ringtones(Promise &&promise) on_saved_ringtones_updated(true); } - // the promis must not be set synchronously + // the promise must not be set synchronously send_closure_later(actor_id(this), &NotificationSettingsManager::on_load_saved_ringtones, std::move(promise)); reload_saved_ringtones(Auto()); } else { @@ -1632,10 +1632,6 @@ void NotificationSettingsManager::update_scope_notification_settings_on_server(N ->send(scope, *get_scope_notification_settings(scope)); } -void NotificationSettingsManager::reset_notify_settings(Promise &&promise) { - td_->create_handler(std::move(promise))->send(); -} - Status NotificationSettingsManager::set_reaction_notification_settings( ReactionNotificationSettings &¬ification_settings) { CHECK(!td_->auth_manager_->is_bot()); @@ -1701,6 +1697,43 @@ void NotificationSettingsManager::get_story_notification_settings_exceptions( td_->create_handler(std::move(promise))->send(); } +void NotificationSettingsManager::reset_all_notification_settings() { + CHECK(!td_->auth_manager_->is_bot()); + + td_->messages_manager_->reset_all_dialog_notification_settings(); + + reset_scope_notification_settings(); + + reset_all_notification_settings_on_server(0); +} + +class NotificationSettingsManager::ResetAllNotificationSettingsOnServerLogEvent { + public: + template + void store(StorerT &storer) const { + } + + template + void parse(ParserT &parser) { + } +}; + +uint64 NotificationSettingsManager::save_reset_all_notification_settings_on_server_log_event() { + ResetAllNotificationSettingsOnServerLogEvent log_event; + return binlog_add(G()->td_db()->get_binlog(), LogEvent::HandlerType::ResetAllNotificationSettingsOnServer, + get_log_event_storer(log_event)); +} + +void NotificationSettingsManager::reset_all_notification_settings_on_server(uint64 log_event_id) { + CHECK(!td_->auth_manager_->is_bot()); + if (log_event_id == 0) { + log_event_id = save_reset_all_notification_settings_on_server_log_event(); + } + + LOG(INFO) << "Reset all notification settings"; + td_->create_handler(get_erase_log_event_promise(log_event_id))->send(); +} + void NotificationSettingsManager::on_binlog_events(vector &&events) { if (G()->close_flag()) { return; @@ -1708,6 +1741,13 @@ void NotificationSettingsManager::on_binlog_events(vector &&events) for (auto &event : events) { CHECK(event.id_ != 0); switch (event.type_) { + case LogEvent::HandlerType::ResetAllNotificationSettingsOnServer: { + ResetAllNotificationSettingsOnServerLogEvent log_event; + log_event_parse(log_event, event.get_data()).ensure(); + + reset_all_notification_settings_on_server(event.id_); + break; + } case LogEvent::HandlerType::UpdateScopeNotificationSettingsOnServer: { UpdateScopeNotificationSettingsOnServerLogEvent log_event; log_event_parse(log_event, event.get_data()).ensure(); diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.h b/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.h index 26b519ea..c44cea5b 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationSettingsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -110,9 +110,7 @@ class NotificationSettingsManager final : public Actor { Status set_reaction_notification_settings(ReactionNotificationSettings &¬ification_settings) TD_WARN_UNUSED_RESULT; - void reset_scope_notification_settings(); - - void reset_notify_settings(Promise &&promise); + void reset_all_notification_settings(); void get_notify_settings_exceptions(NotificationSettingsScope scope, bool filter_scope, bool compare_sound, Promise &&promise); @@ -126,6 +124,7 @@ class NotificationSettingsManager final : public Actor { void get_current_state(vector> &updates) const; private: + class ResetAllNotificationSettingsOnServerLogEvent; class UpdateScopeNotificationSettingsOnServerLogEvent; class UpdateReactionNotificationSettingsOnServerLogEvent; @@ -212,6 +211,12 @@ class NotificationSettingsManager final : public Actor { void update_reaction_notification_settings_on_server(uint64 log_event_id); + void reset_scope_notification_settings(); + + void reset_all_notification_settings_on_server(uint64 log_event_id); + + static uint64 save_reset_all_notification_settings_on_server_log_event(); + Td *td_; ActorShared<> parent_; diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.cpp b/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.cpp index 03fb5550..c4695822 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.h b/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.h index afc837c4..b7601d51 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationSettingsScope.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSound.cpp b/lib/tgchat/ext/td/td/telegram/NotificationSound.cpp index 395fc1f6..46d7d4e4 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSound.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationSound.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSound.h b/lib/tgchat/ext/td/td/telegram/NotificationSound.h index 19ca2538..0618195a 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSound.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationSound.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationSoundType.h b/lib/tgchat/ext/td/td/telegram/NotificationSoundType.h index bdca5b68..952035f0 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationSoundType.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationSoundType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/NotificationType.cpp b/lib/tgchat/ext/td/td/telegram/NotificationType.cpp index fa996915..790800b4 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationType.cpp +++ b/lib/tgchat/ext/td/td/telegram/NotificationType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -347,6 +347,12 @@ class NotificationTypePushMessage final : public NotificationType { auto star_count = to_integer(arg); return td_api::make_object(star_count); } + if (key == "MESSAGE_STARGIFT_TRANSFER") { + return td_api::make_object(false); + } + if (key == "MESSAGE_STARGIFT_UPGRADE") { + return td_api::make_object(true); + } if (key == "MESSAGE_STICKER") { return td_api::make_object( td->stickers_manager_->get_sticker_object(document.file_id), trim(arg), is_pinned); diff --git a/lib/tgchat/ext/td/td/telegram/NotificationType.h b/lib/tgchat/ext/td/td/telegram/NotificationType.h index 1aaf1aeb..e4e8d9d0 100644 --- a/lib/tgchat/ext/td/td/telegram/NotificationType.h +++ b/lib/tgchat/ext/td/td/telegram/NotificationType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OnlineManager.cpp b/lib/tgchat/ext/td/td/telegram/OnlineManager.cpp index 96a3a9fc..228d2a9d 100644 --- a/lib/tgchat/ext/td/td/telegram/OnlineManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/OnlineManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OnlineManager.h b/lib/tgchat/ext/td/td/telegram/OnlineManager.h index fda4803e..dbd8f014 100644 --- a/lib/tgchat/ext/td/td/telegram/OnlineManager.h +++ b/lib/tgchat/ext/td/td/telegram/OnlineManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OptionManager.cpp b/lib/tgchat/ext/td/td/telegram/OptionManager.cpp index 0cf93ddf..827e48ab 100644 --- a/lib/tgchat/ext/td/td/telegram/OptionManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/OptionManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -163,6 +163,9 @@ OptionManager::OptionManager(Td *td) set_default_integer_option("thousand_star_to_usd_rate", 1300); set_default_integer_option("gift_text_length_max", 255); set_default_integer_option("gift_sell_period", is_test_dc ? 300 : 90 * 86400); + set_default_integer_option("affiliate_program_commission_per_mille_min", 1); + set_default_integer_option("affiliate_program_commission_per_mille_max", 900); + set_default_integer_option("bot_verification_custom_description_length_max", 70); if (options.isset("my_phone_number") || !options.isset("my_id")) { update_premium_options(); @@ -448,6 +451,7 @@ bool OptionManager::is_internal_option(Slice name) { "saved_gifs_limit_premium", "session_count", "since_last_open", + "starref_start_param_prefixes", "stickers_faved_limit_default", "stickers_faved_limit_premium", "stickers_normal_by_emoji_per_premium_num", @@ -465,6 +469,7 @@ bool OptionManager::is_internal_option(Slice name) { "story_expiring_limit_premium", "ton_proxy_address", "upload_premium_speedup_notify_period", + "video_ignore_alt_documents", "video_note_size_max", "weather_bot_username", "webfile_dc_id"}; @@ -711,7 +716,7 @@ td_api::object_ptr OptionManager::get_option_synchronously( break; case 'v': if (name == "version") { - return td_api::make_object("1.8.40"); + return td_api::make_object("1.8.42"); } break; } diff --git a/lib/tgchat/ext/td/td/telegram/OptionManager.h b/lib/tgchat/ext/td/td/telegram/OptionManager.h index 13bc7fdf..7cff9a1b 100644 --- a/lib/tgchat/ext/td/td/telegram/OptionManager.h +++ b/lib/tgchat/ext/td/td/telegram/OptionManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OrderInfo.cpp b/lib/tgchat/ext/td/td/telegram/OrderInfo.cpp index 2b2c4318..bda57232 100644 --- a/lib/tgchat/ext/td/td/telegram/OrderInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/OrderInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OrderInfo.h b/lib/tgchat/ext/td/td/telegram/OrderInfo.h index 6cb98575..862d13c0 100644 --- a/lib/tgchat/ext/td/td/telegram/OrderInfo.h +++ b/lib/tgchat/ext/td/td/telegram/OrderInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OrderInfo.hpp b/lib/tgchat/ext/td/td/telegram/OrderInfo.hpp index 57a5bac0..7d197a64 100644 --- a/lib/tgchat/ext/td/td/telegram/OrderInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/OrderInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OrderedMessage.cpp b/lib/tgchat/ext/td/td/telegram/OrderedMessage.cpp index f1681cca..b388b863 100644 --- a/lib/tgchat/ext/td/td/telegram/OrderedMessage.cpp +++ b/lib/tgchat/ext/td/td/telegram/OrderedMessage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/OrderedMessage.h b/lib/tgchat/ext/td/td/telegram/OrderedMessage.h index 556d38b8..ec93f039 100644 --- a/lib/tgchat/ext/td/td/telegram/OrderedMessage.h +++ b/lib/tgchat/ext/td/td/telegram/OrderedMessage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Outline.cpp b/lib/tgchat/ext/td/td/telegram/Outline.cpp index f2f8e65b..07be02a8 100644 --- a/lib/tgchat/ext/td/td/telegram/Outline.cpp +++ b/lib/tgchat/ext/td/td/telegram/Outline.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Outline.h b/lib/tgchat/ext/td/td/telegram/Outline.h index 45b5655c..c9dd08df 100644 --- a/lib/tgchat/ext/td/td/telegram/Outline.h +++ b/lib/tgchat/ext/td/td/telegram/Outline.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PasswordManager.cpp b/lib/tgchat/ext/td/td/telegram/PasswordManager.cpp index 5e95fb3f..fb7fb5f9 100644 --- a/lib/tgchat/ext/td/td/telegram/PasswordManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/PasswordManager.cpp @@ -1,18 +1,18 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/PasswordManager.h" -#include "td/telegram/ConfigManager.h" #include "td/telegram/DhCache.h" #include "td/telegram/DialogId.h" #include "td/telegram/Global.h" #include "td/telegram/logevent/LogEvent.h" #include "td/telegram/net/NetQueryDispatcher.h" #include "td/telegram/SuggestedAction.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/TdDb.h" #include "td/telegram/telegram_api.h" @@ -340,7 +340,7 @@ void PasswordManager::on_finish_create_temp_password(Result r } void PasswordManager::get_full_state(string password, Promise promise) { - send_closure(G()->config_manager(), &ConfigManager::hide_suggested_action, + send_closure(G()->suggested_action_manager(), &SuggestedActionManager::hide_suggested_action, SuggestedAction{SuggestedAction::Type::CheckPassword}); do_get_state(PromiseCreator::lambda([actor_id = actor_id(this), password = std::move(password), @@ -492,11 +492,11 @@ void PasswordManager::check_email_address_verification_code(string code, Promise auto verification_code = make_tl_object(std::move(code)); auto query = G()->net_query_creator().create(telegram_api::account_verifyEmail( make_tl_object(), std::move(verification_code))); - send_with_promise( - std::move(query), PromiseCreator::lambda([promise = std::move(promise)](Result r_query) mutable { - TRY_STATUS_PROMISE(promise, fetch_result(std::move(r_query))); - promise.set_value(Unit()); - })); + send_with_promise(std::move(query), + PromiseCreator::lambda([promise = std::move(promise)](Result r_query) mutable { + TRY_STATUS_PROMISE(promise, fetch_result(std::move(r_query))); + promise.set_value(Unit()); + })); } void PasswordManager::request_password_recovery(Promise promise) { diff --git a/lib/tgchat/ext/td/td/telegram/PasswordManager.h b/lib/tgchat/ext/td/td/telegram/PasswordManager.h index fc3cfb63..905f3b07 100644 --- a/lib/tgchat/ext/td/td/telegram/PasswordManager.h +++ b/lib/tgchat/ext/td/td/telegram/PasswordManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Payments.cpp b/lib/tgchat/ext/td/td/telegram/Payments.cpp index edd3a7aa..f60ceb13 100644 --- a/lib/tgchat/ext/td/td/telegram/Payments.cpp +++ b/lib/tgchat/ext/td/td/telegram/Payments.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Payments.h b/lib/tgchat/ext/td/td/telegram/Payments.h index f1b783ab..362727e4 100644 --- a/lib/tgchat/ext/td/td/telegram/Payments.h +++ b/lib/tgchat/ext/td/td/telegram/Payments.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PeerColor.cpp b/lib/tgchat/ext/td/td/telegram/PeerColor.cpp index a0843de3..6f3356ac 100644 --- a/lib/tgchat/ext/td/td/telegram/PeerColor.cpp +++ b/lib/tgchat/ext/td/td/telegram/PeerColor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PeerColor.h b/lib/tgchat/ext/td/td/telegram/PeerColor.h index 923ada10..d0f85763 100644 --- a/lib/tgchat/ext/td/td/telegram/PeerColor.h +++ b/lib/tgchat/ext/td/td/telegram/PeerColor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.cpp b/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.cpp index 1bcd0bee..cffb1c29 100644 --- a/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.h b/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.h index 4577008c..d82bb78d 100644 --- a/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.h +++ b/lib/tgchat/ext/td/td/telegram/PeopleNearbyManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.cpp b/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.cpp index 35cb7f0f..c502cd72 100644 --- a/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.cpp @@ -1,15 +1,15 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/PhoneNumberManager.h" -#include "td/telegram/ConfigManager.h" #include "td/telegram/Global.h" #include "td/telegram/misc.h" #include "td/telegram/SuggestedAction.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/Td.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UserManager.h" @@ -246,7 +246,7 @@ void PhoneNumberManager::set_phone_number(string phone_number, switch (type->get_id()) { case td_api::phoneNumberCodeTypeChange::ID: type_ = Type::ChangePhone; - send_closure(G()->config_manager(), &ConfigManager::hide_suggested_action, + send_closure(G()->suggested_action_manager(), &SuggestedActionManager::hide_suggested_action, SuggestedAction{SuggestedAction::Type::CheckPhoneNumber}); return send_new_send_code_query(send_code_helper_.send_change_phone_code(phone_number, settings), std::move(promise)); diff --git a/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.h b/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.h index 3c09f0ed..201ba0cf 100644 --- a/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.h +++ b/lib/tgchat/ext/td/td/telegram/PhoneNumberManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Photo.cpp b/lib/tgchat/ext/td/td/telegram/Photo.cpp index f19f21ea..52131ecf 100644 --- a/lib/tgchat/ext/td/td/telegram/Photo.cpp +++ b/lib/tgchat/ext/td/td/telegram/Photo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Photo.h b/lib/tgchat/ext/td/td/telegram/Photo.h index 99c9762a..5ac5c7ca 100644 --- a/lib/tgchat/ext/td/td/telegram/Photo.h +++ b/lib/tgchat/ext/td/td/telegram/Photo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Photo.hpp b/lib/tgchat/ext/td/td/telegram/Photo.hpp index 65c2f1db..8d8722fa 100644 --- a/lib/tgchat/ext/td/td/telegram/Photo.hpp +++ b/lib/tgchat/ext/td/td/telegram/Photo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoFormat.h b/lib/tgchat/ext/td/td/telegram/PhotoFormat.h index 0fdf76fc..4f3c54e6 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoFormat.h +++ b/lib/tgchat/ext/td/td/telegram/PhotoFormat.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSize.cpp b/lib/tgchat/ext/td/td/telegram/PhotoSize.cpp index 5e44b250..89b885a8 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSize.cpp +++ b/lib/tgchat/ext/td/td/telegram/PhotoSize.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSize.h b/lib/tgchat/ext/td/td/telegram/PhotoSize.h index f9d4a60b..016ce87e 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSize.h +++ b/lib/tgchat/ext/td/td/telegram/PhotoSize.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSize.hpp b/lib/tgchat/ext/td/td/telegram/PhotoSize.hpp index 74a14367..d059ff3b 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSize.hpp +++ b/lib/tgchat/ext/td/td/telegram/PhotoSize.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.cpp b/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.cpp index 999f9533..ce0b84fc 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.cpp +++ b/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.h b/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.h index 8fa47986..1e04996f 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.h +++ b/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.hpp b/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.hpp index f230e9d8..1fb6a180 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.hpp +++ b/lib/tgchat/ext/td/td/telegram/PhotoSizeSource.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSizeType.h b/lib/tgchat/ext/td/td/telegram/PhotoSizeType.h index cc51d505..2399ad48 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSizeType.h +++ b/lib/tgchat/ext/td/td/telegram/PhotoSizeType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PhotoSizeType.hpp b/lib/tgchat/ext/td/td/telegram/PhotoSizeType.hpp index 7cbc596e..1dca736c 100644 --- a/lib/tgchat/ext/td/td/telegram/PhotoSizeType.hpp +++ b/lib/tgchat/ext/td/td/telegram/PhotoSizeType.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PollId.h b/lib/tgchat/ext/td/td/telegram/PollId.h index 762571c5..ca08351d 100644 --- a/lib/tgchat/ext/td/td/telegram/PollId.h +++ b/lib/tgchat/ext/td/td/telegram/PollId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PollId.hpp b/lib/tgchat/ext/td/td/telegram/PollId.hpp index 77f99595..32b8028a 100644 --- a/lib/tgchat/ext/td/td/telegram/PollId.hpp +++ b/lib/tgchat/ext/td/td/telegram/PollId.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PollManager.cpp b/lib/tgchat/ext/td/td/telegram/PollManager.cpp index b04597f0..c2888c93 100644 --- a/lib/tgchat/ext/td/td/telegram/PollManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/PollManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PollManager.h b/lib/tgchat/ext/td/td/telegram/PollManager.h index e7a7659b..cf0cb328 100644 --- a/lib/tgchat/ext/td/td/telegram/PollManager.h +++ b/lib/tgchat/ext/td/td/telegram/PollManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PollManager.hpp b/lib/tgchat/ext/td/td/telegram/PollManager.hpp index 681a6a1d..0f306d47 100644 --- a/lib/tgchat/ext/td/td/telegram/PollManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/PollManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Premium.cpp b/lib/tgchat/ext/td/td/telegram/Premium.cpp index dfde913f..66abfe91 100644 --- a/lib/tgchat/ext/td/td/telegram/Premium.cpp +++ b/lib/tgchat/ext/td/td/telegram/Premium.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -336,8 +336,8 @@ class GetPremiumPromoQuery final : public Td::ResultHandler { continue; } - auto parsed_document = td_->documents_manager_->on_get_document(move_tl_object_as(video), - DialogId(), nullptr, Document::Type::Animation); + auto parsed_document = td_->documents_manager_->on_get_document( + move_tl_object_as(video), DialogId(), false, nullptr, Document::Type::Animation); if (parsed_document.type != Document::Type::Animation) { LOG(ERROR) << "Receive " << parsed_document.type << " for " << promo->video_sections_[i]; diff --git a/lib/tgchat/ext/td/td/telegram/Premium.h b/lib/tgchat/ext/td/td/telegram/Premium.h index d8b5f1e3..31b9b484 100644 --- a/lib/tgchat/ext/td/td/telegram/Premium.h +++ b/lib/tgchat/ext/td/td/telegram/Premium.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.cpp b/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.cpp index 0d7a948b..1390ad76 100644 --- a/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.cpp +++ b/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.h b/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.h index 7720682a..be9d532f 100644 --- a/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.h +++ b/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.hpp b/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.hpp index a95dace1..298c0d9a 100644 --- a/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.hpp +++ b/lib/tgchat/ext/td/td/telegram/PremiumGiftOption.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PrivacyManager.cpp b/lib/tgchat/ext/td/td/telegram/PrivacyManager.cpp index dee91e6e..2fe7649b 100644 --- a/lib/tgchat/ext/td/td/telegram/PrivacyManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/PrivacyManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PrivacyManager.h b/lib/tgchat/ext/td/td/telegram/PrivacyManager.h index fd8e0d37..a37fb4f5 100644 --- a/lib/tgchat/ext/td/td/telegram/PrivacyManager.h +++ b/lib/tgchat/ext/td/td/telegram/PrivacyManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PromoDataManager.cpp b/lib/tgchat/ext/td/td/telegram/PromoDataManager.cpp index 7f22497e..bb5a3fab 100644 --- a/lib/tgchat/ext/td/td/telegram/PromoDataManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/PromoDataManager.cpp @@ -1,17 +1,21 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include "td/telegram/PromoDataManager.h" +#include "td/telegram/AccessRights.h" #include "td/telegram/AuthManager.h" +#include "td/telegram/ChatManager.h" +#include "td/telegram/DialogManager.h" #include "td/telegram/DialogSource.h" #include "td/telegram/Global.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/Td.h" #include "td/telegram/telegram_api.h" +#include "td/telegram/UserManager.h" #include "td/utils/buffer.h" #include "td/utils/logging.h" @@ -47,6 +51,35 @@ class GetPromoDataQuery final : public Td::ResultHandler { } }; +class HidePromoDataQuery final : public Td::ResultHandler { + DialogId dialog_id_; + + public: + void send(DialogId dialog_id) { + dialog_id_ = dialog_id; + auto input_peer = td_->dialog_manager_->get_input_peer(dialog_id, AccessRights::Read); + if (input_peer == nullptr) { + return; + } + send_query(G()->net_query_creator().create(telegram_api::help_hidePromoData(std::move(input_peer)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + // we are not interested in the result + } + + void on_error(Status status) final { + if (!td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "HidePromoDataQuery")) { + LOG(ERROR) << "Receive error for sponsored chat hiding: " << status; + } + } +}; + PromoDataManager::PromoDataManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { } @@ -121,18 +154,19 @@ void PromoDataManager::on_get_promo_data(Result(promo_data_ptr); expires_at = promo->expires_; - td_->messages_manager_->remove_sponsored_dialog(); + remove_sponsored_dialog(); break; } case telegram_api::help_promoData::ID: { auto promo = telegram_api::move_object_as(promo_data_ptr); + td_->user_manager_->on_get_users(std::move(promo->users_), "on_get_promo_data"); + td_->chat_manager_->on_get_chats(std::move(promo->chats_), "on_get_promo_data"); expires_at = promo->expires_; bool is_proxy = promo->proxy_; - td_->messages_manager_->on_get_sponsored_dialog( - std::move(promo->peer_), + td_->messages_manager_->set_sponsored_dialog( + DialogId(promo->peer_), is_proxy ? DialogSource::mtproto_proxy() - : DialogSource::public_service_announcement(promo->psa_type_, promo->psa_message_), - std::move(promo->users_), std::move(promo->chats_)); + : DialogSource::public_service_announcement(promo->psa_type_, promo->psa_message_)); break; } default: @@ -145,4 +179,14 @@ void PromoDataManager::on_get_promo_data(Resultunix_time()); } +void PromoDataManager::remove_sponsored_dialog() { + td_->messages_manager_->set_sponsored_dialog(DialogId(), DialogSource()); +} + +void PromoDataManager::hide_promo_data(DialogId dialog_id) { + remove_sponsored_dialog(); + + td_->create_handler()->send(dialog_id); +} + } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/PromoDataManager.h b/lib/tgchat/ext/td/td/telegram/PromoDataManager.h index e749477d..06a44bcb 100644 --- a/lib/tgchat/ext/td/td/telegram/PromoDataManager.h +++ b/lib/tgchat/ext/td/td/telegram/PromoDataManager.h @@ -1,11 +1,12 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once +#include "td/telegram/DialogId.h" #include "td/telegram/telegram_api.h" #include "td/actor/actor.h" @@ -25,6 +26,10 @@ class PromoDataManager final : public Actor { void reload_promo_data(); + void remove_sponsored_dialog(); + + void hide_promo_data(DialogId dialog_id); + private: void tear_down() final; diff --git a/lib/tgchat/ext/td/td/telegram/PtsManager.h b/lib/tgchat/ext/td/td/telegram/PtsManager.h index 6f33cc40..7562ced2 100644 --- a/lib/tgchat/ext/td/td/telegram/PtsManager.h +++ b/lib/tgchat/ext/td/td/telegram/PtsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/PublicDialogType.h b/lib/tgchat/ext/td/td/telegram/PublicDialogType.h index a6bbd884..9355eaa2 100644 --- a/lib/tgchat/ext/td/td/telegram/PublicDialogType.h +++ b/lib/tgchat/ext/td/td/telegram/PublicDialogType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QueryCombiner.cpp b/lib/tgchat/ext/td/td/telegram/QueryCombiner.cpp index 433c8235..b00050b6 100644 --- a/lib/tgchat/ext/td/td/telegram/QueryCombiner.cpp +++ b/lib/tgchat/ext/td/td/telegram/QueryCombiner.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QueryCombiner.h b/lib/tgchat/ext/td/td/telegram/QueryCombiner.h index f5401639..fb6d5a8c 100644 --- a/lib/tgchat/ext/td/td/telegram/QueryCombiner.h +++ b/lib/tgchat/ext/td/td/telegram/QueryCombiner.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QueryMerger.cpp b/lib/tgchat/ext/td/td/telegram/QueryMerger.cpp index c1d3dd56..6372d940 100644 --- a/lib/tgchat/ext/td/td/telegram/QueryMerger.cpp +++ b/lib/tgchat/ext/td/td/telegram/QueryMerger.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QueryMerger.h b/lib/tgchat/ext/td/td/telegram/QueryMerger.h index 49dde4c0..58ed60ba 100644 --- a/lib/tgchat/ext/td/td/telegram/QueryMerger.h +++ b/lib/tgchat/ext/td/td/telegram/QueryMerger.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QuickReplyManager.cpp b/lib/tgchat/ext/td/td/telegram/QuickReplyManager.cpp index bfa2d380..2bf4c67a 100644 --- a/lib/tgchat/ext/td/td/telegram/QuickReplyManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/QuickReplyManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -2211,7 +2211,7 @@ void QuickReplyManager::do_send_message(const QuickReplyMessage *m, vector auto thumbnail_file_id = get_message_content_thumbnail_file_id(content, td_); if (thumbnail_file_id.is_valid()) { FileView file_view = td_->file_manager_->get_file_view(file_id); - if (get_main_file_type(file_view.get_type()) != FileType::Photo) { + if (get_file_type_class(file_view.get_type()) != FileTypeClass::Photo) { thumbnail_file_upload_id = FileUploadId{thumbnail_file_id, FileManager::get_internal_upload_id()}; } } diff --git a/lib/tgchat/ext/td/td/telegram/QuickReplyManager.h b/lib/tgchat/ext/td/td/telegram/QuickReplyManager.h index 5dd2a56b..26bfc83b 100644 --- a/lib/tgchat/ext/td/td/telegram/QuickReplyManager.h +++ b/lib/tgchat/ext/td/td/telegram/QuickReplyManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QuickReplyMessageFullId.h b/lib/tgchat/ext/td/td/telegram/QuickReplyMessageFullId.h index 4a847110..74a210c4 100644 --- a/lib/tgchat/ext/td/td/telegram/QuickReplyMessageFullId.h +++ b/lib/tgchat/ext/td/td/telegram/QuickReplyMessageFullId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/QuickReplyShortcutId.h b/lib/tgchat/ext/td/td/telegram/QuickReplyShortcutId.h index b213ccd3..901dfc71 100644 --- a/lib/tgchat/ext/td/td/telegram/QuickReplyShortcutId.h +++ b/lib/tgchat/ext/td/td/telegram/QuickReplyShortcutId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionListType.cpp b/lib/tgchat/ext/td/td/telegram/ReactionListType.cpp index e3afbdee..b26a9c77 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionListType.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionListType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionListType.h b/lib/tgchat/ext/td/td/telegram/ReactionListType.h index 0d1c8ee7..7cc94402 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionListType.h +++ b/lib/tgchat/ext/td/td/telegram/ReactionListType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionManager.cpp b/lib/tgchat/ext/td/td/telegram/ReactionManager.cpp index 98255171..6bde56b1 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1008,7 +1008,7 @@ void ReactionManager::load_all_saved_reaction_tags_from_database() { all_tags_ = {}; } } - reget_saved_messages_tags(SavedMessagesTopicId(), Auto()); + reload_saved_messages_tags(SavedMessagesTopicId(), Auto()); } void ReactionManager::load_saved_reaction_tags_from_database(SavedMessagesTopicId saved_messages_topic_id, @@ -1028,7 +1028,7 @@ void ReactionManager::load_saved_reaction_tags_from_database(SavedMessagesTopicI } send_update_saved_messages_tags(saved_messages_topic_id, tags, true); - reget_saved_messages_tags(saved_messages_topic_id, Auto()); + reload_saved_messages_tags(saved_messages_topic_id, Auto()); } ReactionManager::SavedReactionTags *ReactionManager::get_saved_reaction_tags( @@ -1054,11 +1054,11 @@ void ReactionManager::get_saved_messages_tags(SavedMessagesTopicId saved_message if (tags->is_inited_) { return promise.set_value(tags->get_saved_messages_tags_object()); } - reget_saved_messages_tags(saved_messages_topic_id, std::move(promise)); + reload_saved_messages_tags(saved_messages_topic_id, std::move(promise)); } -void ReactionManager::reget_saved_messages_tags(SavedMessagesTopicId saved_messages_topic_id, - Promise> &&promise) { +void ReactionManager::reload_saved_messages_tags(SavedMessagesTopicId saved_messages_topic_id, + Promise> &&promise) { auto &promises = saved_messages_topic_id == SavedMessagesTopicId() ? pending_get_all_saved_reaction_tags_queries_ : pending_get_topic_saved_reaction_tags_queries_[saved_messages_topic_id]; @@ -1163,7 +1163,7 @@ void ReactionManager::send_update_saved_messages_tags(SavedMessagesTopicId saved } void ReactionManager::on_update_saved_reaction_tags(Promise &&promise) { - reget_saved_messages_tags( + reload_saved_messages_tags( SavedMessagesTopicId(), PromiseCreator::lambda( [promise = std::move(promise)](Result> result) mutable { @@ -1181,8 +1181,8 @@ void ReactionManager::update_saved_messages_tags(SavedMessagesTopicId saved_mess if (all_tags->update_saved_messages_tags(old_tags, new_tags)) { send_update_saved_messages_tags(SavedMessagesTopicId(), all_tags); } - if (saved_messages_topic_id != SavedMessagesTopicId()) { - auto tags = get_saved_reaction_tags(saved_messages_topic_id); + if (saved_messages_topic_id != SavedMessagesTopicId() && saved_messages_topic_id.get_input_peer(td_) != nullptr) { + auto *tags = get_saved_reaction_tags(saved_messages_topic_id); if (tags->update_saved_messages_tags(old_tags, new_tags)) { send_update_saved_messages_tags(saved_messages_topic_id, tags); } diff --git a/lib/tgchat/ext/td/td/telegram/ReactionManager.h b/lib/tgchat/ext/td/td/telegram/ReactionManager.h index b18b4289..d7d29809 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionManager.h +++ b/lib/tgchat/ext/td/td/telegram/ReactionManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -270,8 +270,8 @@ class ReactionManager final : public Actor { SavedReactionTags *get_saved_reaction_tags(SavedMessagesTopicId saved_messages_topic_id); - void reget_saved_messages_tags(SavedMessagesTopicId saved_messages_topic_id, - Promise> &&promise); + void reload_saved_messages_tags(SavedMessagesTopicId saved_messages_topic_id, + Promise> &&promise); void on_get_saved_messages_tags(SavedMessagesTopicId saved_messages_topic_id, Result> &&r_tags); diff --git a/lib/tgchat/ext/td/td/telegram/ReactionManager.hpp b/lib/tgchat/ext/td/td/telegram/ReactionManager.hpp index dc5af622..595c9d73 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.cpp b/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.cpp index ef34e1b6..681aad22 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.h b/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.h index 6200e973..b5bf58a2 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.h +++ b/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.hpp b/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.hpp index 90c09d8e..6f1e495c 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.hpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionNotificationSettings.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.cpp b/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.cpp index 18bc2f00..af615bc2 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.h b/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.h index 67e8de65..195c6f73 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.h +++ b/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.hpp b/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.hpp index 2c1673d2..78af83ff 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.hpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionNotificationsFrom.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionType.cpp b/lib/tgchat/ext/td/td/telegram/ReactionType.cpp index 8f418560..3cde1004 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionType.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionType.h b/lib/tgchat/ext/td/td/telegram/ReactionType.h index cfa49eb5..69225e49 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionType.h +++ b/lib/tgchat/ext/td/td/telegram/ReactionType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionType.hpp b/lib/tgchat/ext/td/td/telegram/ReactionType.hpp index b2fa18ac..2b91fe09 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionType.hpp +++ b/lib/tgchat/ext/td/td/telegram/ReactionType.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReactionUnavailabilityReason.h b/lib/tgchat/ext/td/td/telegram/ReactionUnavailabilityReason.h index 35d7758c..ddb26c0f 100644 --- a/lib/tgchat/ext/td/td/telegram/ReactionUnavailabilityReason.h +++ b/lib/tgchat/ext/td/td/telegram/ReactionUnavailabilityReason.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RecentDialogList.cpp b/lib/tgchat/ext/td/td/telegram/RecentDialogList.cpp index b3361457..f496a557 100644 --- a/lib/tgchat/ext/td/td/telegram/RecentDialogList.cpp +++ b/lib/tgchat/ext/td/td/telegram/RecentDialogList.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RecentDialogList.h b/lib/tgchat/ext/td/td/telegram/RecentDialogList.h index 67c15b2c..62a6877d 100644 --- a/lib/tgchat/ext/td/td/telegram/RecentDialogList.h +++ b/lib/tgchat/ext/td/td/telegram/RecentDialogList.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.cpp b/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.cpp new file mode 100644 index 00000000..1dfb9228 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.cpp @@ -0,0 +1,45 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/ReferralProgramInfo.h" + +#include "td/telegram/telegram_api.h" + +namespace td { + +ReferralProgramInfo::ReferralProgramInfo(telegram_api::object_ptr &&program) { + if (program != nullptr) { + parameters_ = ReferralProgramParameters(program->commission_permille_, program->duration_months_); + end_date_ = program->end_date_; + daily_star_amount_ = StarAmount(std::move(program->daily_revenue_per_user_), true); + } +} + +td_api::object_ptr ReferralProgramInfo::get_affiliate_program_info_object() const { + if (!is_valid()) { + return nullptr; + } + return td_api::make_object(parameters_.get_affiliate_program_parameters_object(), + end_date_, daily_star_amount_.get_star_amount_object()); +} + +bool operator==(const ReferralProgramInfo &lhs, const ReferralProgramInfo &rhs) { + return lhs.parameters_ == rhs.parameters_ && lhs.end_date_ == rhs.end_date_ && + lhs.daily_star_amount_ == rhs.daily_star_amount_; +} + +StringBuilder &operator<<(StringBuilder &string_builder, const ReferralProgramInfo &info) { + string_builder << '[' << info.parameters_; + if (info.end_date_) { + string_builder << " ending at " << info.end_date_; + } + if (info.daily_star_amount_ != StarAmount()) { + string_builder << " with profit of " << info.daily_star_amount_; + } + return string_builder << ']'; +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.h b/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.h new file mode 100644 index 00000000..2f1b449d --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.h @@ -0,0 +1,58 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/ReferralProgramParameters.h" +#include "td/telegram/StarAmount.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class ReferralProgramInfo { + ReferralProgramParameters parameters_; + int32 end_date_ = 0; + StarAmount daily_star_amount_; + + friend bool operator==(const ReferralProgramInfo &lhs, const ReferralProgramInfo &rhs); + + friend StringBuilder &operator<<(StringBuilder &string_builder, const ReferralProgramInfo &info); + + public: + ReferralProgramInfo() = default; + + explicit ReferralProgramInfo(telegram_api::object_ptr &&program); + + bool is_valid() const { + return parameters_.is_valid() && end_date_ >= 0; + } + + bool is_active() const { + return end_date_ == 0; + } + + td_api::object_ptr get_affiliate_program_info_object() const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); +}; + +bool operator==(const ReferralProgramInfo &lhs, const ReferralProgramInfo &rhs); + +inline bool operator!=(const ReferralProgramInfo &lhs, const ReferralProgramInfo &rhs) { + return !(lhs == rhs); +} + +StringBuilder &operator<<(StringBuilder &string_builder, const ReferralProgramInfo &info); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.hpp b/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.hpp new file mode 100644 index 00000000..7b1fee71 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramInfo.hpp @@ -0,0 +1,56 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/ReferralProgramInfo.h" + +#include "td/telegram/ReferralProgramParameters.hpp" +#include "td/telegram/StarAmount.hpp" + +#include "td/utils/common.h" +#include "td/utils/tl_helpers.h" + +namespace td { + +template +void ReferralProgramInfo::store(StorerT &storer) const { + bool has_end_date = end_date_ != 0; + bool has_daily_star_amount = daily_star_amount_ != StarAmount(); + BEGIN_STORE_FLAGS(); + STORE_FLAG(has_end_date); + STORE_FLAG(has_daily_star_amount); + END_STORE_FLAGS(); + td::store(parameters_, storer); + if (has_end_date) { + td::store(end_date_, storer); + } + if (has_daily_star_amount) { + td::store(daily_star_amount_, storer); + } +} + +template +void ReferralProgramInfo::parse(ParserT &parser) { + bool has_end_date; + bool has_daily_star_amount; + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(has_end_date); + PARSE_FLAG(has_daily_star_amount); + END_PARSE_FLAGS(); + td::parse(parameters_, parser); + if (has_end_date) { + td::parse(end_date_, parser); + } + if (has_daily_star_amount) { + td::parse(daily_star_amount_, parser); + } + if (!is_valid()) { + parser.set_error("Invalid referral program info stored in the database"); + } +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramManager.cpp b/lib/tgchat/ext/td/td/telegram/ReferralProgramManager.cpp new file mode 100644 index 00000000..f5e13be8 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramManager.cpp @@ -0,0 +1,497 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/ReferralProgramManager.h" + +#include "td/telegram/AffiliateType.h" +#include "td/telegram/ChatManager.h" +#include "td/telegram/DialogManager.h" +#include "td/telegram/Global.h" +#include "td/telegram/MessagesManager.h" +#include "td/telegram/ReferralProgramInfo.h" +#include "td/telegram/StarManager.h" +#include "td/telegram/Td.h" +#include "td/telegram/UserManager.h" + +#include "td/utils/buffer.h" +#include "td/utils/logging.h" +#include "td/utils/misc.h" +#include "td/utils/SliceBuilder.h" +#include "td/utils/Status.h" + +namespace td { + +class UpdateStarRefProgramQuery final : public Td::ResultHandler { + Promise promise_; + UserId user_id_; + + public: + explicit UpdateStarRefProgramQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(UserId user_id, telegram_api::object_ptr &&input_user, + const ReferralProgramParameters ¶meters) { + user_id_ = user_id; + int32 flags = 0; + if (parameters.get_month_count() != 0) { + flags |= telegram_api::bots_updateStarRefProgram::DURATION_MONTHS_MASK; + } + send_query(G()->net_query_creator().create(telegram_api::bots_updateStarRefProgram( + flags, std::move(input_user), parameters.get_commission(), parameters.get_month_count()))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for UpdateStarRefProgramQuery: " << to_string(ptr); + td_->user_manager_->on_update_user_referral_program_info(user_id_, ReferralProgramInfo(std::move(ptr))); + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +class ResolveReferralProgramQuery final : public Td::ResultHandler { + Promise> promise_; + + public: + explicit ResolveReferralProgramQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(const string &username, const string &referrer) { + int32 flags = telegram_api::contacts_resolveUsername::REFERER_MASK; + send_query(G()->net_query_creator().create(telegram_api::contacts_resolveUsername(flags, username, referrer))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for ResolveReferralProgramQuery: " << to_string(ptr); + td_->user_manager_->on_get_users(std::move(ptr->users_), "ResolveReferralProgramQuery"); + td_->chat_manager_->on_get_chats(std::move(ptr->chats_), "ResolveReferralProgramQuery"); + + DialogId dialog_id(ptr->peer_); + if (dialog_id.get_type() != DialogType::User || !td_->user_manager_->have_user(dialog_id.get_user_id())) { + return on_error(Status::Error(400, "Chat not found")); + } + + td_->dialog_manager_->force_create_dialog(dialog_id, "ResolveReferralProgramQuery"); + promise_.set_value(td_->messages_manager_->get_chat_object(dialog_id, "ResolveReferralProgramQuery")); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +class ReferralProgramManager::GetSuggestedStarRefBotsQuery final : public Td::ResultHandler { + Promise> promise_; + AffiliateType affiliate_type_; + + public: + explicit GetSuggestedStarRefBotsQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(AffiliateType affiliate_type, ReferralProgramSortOrder sort_order, const string &offset, int32 limit) { + affiliate_type_ = affiliate_type; + auto input_peer = affiliate_type.get_input_peer(td_); + CHECK(input_peer != nullptr); + int32 flags = 0; + switch (sort_order) { + case ReferralProgramSortOrder::Profitability: + break; + case ReferralProgramSortOrder::Date: + flags |= telegram_api::payments_getSuggestedStarRefBots::ORDER_BY_DATE_MASK; + break; + case ReferralProgramSortOrder::Revenue: + flags |= telegram_api::payments_getSuggestedStarRefBots::ORDER_BY_REVENUE_MASK; + break; + default: + UNREACHABLE(); + } + send_query(G()->net_query_creator().create(telegram_api::payments_getSuggestedStarRefBots( + flags, false /*ignored*/, false /*ignored*/, std::move(input_peer), offset, limit))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for GetSuggestedStarRefBotsQuery: " << to_string(ptr); + + td_->user_manager_->on_get_users(std::move(ptr->users_), "GetSuggestedStarRefBotsQuery"); + + vector> programs; + for (auto &ref : ptr->suggested_bots_) { + SuggestedBotStarRef star_ref(std::move(ref)); + if (!star_ref.is_valid()) { + LOG(ERROR) << "Receive invalid affiliate program for " << affiliate_type_; + continue; + } + if (!star_ref.is_active()) { + LOG(INFO) << "Receive canceled affiliate program for " << affiliate_type_; + continue; + } + programs.push_back(star_ref.get_found_affiliate_program_object(td_)); + } + + auto total_count = ptr->count_; + if (total_count < static_cast(programs.size())) { + LOG(ERROR) << "Receive total count = " << total_count << ", but " << programs.size() << " affiliate programs"; + total_count = static_cast(programs.size()); + } + promise_.set_value( + td_api::make_object(total_count, std::move(programs), ptr->next_offset_)); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(affiliate_type_.get_dialog_id(), status, "GetSuggestedStarRefBotsQuery"); + promise_.set_error(std::move(status)); + } +}; + +class ReferralProgramManager::ConnectStarRefBotQuery final : public Td::ResultHandler { + Promise> promise_; + AffiliateType affiliate_type_; + + public: + explicit ConnectStarRefBotQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(AffiliateType affiliate_type, telegram_api::object_ptr &&input_user) { + affiliate_type_ = affiliate_type; + auto input_peer = affiliate_type.get_input_peer(td_); + CHECK(input_peer != nullptr); + send_query(G()->net_query_creator().create( + telegram_api::payments_connectStarRefBot(std::move(input_peer), std::move(input_user)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for ConnectStarRefBotQuery: " << to_string(ptr); + if (ptr->connected_bots_.size() != 1u) { + return on_error(Status::Error(500, "Receive invalid response")); + } + + td_->user_manager_->on_get_users(std::move(ptr->users_), "ConnectStarRefBotQuery"); + + ConnectedBotStarRef ref(std::move(ptr->connected_bots_[0])); + if (!ref.is_valid()) { + LOG(ERROR) << "Receive invalid connected affiliate program for " << affiliate_type_; + return on_error(Status::Error(500, "Receive invalid response")); + } + promise_.set_value(ref.get_connected_affiliate_program_object(td_)); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(affiliate_type_.get_dialog_id(), status, "ConnectStarRefBotQuery"); + promise_.set_error(std::move(status)); + } +}; + +class ReferralProgramManager::EditConnectedStarRefBotQuery final : public Td::ResultHandler { + Promise> promise_; + AffiliateType affiliate_type_; + + public: + explicit EditConnectedStarRefBotQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(AffiliateType affiliate_type, const string &url) { + affiliate_type_ = affiliate_type; + int32 flags = telegram_api::payments_editConnectedStarRefBot::REVOKED_MASK; + auto input_peer = affiliate_type.get_input_peer(td_); + CHECK(input_peer != nullptr); + send_query(G()->net_query_creator().create( + telegram_api::payments_editConnectedStarRefBot(flags, false /*ignored*/, std::move(input_peer), url))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for EditConnectedStarRefBotQuery: " << to_string(ptr); + if (ptr->connected_bots_.size() != 1u) { + return on_error(Status::Error(500, "Receive invalid response")); + } + + td_->user_manager_->on_get_users(std::move(ptr->users_), "EditConnectedStarRefBotQuery"); + + ConnectedBotStarRef ref(std::move(ptr->connected_bots_[0])); + if (!ref.is_valid()) { + LOG(ERROR) << "Receive invalid connected affiliate program for " << affiliate_type_; + return on_error(Status::Error(500, "Receive invalid response")); + } + promise_.set_value(ref.get_connected_affiliate_program_object(td_)); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(affiliate_type_.get_dialog_id(), status, "EditConnectedStarRefBotQuery"); + promise_.set_error(std::move(status)); + } +}; + +class ReferralProgramManager::GetConnectedStarRefBotQuery final : public Td::ResultHandler { + Promise> promise_; + AffiliateType affiliate_type_; + + public: + explicit GetConnectedStarRefBotQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(AffiliateType affiliate_type, telegram_api::object_ptr &&input_user) { + affiliate_type_ = affiliate_type; + auto input_peer = affiliate_type.get_input_peer(td_); + CHECK(input_peer != nullptr); + send_query(G()->net_query_creator().create( + telegram_api::payments_getConnectedStarRefBot(std::move(input_peer), std::move(input_user)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for GetConnectedStarRefBotQuery: " << to_string(ptr); + if (ptr->connected_bots_.size() != 1u) { + if (ptr->connected_bots_.empty()) { + return promise_.set_value(nullptr); + } + return on_error(Status::Error(500, "Receive invalid response")); + } + + td_->user_manager_->on_get_users(std::move(ptr->users_), "GetConnectedStarRefBotQuery"); + + ConnectedBotStarRef ref(std::move(ptr->connected_bots_[0])); + if (!ref.is_valid()) { + LOG(ERROR) << "Receive invalid connected affiliate program for " << affiliate_type_; + return on_error(Status::Error(500, "Receive invalid response")); + } + promise_.set_value(ref.get_connected_affiliate_program_object(td_)); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(affiliate_type_.get_dialog_id(), status, "GetConnectedStarRefBotQuery"); + promise_.set_error(std::move(status)); + } +}; + +class ReferralProgramManager::GetConnectedStarRefBotsQuery final : public Td::ResultHandler { + Promise> promise_; + AffiliateType affiliate_type_; + + public: + explicit GetConnectedStarRefBotsQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(AffiliateType affiliate_type, const string &offset, int32 limit) { + affiliate_type_ = affiliate_type; + int32 date = 0; + string link; + int32 flags = 0; + if (!offset.empty()) { + auto split_offset = split(offset); + date = to_integer(split_offset.first); + link = std::move(split_offset.second); + flags |= telegram_api::payments_getConnectedStarRefBots::OFFSET_DATE_MASK; + } + auto input_peer = affiliate_type.get_input_peer(td_); + CHECK(input_peer != nullptr); + + send_query(G()->net_query_creator().create( + telegram_api::payments_getConnectedStarRefBots(flags, std::move(input_peer), date, link, limit))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(DEBUG) << "Receive result for GetConnectedStarRefBotsQuery: " << to_string(ptr); + + td_->user_manager_->on_get_users(std::move(ptr->users_), "GetConnectedStarRefBotsQuery"); + + vector> programs; + string next_offset; + for (auto &ref : ptr->connected_bots_) { + next_offset = PSTRING() << ref->date_ << ' ' << ref->url_; + ConnectedBotStarRef star_ref(std::move(ref)); + if (!star_ref.is_valid()) { + LOG(ERROR) << "Receive invalid connected affiliate program for " << affiliate_type_; + continue; + } + programs.push_back(star_ref.get_connected_affiliate_program_object(td_)); + } + + auto total_count = ptr->count_; + if (total_count < static_cast(programs.size())) { + LOG(ERROR) << "Receive total count = " << total_count << ", but " << programs.size() << " affiliate programs"; + total_count = static_cast(programs.size()); + } + promise_.set_value( + td_api::make_object(total_count, std::move(programs), next_offset)); + } + + void on_error(Status status) final { + td_->dialog_manager_->on_get_dialog_error(affiliate_type_.get_dialog_id(), status, "GetConnectedStarRefBotsQuery"); + promise_.set_error(std::move(status)); + } +}; + +ReferralProgramManager::SuggestedBotStarRef::SuggestedBotStarRef( + telegram_api::object_ptr &&ref) + : user_id_(ref->bot_id_), info_(std::move(ref)) { +} + +td_api::object_ptr +ReferralProgramManager::SuggestedBotStarRef::get_found_affiliate_program_object(Td *td) const { + CHECK(is_valid()); + return td_api::make_object( + td->user_manager_->get_user_id_object(user_id_, "foundAffiliateProgram"), + info_.get_affiliate_program_info_object()); +} + +ReferralProgramManager::ConnectedBotStarRef::ConnectedBotStarRef( + telegram_api::object_ptr &&ref) + : url_(std::move(ref->url_)) + , date_(ref->date_) + , user_id_(ref->bot_id_) + , parameters_(ref->commission_permille_, ref->duration_months_) + , participant_count_(ref->participants_) + , revenue_star_count_(StarManager::get_star_count(ref->revenue_)) + , is_revoked_(ref->revoked_) { +} + +td_api::object_ptr +ReferralProgramManager::ConnectedBotStarRef::get_connected_affiliate_program_object(Td *td) const { + CHECK(is_valid()); + return td_api::make_object( + url_, td->user_manager_->get_user_id_object(user_id_, "connectedAffiliateProgram"), + parameters_.get_affiliate_program_parameters_object(), date_, is_revoked_, participant_count_, + revenue_star_count_); +} + +ReferralProgramManager::ReferralProgramManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { +} + +void ReferralProgramManager::tear_down() { + parent_.reset(); +} + +void ReferralProgramManager::set_dialog_referral_program(DialogId dialog_id, ReferralProgramParameters parameters, + Promise &&promise) { + if (!parameters.is_valid() && parameters != ReferralProgramParameters()) { + return promise.set_error(Status::Error(400, "Invalid affiliate parameters specified")); + } + switch (dialog_id.get_type()) { + case DialogType::User: { + TRY_RESULT_PROMISE(promise, bot_data, td_->user_manager_->get_bot_data(dialog_id.get_user_id())); + if (bot_data.can_be_edited) { + break; + } + return promise.set_error(Status::Error(400, "The bot isn't owned")); + } + case DialogType::Chat: + case DialogType::Channel: + case DialogType::SecretChat: + case DialogType::None: + return promise.set_error(Status::Error(400, "The chat can't have affiliate program")); + default: + UNREACHABLE(); + } + auto bot_user_id = dialog_id.get_user_id(); + TRY_RESULT_PROMISE(promise, input_user, td_->user_manager_->get_input_user(bot_user_id)); + + td_->create_handler(std::move(promise)) + ->send(bot_user_id, std::move(input_user), parameters); +} + +void ReferralProgramManager::search_dialog_referral_program(const string &username, const string &referral, + Promise> &&promise) { + td_->create_handler(std::move(promise))->send(username, referral); +} + +void ReferralProgramManager::search_referral_programs( + const td_api::object_ptr &affiliate, ReferralProgramSortOrder sort_order, + const string &offset, int32 limit, Promise> &&promise) { + TRY_RESULT_PROMISE(promise, affiliate_type, AffiliateType::get_affiliate_type(td_, affiliate)); + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Limit must be positive")); + } + + td_->create_handler(std::move(promise)) + ->send(affiliate_type, sort_order, offset, limit); +} + +void ReferralProgramManager::connect_referral_program( + const td_api::object_ptr &affiliate, UserId bot_user_id, + Promise> &&promise) { + TRY_RESULT_PROMISE(promise, affiliate_type, AffiliateType::get_affiliate_type(td_, affiliate)); + TRY_RESULT_PROMISE(promise, input_user, td_->user_manager_->get_input_user(bot_user_id)); + + td_->create_handler(std::move(promise))->send(affiliate_type, std::move(input_user)); +} + +void ReferralProgramManager::revoke_referral_program( + const td_api::object_ptr &affiliate, const string &url, + Promise> &&promise) { + TRY_RESULT_PROMISE(promise, affiliate_type, AffiliateType::get_affiliate_type(td_, affiliate)); + + td_->create_handler(std::move(promise))->send(affiliate_type, url); +} + +void ReferralProgramManager::get_connected_referral_program( + const td_api::object_ptr &affiliate, UserId bot_user_id, + Promise> &&promise) { + TRY_RESULT_PROMISE(promise, affiliate_type, AffiliateType::get_affiliate_type(td_, affiliate)); + TRY_RESULT_PROMISE(promise, input_user, td_->user_manager_->get_input_user(bot_user_id)); + + td_->create_handler(std::move(promise))->send(affiliate_type, std::move(input_user)); +} + +void ReferralProgramManager::get_connected_referral_programs( + const td_api::object_ptr &affiliate, const string &offset, int32 limit, + Promise> &&promise) { + TRY_RESULT_PROMISE(promise, affiliate_type, AffiliateType::get_affiliate_type(td_, affiliate)); + if (limit <= 0) { + return promise.set_error(Status::Error(400, "Limit must be positive")); + } + + td_->create_handler(std::move(promise))->send(affiliate_type, offset, limit); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramManager.h b/lib/tgchat/ext/td/td/telegram/ReferralProgramManager.h new file mode 100644 index 00000000..512b9ead --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramManager.h @@ -0,0 +1,103 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/DialogId.h" +#include "td/telegram/ReferralProgramInfo.h" +#include "td/telegram/ReferralProgramParameters.h" +#include "td/telegram/ReferralProgramSortOrder.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" +#include "td/telegram/UserId.h" + +#include "td/actor/actor.h" + +#include "td/utils/common.h" +#include "td/utils/Promise.h" + +namespace td { + +class Td; + +class ReferralProgramManager final : public Actor { + public: + ReferralProgramManager(Td *td, ActorShared<> parent); + + void set_dialog_referral_program(DialogId dialog_id, ReferralProgramParameters parameters, Promise &&promise); + + void search_dialog_referral_program(const string &username, const string &referral, + Promise> &&promise); + + void search_referral_programs(const td_api::object_ptr &affiliate, + ReferralProgramSortOrder sort_order, const string &offset, int32 limit, + Promise> &&promise); + + void connect_referral_program(const td_api::object_ptr &affiliate, UserId bot_user_id, + Promise> &&promise); + + void revoke_referral_program(const td_api::object_ptr &affiliate, const string &url, + Promise> &&promise); + + void get_connected_referral_program(const td_api::object_ptr &affiliate, UserId bot_user_id, + Promise> &&promise); + + void get_connected_referral_programs(const td_api::object_ptr &affiliate, const string &offset, + int32 limit, + Promise> &&promise); + + private: + class GetSuggestedStarRefBotsQuery; + class ConnectStarRefBotQuery; + class EditConnectedStarRefBotQuery; + class GetConnectedStarRefBotQuery; + class GetConnectedStarRefBotsQuery; + + class SuggestedBotStarRef { + UserId user_id_; + ReferralProgramInfo info_; + + public: + explicit SuggestedBotStarRef(telegram_api::object_ptr &&ref); + + bool is_valid() const { + return user_id_.is_valid() && info_.is_valid(); + } + + bool is_active() const { + return info_.is_active(); + } + + td_api::object_ptr get_found_affiliate_program_object(Td *td) const; + }; + + class ConnectedBotStarRef { + string url_; + int32 date_ = 0; + UserId user_id_; + ReferralProgramParameters parameters_; + int64 participant_count_ = 0; + int64 revenue_star_count_ = 0; + bool is_revoked_ = false; + + public: + explicit ConnectedBotStarRef(telegram_api::object_ptr &&ref); + + bool is_valid() const { + return !url_.empty() && date_ > 0 && user_id_.is_valid() && parameters_.is_valid() && participant_count_ >= 0 && + revenue_star_count_ >= 0; + } + + td_api::object_ptr get_connected_affiliate_program_object(Td *td) const; + }; + + void tear_down() final; + + Td *td_; + ActorShared<> parent_; +}; + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.cpp b/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.cpp new file mode 100644 index 00000000..e8794303 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.cpp @@ -0,0 +1,44 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/ReferralProgramParameters.h" + +namespace td { + +ReferralProgramParameters::ReferralProgramParameters(int32 commission_permille, int32 duration_months) + : commission_(commission_permille), month_count_(duration_months) { +} + +ReferralProgramParameters::ReferralProgramParameters( + const td_api::object_ptr ¶meters) { + if (parameters != nullptr) { + commission_ = parameters->commission_per_mille_; + month_count_ = parameters->month_count_; + if (!is_valid()) { + commission_ = -1; + } + } +} + +td_api::object_ptr +ReferralProgramParameters::get_affiliate_program_parameters_object() const { + CHECK(is_valid()); + return td_api::make_object(commission_, month_count_); +} + +bool operator==(const ReferralProgramParameters &lhs, const ReferralProgramParameters &rhs) { + return lhs.commission_ == rhs.commission_ && lhs.month_count_ == rhs.month_count_; +} + +StringBuilder &operator<<(StringBuilder &string_builder, const ReferralProgramParameters ¶meters) { + string_builder << "ReferralProgram[" << parameters.commission_; + if (parameters.month_count_ != 0) { + string_builder << " X " << parameters.month_count_; + } + return string_builder << ']'; +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.h b/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.h new file mode 100644 index 00000000..8fb521ac --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.h @@ -0,0 +1,60 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/td_api.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class ReferralProgramParameters { + int32 commission_ = 0; + int32 month_count_ = 0; + + friend bool operator==(const ReferralProgramParameters &lhs, const ReferralProgramParameters &rhs); + + friend StringBuilder &operator<<(StringBuilder &string_builder, const ReferralProgramParameters ¶meters); + + public: + ReferralProgramParameters() = default; + + ReferralProgramParameters(int32 commission_permille, int32 duration_months); + + explicit ReferralProgramParameters(const td_api::object_ptr ¶meters); + + bool is_valid() const { + return 1 <= commission_ && commission_ <= 999 && 0 <= month_count_ && month_count_ <= 36; + } + + int32 get_commission() const { + return commission_; + } + + int32 get_month_count() const { + return month_count_; + } + + td_api::object_ptr get_affiliate_program_parameters_object() const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); +}; + +bool operator==(const ReferralProgramParameters &lhs, const ReferralProgramParameters &rhs); + +inline bool operator!=(const ReferralProgramParameters &lhs, const ReferralProgramParameters &rhs) { + return !(lhs == rhs); +} + +StringBuilder &operator<<(StringBuilder &string_builder, const ReferralProgramParameters ¶meters); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.hpp b/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.hpp new file mode 100644 index 00000000..c7c836dc --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramParameters.hpp @@ -0,0 +1,43 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/ReferralProgramParameters.h" + +#include "td/utils/common.h" +#include "td/utils/tl_helpers.h" + +namespace td { + +template +void ReferralProgramParameters::store(StorerT &storer) const { + bool has_month_count = month_count_ != 0; + BEGIN_STORE_FLAGS(); + STORE_FLAG(has_month_count); + END_STORE_FLAGS(); + td::store(commission_, storer); + if (has_month_count) { + td::store(month_count_, storer); + } +} + +template +void ReferralProgramParameters::parse(ParserT &parser) { + bool has_month_count; + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(has_month_count); + END_PARSE_FLAGS(); + td::parse(commission_, parser); + if (has_month_count) { + td::parse(month_count_, parser); + } + if (!is_valid()) { + parser.set_error("Invalid referral program parameters stored in the database"); + } +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.cpp b/lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.cpp new file mode 100644 index 00000000..d100c80a --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.cpp @@ -0,0 +1,29 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/ReferralProgramSortOrder.h" + +namespace td { + +ReferralProgramSortOrder get_referral_program_sort_order( + const td_api::object_ptr &order) { + if (order == nullptr) { + return ReferralProgramSortOrder::Profitability; + } + switch (order->get_id()) { + case td_api::affiliateProgramSortOrderProfitability::ID: + return ReferralProgramSortOrder::Profitability; + case td_api::affiliateProgramSortOrderCreationDate::ID: + return ReferralProgramSortOrder::Date; + case td_api::affiliateProgramSortOrderRevenue::ID: + return ReferralProgramSortOrder::Revenue; + default: + UNREACHABLE(); + return ReferralProgramSortOrder::Profitability; + } +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.h b/lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.h new file mode 100644 index 00000000..67a81d27 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/ReferralProgramSortOrder.h @@ -0,0 +1,21 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/td_api.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +enum class ReferralProgramSortOrder : int32 { Profitability, Date, Revenue }; + +ReferralProgramSortOrder get_referral_program_sort_order( + const td_api::object_ptr &order); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.cpp b/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.cpp index a1a3488f..fbd75330 100644 --- a/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.h b/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.h index fdeae7bf..6a9e99d1 100644 --- a/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.h +++ b/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.hpp b/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.hpp index f28dadb1..61b12cb2 100644 --- a/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/RepliedMessageInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReplyMarkup.cpp b/lib/tgchat/ext/td/td/telegram/ReplyMarkup.cpp index 817b5201..571693b2 100644 --- a/lib/tgchat/ext/td/td/telegram/ReplyMarkup.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReplyMarkup.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReplyMarkup.h b/lib/tgchat/ext/td/td/telegram/ReplyMarkup.h index 6bfc2721..71e07cc8 100644 --- a/lib/tgchat/ext/td/td/telegram/ReplyMarkup.h +++ b/lib/tgchat/ext/td/td/telegram/ReplyMarkup.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReplyMarkup.hpp b/lib/tgchat/ext/td/td/telegram/ReplyMarkup.hpp index bb7e3c44..ab35482a 100644 --- a/lib/tgchat/ext/td/td/telegram/ReplyMarkup.hpp +++ b/lib/tgchat/ext/td/td/telegram/ReplyMarkup.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReportReason.cpp b/lib/tgchat/ext/td/td/telegram/ReportReason.cpp index ad2c2367..c217d4d2 100644 --- a/lib/tgchat/ext/td/td/telegram/ReportReason.cpp +++ b/lib/tgchat/ext/td/td/telegram/ReportReason.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ReportReason.h b/lib/tgchat/ext/td/td/telegram/ReportReason.h index faa08c8c..b0bd025b 100644 --- a/lib/tgchat/ext/td/td/telegram/ReportReason.h +++ b/lib/tgchat/ext/td/td/telegram/ReportReason.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RequestActor.h b/lib/tgchat/ext/td/td/telegram/RequestActor.h index 1d2209f0..8c29cfa6 100644 --- a/lib/tgchat/ext/td/td/telegram/RequestActor.h +++ b/lib/tgchat/ext/td/td/telegram/RequestActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RequestedDialogType.cpp b/lib/tgchat/ext/td/td/telegram/RequestedDialogType.cpp index 2afedb1c..0f904018 100644 --- a/lib/tgchat/ext/td/td/telegram/RequestedDialogType.cpp +++ b/lib/tgchat/ext/td/td/telegram/RequestedDialogType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RequestedDialogType.h b/lib/tgchat/ext/td/td/telegram/RequestedDialogType.h index 721dc9c0..af5333b2 100644 --- a/lib/tgchat/ext/td/td/telegram/RequestedDialogType.h +++ b/lib/tgchat/ext/td/td/telegram/RequestedDialogType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RequestedDialogType.hpp b/lib/tgchat/ext/td/td/telegram/RequestedDialogType.hpp index f5547b92..edb96b03 100644 --- a/lib/tgchat/ext/td/td/telegram/RequestedDialogType.hpp +++ b/lib/tgchat/ext/td/td/telegram/RequestedDialogType.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Requests.cpp b/lib/tgchat/ext/td/td/telegram/Requests.cpp index cf4f08a8..e6b5a9ac 100644 --- a/lib/tgchat/ext/td/td/telegram/Requests.cpp +++ b/lib/tgchat/ext/td/td/telegram/Requests.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -91,6 +91,7 @@ #include "td/telegram/MessageId.h" #include "td/telegram/MessageImportManager.h" #include "td/telegram/MessageLinkInfo.h" +#include "td/telegram/MessageQueryManager.h" #include "td/telegram/MessageReaction.h" #include "td/telegram/MessageSearchFilter.h" #include "td/telegram/MessageSender.h" @@ -121,6 +122,9 @@ #include "td/telegram/ReactionManager.h" #include "td/telegram/ReactionNotificationSettings.h" #include "td/telegram/ReactionType.h" +#include "td/telegram/ReferralProgramManager.h" +#include "td/telegram/ReferralProgramParameters.h" +#include "td/telegram/ReferralProgramSortOrder.h" #include "td/telegram/ReportReason.h" #include "td/telegram/RequestActor.h" #include "td/telegram/SavedMessagesManager.h" @@ -147,6 +151,7 @@ #include "td/telegram/StoryListId.h" #include "td/telegram/StoryManager.h" #include "td/telegram/SuggestedAction.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/Support.h" #include "td/telegram/SynchronousRequests.h" #include "td/telegram/td_api.hpp" @@ -2111,7 +2116,7 @@ void Requests::on_request(uint64 id, const td_api::getCurrentState &request) { td_->story_manager_->get_current_state(updates); - td_->config_manager_.get_actor_unsafe()->get_current_state(updates); + td_->suggested_action_manager_->get_current_state(updates); td_->transcription_manager_->get_current_state(updates); @@ -3172,10 +3177,10 @@ void Requests::on_request(uint64 id, td_api::searchMessages &request) { CLEAN_INPUT_STRING(request.query_); CLEAN_INPUT_STRING(request.offset_); CREATE_REQUEST_PROMISE(); - td_->messages_manager_->search_messages( - DialogListId(request.chat_list_), request.chat_list_ == nullptr, request.only_in_channels_, - std::move(request.query_), std::move(request.offset_), request.limit_, get_message_search_filter(request.filter_), - request.min_date_, request.max_date_, std::move(promise)); + td_->message_query_manager_->search_messages( + DialogListId(request.chat_list_), request.chat_list_ == nullptr, std::move(request.query_), + std::move(request.offset_), request.limit_, get_message_search_filter(request.filter_), + std::move(request.chat_type_filter_), request.min_date_, request.max_date_, std::move(promise)); } void Requests::on_request(uint64 id, td_api::searchSavedMessages &request) { @@ -3198,7 +3203,7 @@ void Requests::on_request(uint64 id, td_api::searchOutgoingDocumentMessages &req CHECK_IS_USER(); CLEAN_INPUT_STRING(request.query_); CREATE_REQUEST_PROMISE(); - td_->messages_manager_->search_outgoing_document_messages(request.query_, request.limit_, std::move(promise)); + td_->message_query_manager_->search_outgoing_document_messages(request.query_, request.limit_, std::move(promise)); } void Requests::on_request(uint64 id, td_api::searchPublicMessagesByTag &request) { @@ -3206,8 +3211,8 @@ void Requests::on_request(uint64 id, td_api::searchPublicMessagesByTag &request) CLEAN_INPUT_STRING(request.tag_); CLEAN_INPUT_STRING(request.offset_); CREATE_REQUEST_PROMISE(); - td_->messages_manager_->search_hashtag_posts(std::move(request.tag_), std::move(request.offset_), request.limit_, - std::move(promise)); + td_->message_query_manager_->search_hashtag_posts(std::move(request.tag_), std::move(request.offset_), request.limit_, + std::move(promise)); } void Requests::on_request(uint64 id, td_api::searchPublicStoriesByTag &request) { @@ -3283,8 +3288,8 @@ void Requests::on_request(uint64 id, const td_api::deleteAllCallMessages &reques void Requests::on_request(uint64 id, const td_api::searchChatRecentLocationMessages &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); - td_->messages_manager_->search_dialog_recent_location_messages(DialogId(request.chat_id_), request.limit_, - std::move(promise)); + td_->message_query_manager_->search_dialog_recent_location_messages(DialogId(request.chat_id_), request.limit_, + std::move(promise)); } void Requests::on_request(uint64 id, const td_api::getChatMessageByDate &request) { @@ -4200,7 +4205,8 @@ void Requests::on_request(uint64 id, const td_api::createCall &request) { } }); send_closure(G()->call_manager(), &CallManager::create_call, user_id, r_input_user.move_as_ok(), - CallProtocol(*request.protocol_), request.is_video_, std::move(query_promise)); + CallProtocol(*request.protocol_), request.is_video_, GroupCallId(request.group_call_id_), + std::move(query_promise)); } void Requests::on_request(uint64 id, const td_api::acceptCall &request) { @@ -4280,6 +4286,12 @@ void Requests::on_request(uint64 id, td_api::createVideoChat &request) { request.start_date_, request.is_rtmp_stream_, std::move(query_promise)); } +void Requests::on_request(uint64 id, const td_api::createGroupCall &request) { + CHECK_IS_USER(); + CREATE_OK_REQUEST_PROMISE(); + send_closure(G()->call_manager(), &CallManager::create_conference_call, CallId(request.call_id_), std::move(promise)); +} + void Requests::on_request(uint64 id, const td_api::getVideoChatRtmpUrl &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); @@ -5483,7 +5495,7 @@ void Requests::on_request(uint64 id, const td_api::blockMessageSenderFromReplies void Requests::on_request(uint64 id, const td_api::getBlockedMessageSenders &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); - td_->messages_manager_->get_blocked_dialogs(request.block_list_, request.offset_, request.limit_, std::move(promise)); + td_->dialog_manager_->get_blocked_dialogs(request.block_list_, request.offset_, request.limit_, std::move(promise)); } void Requests::on_request(uint64 id, td_api::addContact &request) { @@ -5605,6 +5617,12 @@ void Requests::on_request(uint64 id, const td_api::getRecentInlineBots &request) CREATE_NO_ARGS_REQUEST(GetRecentInlineBotsRequest); } +void Requests::on_request(uint64 id, const td_api::getOwnedBots &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + td_->bot_info_manager_->get_owned_bots(std::move(promise)); +} + void Requests::on_request(uint64 id, td_api::setName &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.first_name_); @@ -5871,6 +5889,21 @@ void Requests::on_request(uint64 id, const td_api::getBotInfoShortDescription &r td_->bot_info_manager_->get_bot_info_about(UserId(request.bot_user_id_), request.language_code_, std::move(promise)); } +void Requests::on_request(uint64 id, td_api::setMessageSenderBotVerification &request) { + CLEAN_INPUT_STRING(request.custom_description_); + CREATE_OK_REQUEST_PROMISE(); + TRY_RESULT_PROMISE(promise, dialog_id, get_message_sender_dialog_id(td_, request.verified_id_, true, false)); + td_->bot_info_manager_->set_custom_bot_verification(UserId(request.bot_user_id_), dialog_id, true, + request.custom_description_, std::move(promise)); +} + +void Requests::on_request(uint64 id, const td_api::removeMessageSenderBotVerification &request) { + CREATE_OK_REQUEST_PROMISE(); + TRY_RESULT_PROMISE(promise, dialog_id, get_message_sender_dialog_id(td_, request.verified_id_, true, false)); + td_->bot_info_manager_->set_custom_bot_verification(UserId(request.bot_user_id_), dialog_id, false, string(), + std::move(promise)); +} + void Requests::on_request(uint64 id, td_api::setBusinessLocation &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); @@ -6170,9 +6203,13 @@ void Requests::on_request(uint64 id, td_api::getAllStickerEmojis &request) { void Requests::on_request(uint64 id, td_api::searchStickers &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.emojis_); + CLEAN_INPUT_STRING(request.query_); + for (auto &input_language_code : request.input_language_codes_) { + CLEAN_INPUT_STRING(input_language_code); + } CREATE_REQUEST_PROMISE(); auto sticker_type = get_sticker_type(request.sticker_type_); - if (sticker_type == StickerType::Regular) { + if (sticker_type == StickerType::Regular && request.query_.empty()) { // legacy if (request.emojis_ == "⭐️⭐️") { request.emojis_ = "⭐️"; @@ -6182,13 +6219,16 @@ void Requests::on_request(uint64 id, td_api::searchStickers &request) { request.emojis_ = "👋"; } } - td_->stickers_manager_->search_stickers(sticker_type, std::move(request.emojis_), request.limit_, std::move(promise)); + td_->stickers_manager_->search_stickers(sticker_type, std::move(request.emojis_), request.query_, + request.input_language_codes_, request.offset_, request.limit_, + std::move(promise)); } void Requests::on_request(uint64 id, const td_api::getGreetingStickers &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); - td_->stickers_manager_->search_stickers(StickerType::Regular, "👋⭐️", 100, std::move(promise)); + td_->stickers_manager_->search_stickers(StickerType::Regular, "👋⭐️", string(), vector(), 0, 100, + std::move(promise)); } void Requests::on_request(uint64 id, const td_api::getPremiumStickers &request) { @@ -6682,7 +6722,7 @@ void Requests::on_request(uint64 id, td_api::setReactionNotificationSettings &re void Requests::on_request(uint64 id, const td_api::resetAllNotificationSettings &request) { CHECK_IS_USER(); - td_->messages_manager_->reset_all_notification_settings(); + td_->notification_settings_manager_->reset_all_notification_settings(); send_closure(td_actor_, &Td::send_result, id, td_api::make_object()); } @@ -7075,7 +7115,7 @@ void Requests::on_request(uint64 id, const td_api::getAvailableGifts &request) { void Requests::on_request(uint64 id, td_api::sendGift &request) { CREATE_OK_REQUEST_PROMISE(); td_->star_gift_manager_->send_gift(request.gift_id_, UserId(request.user_id_), std::move(request.text_), - request.is_private_, std::move(promise)); + request.is_private_, request.pay_for_upgrade_, std::move(promise)); } void Requests::on_request(uint64 id, const td_api::sellGift &request) { @@ -7092,6 +7132,26 @@ void Requests::on_request(uint64 id, const td_api::toggleGiftIsSaved &request) { std::move(promise)); } +void Requests::on_request(uint64 id, const td_api::getGiftUpgradePreview &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + td_->star_gift_manager_->get_gift_upgrade_preview(request.gift_id_, std::move(promise)); +} + +void Requests::on_request(uint64 id, const td_api::upgradeGift &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + td_->star_gift_manager_->upgrade_gift(UserId(request.sender_user_id_), MessageId(request.message_id_), + request.keep_original_details_, std::move(promise)); +} + +void Requests::on_request(uint64 id, const td_api::transferGift &request) { + CHECK_IS_USER(); + CREATE_OK_REQUEST_PROMISE(); + td_->star_gift_manager_->transfer_gift(UserId(request.sender_user_id_), MessageId(request.message_id_), + UserId(request.receiver_user_id_), request.star_count_, std::move(promise)); +} + void Requests::on_request(uint64 id, td_api::getUserGifts &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.offset_); @@ -7100,6 +7160,12 @@ void Requests::on_request(uint64 id, td_api::getUserGifts &request) { std::move(promise)); } +void Requests::on_request(uint64 id, const td_api::getUserGift &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + td_->star_gift_manager_->get_user_gift(MessageId(request.message_id_), std::move(promise)); +} + void Requests::on_request(uint64 id, td_api::createInvoiceLink &request) { CLEAN_INPUT_STRING(request.business_connection_id_); CHECK_IS_BOT(); @@ -7378,7 +7444,8 @@ void Requests::on_request(uint64 id, const td_api::getPremiumFeatures &request) void Requests::on_request(uint64 id, const td_api::getPremiumStickerExamples &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); - td_->stickers_manager_->search_stickers(StickerType::Regular, "⭐️⭐️", 100, std::move(promise)); + td_->stickers_manager_->search_stickers(StickerType::Regular, "⭐️⭐️", string(), vector(), 0, 100, + std::move(promise)); } void Requests::on_request(uint64 id, const td_api::getPremiumInfoSticker &request) { @@ -7493,6 +7560,60 @@ void Requests::on_request(uint64 id, td_api::reuseStarSubscription &request) { td_->star_manager_->reuse_star_subscription(request.subscription_id_, std::move(promise)); } +void Requests::on_request(uint64 id, const td_api::setChatAffiliateProgram &request) { + CHECK_IS_USER(); + CREATE_OK_REQUEST_PROMISE(); + td_->referral_program_manager_->set_dialog_referral_program( + DialogId(request.chat_id_), ReferralProgramParameters(request.parameters_), std::move(promise)); +} + +void Requests::on_request(uint64 id, td_api::searchChatAffiliateProgram &request) { + CHECK_IS_USER(); + CLEAN_INPUT_STRING(request.username_); + CLEAN_INPUT_STRING(request.referrer_); + CREATE_REQUEST_PROMISE(); + td_->referral_program_manager_->search_dialog_referral_program(request.username_, request.referrer_, + std::move(promise)); +} + +void Requests::on_request(uint64 id, td_api::searchAffiliatePrograms &request) { + CHECK_IS_USER(); + CLEAN_INPUT_STRING(request.offset_); + CREATE_REQUEST_PROMISE(); + td_->referral_program_manager_->search_referral_programs(request.affiliate_, + get_referral_program_sort_order(request.sort_order_), + request.offset_, request.limit_, std::move(promise)); +} + +void Requests::on_request(uint64 id, const td_api::connectAffiliateProgram &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + td_->referral_program_manager_->connect_referral_program(request.affiliate_, UserId(request.bot_user_id_), + std::move(promise)); +} + +void Requests::on_request(uint64 id, td_api::disconnectAffiliateProgram &request) { + CHECK_IS_USER(); + CLEAN_INPUT_STRING(request.url_); + CREATE_REQUEST_PROMISE(); + td_->referral_program_manager_->revoke_referral_program(request.affiliate_, request.url_, std::move(promise)); +} + +void Requests::on_request(uint64 id, const td_api::getConnectedAffiliateProgram &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + td_->referral_program_manager_->get_connected_referral_program(request.affiliate_, UserId(request.bot_user_id_), + std::move(promise)); +} + +void Requests::on_request(uint64 id, td_api::getConnectedAffiliatePrograms &request) { + CHECK_IS_USER(); + CLEAN_INPUT_STRING(request.offset_); + CREATE_REQUEST_PROMISE(); + td_->referral_program_manager_->get_connected_referral_programs(request.affiliate_, request.offset_, request.limit_, + std::move(promise)); +} + void Requests::on_request(uint64 id, td_api::canPurchaseFromStore &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); diff --git a/lib/tgchat/ext/td/td/telegram/Requests.h b/lib/tgchat/ext/td/td/telegram/Requests.h index 922d5be8..e79ba6d2 100644 --- a/lib/tgchat/ext/td/td/telegram/Requests.h +++ b/lib/tgchat/ext/td/td/telegram/Requests.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -683,6 +683,8 @@ class Requests { void on_request(uint64 id, td_api::createVideoChat &request); + void on_request(uint64 id, const td_api::createGroupCall &request); + void on_request(uint64 id, const td_api::getVideoChatRtmpUrl &request); void on_request(uint64 id, const td_api::replaceVideoChatRtmpUrl &request); @@ -1043,6 +1045,8 @@ class Requests { void on_request(uint64 id, const td_api::getRecentInlineBots &request); + void on_request(uint64 id, const td_api::getOwnedBots &request); + void on_request(uint64 id, td_api::setName &request); void on_request(uint64 id, td_api::setBio &request); @@ -1123,6 +1127,10 @@ class Requests { void on_request(uint64 id, const td_api::getBotInfoShortDescription &request); + void on_request(uint64 id, td_api::setMessageSenderBotVerification &request); + + void on_request(uint64 id, const td_api::removeMessageSenderBotVerification &request); + void on_request(uint64 id, td_api::setBusinessLocation &request); void on_request(uint64 id, td_api::setBusinessOpeningHours &request); @@ -1469,8 +1477,16 @@ class Requests { void on_request(uint64 id, const td_api::toggleGiftIsSaved &request); + void on_request(uint64 id, const td_api::getGiftUpgradePreview &request); + + void on_request(uint64 id, const td_api::upgradeGift &request); + + void on_request(uint64 id, const td_api::transferGift &request); + void on_request(uint64 id, td_api::getUserGifts &request); + void on_request(uint64 id, const td_api::getUserGift &request); + void on_request(uint64 id, td_api::createInvoiceLink &request); void on_request(uint64 id, td_api::refundStarPayment &request); @@ -1569,6 +1585,20 @@ class Requests { void on_request(uint64 id, td_api::reuseStarSubscription &request); + void on_request(uint64 id, const td_api::setChatAffiliateProgram &request); + + void on_request(uint64 id, td_api::searchChatAffiliateProgram &request); + + void on_request(uint64 id, td_api::searchAffiliatePrograms &request); + + void on_request(uint64 id, const td_api::connectAffiliateProgram &request); + + void on_request(uint64 id, td_api::disconnectAffiliateProgram &request); + + void on_request(uint64 id, const td_api::getConnectedAffiliateProgram &request); + + void on_request(uint64 id, td_api::getConnectedAffiliatePrograms &request); + void on_request(uint64 id, td_api::canPurchaseFromStore &request); void on_request(uint64 id, td_api::assignAppStoreTransaction &request); diff --git a/lib/tgchat/ext/td/td/telegram/RestrictionReason.cpp b/lib/tgchat/ext/td/td/telegram/RestrictionReason.cpp index c187a70b..db403378 100644 --- a/lib/tgchat/ext/td/td/telegram/RestrictionReason.cpp +++ b/lib/tgchat/ext/td/td/telegram/RestrictionReason.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/RestrictionReason.h b/lib/tgchat/ext/td/td/telegram/RestrictionReason.h index 391a0983..df3a104a 100644 --- a/lib/tgchat/ext/td/td/telegram/RestrictionReason.h +++ b/lib/tgchat/ext/td/td/telegram/RestrictionReason.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.cpp b/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.cpp index d9dad76b..d4efe869 100644 --- a/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -789,22 +789,23 @@ bool SavedMessagesManager::set_pinned_saved_messages_topics(vectorauth_manager_->is_bot()); - CHECK(topic != nullptr); + LOG_CHECK(topic != nullptr) << source; if (!topic_list_.are_pinned_saved_messages_topics_inited_) { return false; } @@ -825,9 +826,9 @@ bool SavedMessagesManager::set_saved_messages_topic_is_pinned(SavedMessagesTopic topic->pinned_order_ = 0; } - LOG(INFO) << "Set " << saved_messages_topic_id << " pinned order to " << topic->pinned_order_; + LOG(INFO) << "Set " << saved_messages_topic_id << " pinned order to " << topic->pinned_order_ << " from " << source; topic->is_changed_ = true; - on_topic_changed(topic, "set_saved_messages_topic_is_pinned"); + on_topic_changed(topic, source); return true; } @@ -985,7 +986,8 @@ void SavedMessagesManager::toggle_saved_messages_topic_is_pinned(SavedMessagesTo if (!topic_list_.are_pinned_saved_messages_topics_inited_) { return promise.set_error(Status::Error(400, "Pinned Saved Messages topics must be loaded first")); } - if (get_topic(saved_messages_topic_id) == nullptr) { + auto *topic = get_topic(saved_messages_topic_id); + if (topic == nullptr) { return promise.set_error(Status::Error(400, "Can't find Saved Messages topic")); } if (is_pinned && !td::contains(topic_list_.pinned_saved_messages_topic_ids_, saved_messages_topic_id) && @@ -993,7 +995,7 @@ void SavedMessagesManager::toggle_saved_messages_topic_is_pinned(SavedMessagesTo topic_list_.pinned_saved_messages_topic_ids_.size()) { return promise.set_error(Status::Error(400, "The maximum number of pinned chats exceeded")); } - if (!set_saved_messages_topic_is_pinned(saved_messages_topic_id, is_pinned)) { + if (!set_saved_messages_topic_is_pinned(topic, is_pinned, "toggle_saved_messages_topic_is_pinned")) { return promise.set_value(Unit()); } td_->create_handler(std::move(promise))->send(saved_messages_topic_id, is_pinned); diff --git a/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.h b/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.h index 6b79327f..78bce7e8 100644 --- a/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.h +++ b/lib/tgchat/ext/td/td/telegram/SavedMessagesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -165,9 +165,10 @@ class SavedMessagesManager final : public Actor { bool set_pinned_saved_messages_topics(vector added_saved_messages_topic_ids); - bool set_saved_messages_topic_is_pinned(SavedMessagesTopicId saved_messages_topic_id, bool is_pinned); + bool set_saved_messages_topic_is_pinned(SavedMessagesTopicId saved_messages_topic_id, bool is_pinned, + const char *source); - bool set_saved_messages_topic_is_pinned(SavedMessagesTopic *topic, bool is_pinned); + bool set_saved_messages_topic_is_pinned(SavedMessagesTopic *topic, bool is_pinned, const char *source); int32 get_pinned_saved_messages_topic_limit() const; diff --git a/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.cpp b/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.cpp index 8618a286..2334bab9 100644 --- a/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.cpp +++ b/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -12,6 +12,7 @@ #include "td/telegram/MessageForwardInfo.h" #include "td/telegram/Td.h" #include "td/telegram/telegram_api.h" +#include "td/telegram/UserManager.h" namespace td { @@ -55,6 +56,7 @@ td_api::object_ptr SavedMessagesTopicId::get_sav return td_api::make_object(); } if (is_author_hidden()) { + td->user_manager_->get_user_id_object(HIDDEN_AUTHOR_DIALOG_ID.get_user_id(), "savedMessagesTopicTypeAuthorHidden"); return td_api::make_object(); } return td_api::make_object( diff --git a/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.h b/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.h index 2de568a0..e08c7cba 100644 --- a/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.h +++ b/lib/tgchat/ext/td/td/telegram/SavedMessagesTopicId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ScheduledServerMessageId.h b/lib/tgchat/ext/td/td/telegram/ScheduledServerMessageId.h index b7b2fcc5..202fa26c 100644 --- a/lib/tgchat/ext/td/td/telegram/ScheduledServerMessageId.h +++ b/lib/tgchat/ext/td/td/telegram/ScheduledServerMessageId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.cpp b/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.cpp index 78828f4d..4541d1fd 100644 --- a/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.cpp +++ b/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.h b/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.h index 325f85c1..7a6ef167 100644 --- a/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.h +++ b/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.hpp b/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.hpp index d783a113..bf451e83 100644 --- a/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.hpp +++ b/lib/tgchat/ext/td/td/telegram/ScopeNotificationSettings.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatActor.cpp b/lib/tgchat/ext/td/td/telegram/SecretChatActor.cpp index dd6ecfd4..7754e8af 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatActor.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecretChatActor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1310,7 +1310,7 @@ Status SecretChatActor::do_inbound_message_decrypted(unique_ptrmessage_id; TRY_STATUS(on_inbound_action(*action, message->message_id)); } else { - LOG(ERROR) << "INGORE MESSAGE: " << to_string(message->decrypted_message_layer); + LOG(ERROR) << "IGNORE MESSAGE: " << to_string(message->decrypted_message_layer); save_message_finish.set_value(Unit()); } diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatActor.h b/lib/tgchat/ext/td/td/telegram/SecretChatActor.h index 2136e365..17869bf8 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatActor.h +++ b/lib/tgchat/ext/td/td/telegram/SecretChatActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -476,7 +476,7 @@ class SecretChatActor final : public NetQueryCallback { // We may accept some other change during that time, and there goes our problem // The reason for the change may already be invalid. So we should somehow recheck change, that // is already written to binlog, and apply it only if necessary. - // This is completly flawed. + // This is completely flawed. // (A-start_save_to_binlog ----> B-start_save_to_binlog+change_memory ----> A-finish_save_to_binlog+surprise) // // Instead, I suggest general solution that is already used with SeqNoState and QTS diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatDb.cpp b/lib/tgchat/ext/td/td/telegram/SecretChatDb.cpp index d6072df3..e4e588bb 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecretChatDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatDb.h b/lib/tgchat/ext/td/td/telegram/SecretChatDb.h index 9197678e..14f7d029 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatDb.h +++ b/lib/tgchat/ext/td/td/telegram/SecretChatDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatId.h b/lib/tgchat/ext/td/td/telegram/SecretChatId.h index 9e700f79..908c8288 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatId.h +++ b/lib/tgchat/ext/td/td/telegram/SecretChatId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatLayer.h b/lib/tgchat/ext/td/td/telegram/SecretChatLayer.h index b1025921..745ef1e7 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatLayer.h +++ b/lib/tgchat/ext/td/td/telegram/SecretChatLayer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatsManager.cpp b/lib/tgchat/ext/td/td/telegram/SecretChatsManager.cpp index 12044f8b..9120f0ad 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecretChatsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretChatsManager.h b/lib/tgchat/ext/td/td/telegram/SecretChatsManager.h index d6569a8b..166002b9 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretChatsManager.h +++ b/lib/tgchat/ext/td/td/telegram/SecretChatsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretInputMedia.cpp b/lib/tgchat/ext/td/td/telegram/SecretInputMedia.cpp index 9527e056..9c7029b8 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretInputMedia.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecretInputMedia.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecretInputMedia.h b/lib/tgchat/ext/td/td/telegram/SecretInputMedia.h index e37daa45..7c07a0da 100644 --- a/lib/tgchat/ext/td/td/telegram/SecretInputMedia.h +++ b/lib/tgchat/ext/td/td/telegram/SecretInputMedia.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureManager.cpp b/lib/tgchat/ext/td/td/telegram/SecureManager.cpp index 569ab7f2..ec67b817 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecureManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureManager.h b/lib/tgchat/ext/td/td/telegram/SecureManager.h index 363b9ecd..7340e9d5 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureManager.h +++ b/lib/tgchat/ext/td/td/telegram/SecureManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureStorage.cpp b/lib/tgchat/ext/td/td/telegram/SecureStorage.cpp index 44b48b2f..78250ef6 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureStorage.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecureStorage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureStorage.h b/lib/tgchat/ext/td/td/telegram/SecureStorage.h index 71d388ed..4799469f 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureStorage.h +++ b/lib/tgchat/ext/td/td/telegram/SecureStorage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureValue.cpp b/lib/tgchat/ext/td/td/telegram/SecureValue.cpp index db230b14..73db6a6b 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureValue.cpp +++ b/lib/tgchat/ext/td/td/telegram/SecureValue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureValue.h b/lib/tgchat/ext/td/td/telegram/SecureValue.h index 671dc993..763bb47f 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureValue.h +++ b/lib/tgchat/ext/td/td/telegram/SecureValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SecureValue.hpp b/lib/tgchat/ext/td/td/telegram/SecureValue.hpp index ba117f72..0634b278 100644 --- a/lib/tgchat/ext/td/td/telegram/SecureValue.hpp +++ b/lib/tgchat/ext/td/td/telegram/SecureValue.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SendCodeHelper.cpp b/lib/tgchat/ext/td/td/telegram/SendCodeHelper.cpp index 6b731d94..52872ef6 100644 --- a/lib/tgchat/ext/td/td/telegram/SendCodeHelper.cpp +++ b/lib/tgchat/ext/td/td/telegram/SendCodeHelper.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SendCodeHelper.h b/lib/tgchat/ext/td/td/telegram/SendCodeHelper.h index 3b356253..600068ba 100644 --- a/lib/tgchat/ext/td/td/telegram/SendCodeHelper.h +++ b/lib/tgchat/ext/td/td/telegram/SendCodeHelper.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SendCodeHelper.hpp b/lib/tgchat/ext/td/td/telegram/SendCodeHelper.hpp index 59f380c7..a413a64e 100644 --- a/lib/tgchat/ext/td/td/telegram/SendCodeHelper.hpp +++ b/lib/tgchat/ext/td/td/telegram/SendCodeHelper.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SentEmailCode.cpp b/lib/tgchat/ext/td/td/telegram/SentEmailCode.cpp index c0f14956..a8a3ad0e 100644 --- a/lib/tgchat/ext/td/td/telegram/SentEmailCode.cpp +++ b/lib/tgchat/ext/td/td/telegram/SentEmailCode.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SentEmailCode.h b/lib/tgchat/ext/td/td/telegram/SentEmailCode.h index e87230ad..8c5aa907 100644 --- a/lib/tgchat/ext/td/td/telegram/SentEmailCode.h +++ b/lib/tgchat/ext/td/td/telegram/SentEmailCode.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.cpp b/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.cpp index f7facb4b..bbd89e46 100644 --- a/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.cpp +++ b/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.h b/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.h index 6e768bf9..c44d5988 100644 --- a/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.h +++ b/lib/tgchat/ext/td/td/telegram/SequenceDispatcher.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ServerMessageId.h b/lib/tgchat/ext/td/td/telegram/ServerMessageId.h index 167de9c1..c5d4f77d 100644 --- a/lib/tgchat/ext/td/td/telegram/ServerMessageId.h +++ b/lib/tgchat/ext/td/td/telegram/ServerMessageId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SetWithPosition.h b/lib/tgchat/ext/td/td/telegram/SetWithPosition.h index d5cbb5f6..c77991bb 100644 --- a/lib/tgchat/ext/td/td/telegram/SetWithPosition.h +++ b/lib/tgchat/ext/td/td/telegram/SetWithPosition.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SharedDialog.cpp b/lib/tgchat/ext/td/td/telegram/SharedDialog.cpp index edcfb44f..89135e4d 100644 --- a/lib/tgchat/ext/td/td/telegram/SharedDialog.cpp +++ b/lib/tgchat/ext/td/td/telegram/SharedDialog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SharedDialog.h b/lib/tgchat/ext/td/td/telegram/SharedDialog.h index 3258cbaf..629ca3e5 100644 --- a/lib/tgchat/ext/td/td/telegram/SharedDialog.h +++ b/lib/tgchat/ext/td/td/telegram/SharedDialog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SharedDialog.hpp b/lib/tgchat/ext/td/td/telegram/SharedDialog.hpp index ae050612..1cdbc673 100644 --- a/lib/tgchat/ext/td/td/telegram/SharedDialog.hpp +++ b/lib/tgchat/ext/td/td/telegram/SharedDialog.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.cpp b/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.cpp index c8b53a4c..1515b079 100644 --- a/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.cpp +++ b/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.h b/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.h index 35eca97c..b35c0218 100644 --- a/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.h +++ b/lib/tgchat/ext/td/td/telegram/SpecialStickerSetType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.cpp b/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.cpp index a78b4c35..50481717 100644 --- a/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.h b/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.h index 0eb87af9..37c69a8c 100644 --- a/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.h +++ b/lib/tgchat/ext/td/td/telegram/SponsoredMessageManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StarAmount.cpp b/lib/tgchat/ext/td/td/telegram/StarAmount.cpp new file mode 100644 index 00000000..df36d12e --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/StarAmount.cpp @@ -0,0 +1,49 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/StarAmount.h" + +#include "td/telegram/StarManager.h" + +#include "td/utils/misc.h" + +namespace td { + +StarAmount::StarAmount(telegram_api::object_ptr &&amount, bool allow_negative) { + if (amount != nullptr) { + star_count_ = StarManager::get_star_count(amount->amount_, allow_negative); + nanostar_count_ = StarManager::get_nanostar_count(star_count_, amount->nanos_); + } +} + +td_api::object_ptr StarAmount::get_star_amount_object() const { + return td_api::make_object(star_count_, nanostar_count_); +} + +bool operator==(const StarAmount &lhs, const StarAmount &rhs) { + return lhs.star_count_ == rhs.star_count_ && lhs.nanostar_count_ == rhs.nanostar_count_; +} + +StringBuilder &operator<<(StringBuilder &string_builder, const StarAmount &star_amount) { + auto star_count = star_amount.get_star_count(); + auto nanostar_count = star_amount.get_nanostar_count(); + if (star_count < 0 || nanostar_count < 0) { + string_builder << '-'; + star_count *= -1; + nanostar_count *= -1; + } + string_builder << star_count; + if (nanostar_count != 0) { + auto nanostar_str = lpad0(to_string(nanostar_count), 9); + while (!nanostar_str.empty() && nanostar_str.back() == '0') { + nanostar_str.pop_back(); + } + string_builder << '.' << nanostar_str; + } + return string_builder << " Telegram Stars"; +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarAmount.h b/lib/tgchat/ext/td/td/telegram/StarAmount.h new file mode 100644 index 00000000..b03aa79e --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/StarAmount.h @@ -0,0 +1,57 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class StarAmount { + int64 star_count_ = 0; + int32 nanostar_count_ = 0; + + friend bool operator==(const StarAmount &lhs, const StarAmount &rhs); + + public: + StarAmount() = default; + + StarAmount(telegram_api::object_ptr &&amount, bool allow_negative); + + int64 get_star_count() const { + return star_count_; + } + + int32 get_nanostar_count() const { + return nanostar_count_; + } + + bool is_positive() const { + return star_count_ > 0 || nanostar_count_ > 0; + } + + td_api::object_ptr get_star_amount_object() const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); +}; + +bool operator==(const StarAmount &lhs, const StarAmount &rhs); + +inline bool operator!=(const StarAmount &lhs, const StarAmount &rhs) { + return !(lhs == rhs); +} + +StringBuilder &operator<<(StringBuilder &string_builder, const StarAmount &star_amount); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarAmount.hpp b/lib/tgchat/ext/td/td/telegram/StarAmount.hpp new file mode 100644 index 00000000..0bee25fd --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/StarAmount.hpp @@ -0,0 +1,28 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/StarAmount.h" + +#include "td/utils/common.h" +#include "td/utils/tl_helpers.h" + +namespace td { + +template +void StarAmount::store(StorerT &storer) const { + td::store(star_count_, storer); + td::store(nanostar_count_, storer); +} + +template +void StarAmount::parse(ParserT &parser) { + td::parse(star_count_, parser); + td::parse(nanostar_count_, parser); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarGift.cpp b/lib/tgchat/ext/td/td/telegram/StarGift.cpp index 81406270..a3ae2f5c 100644 --- a/lib/tgchat/ext/td/td/telegram/StarGift.cpp +++ b/lib/tgchat/ext/td/td/telegram/StarGift.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,13 +10,81 @@ #include "td/telegram/StickerFormat.h" #include "td/telegram/StickersManager.h" #include "td/telegram/Td.h" +#include "td/telegram/UserManager.h" #include "td/utils/logging.h" namespace td { -StarGift::StarGift(Td *td, telegram_api::object_ptr &&star_gift) { - CHECK(star_gift != nullptr); +StarGift::StarGift(Td *td, telegram_api::object_ptr &&star_gift_ptr, bool allow_unique_gift) { + CHECK(star_gift_ptr != nullptr); + auto constructor_id = star_gift_ptr->get_id(); + if (allow_unique_gift && constructor_id == telegram_api::starGiftUnique::ID) { + auto star_gift = telegram_api::move_object_as(star_gift_ptr); + if (star_gift->id_ == 0) { + LOG(ERROR) << "Receive " << to_string(star_gift); + return; + } + is_unique_ = true; + id_ = star_gift->id_; + title_ = std::move(star_gift->title_); + num_ = star_gift->num_; + owner_user_id_ = UserId(star_gift->owner_id_); + unique_availability_issued_ = star_gift->availability_issued_; + unique_availability_total_ = star_gift->availability_total_; + for (auto &attribute : star_gift->attributes_) { + switch (attribute->get_id()) { + case telegram_api::starGiftAttributeModel::ID: + if (model_.is_valid()) { + LOG(ERROR) << "Receive duplicate model for " << *this; + } + model_ = StarGiftAttributeSticker( + td, telegram_api::move_object_as(attribute)); + if (!model_.is_valid()) { + LOG(ERROR) << "Receive invalid model for " << *this; + } + break; + case telegram_api::starGiftAttributePattern::ID: + if (pattern_.is_valid()) { + LOG(ERROR) << "Receive duplicate symbol for " << *this; + } + pattern_ = StarGiftAttributeSticker( + td, telegram_api::move_object_as(attribute)); + if (!pattern_.is_valid()) { + LOG(ERROR) << "Receive invalid symbol for " << *this; + } + break; + case telegram_api::starGiftAttributeBackdrop::ID: + if (backdrop_.is_valid()) { + LOG(ERROR) << "Receive duplicate backdrop for " << *this; + } + backdrop_ = StarGiftAttributeBackdrop( + telegram_api::move_object_as(attribute)); + if (!backdrop_.is_valid()) { + LOG(ERROR) << "Receive invalid backdrop for " << *this; + } + break; + case telegram_api::starGiftAttributeOriginalDetails::ID: + if (original_details_.is_valid()) { + LOG(ERROR) << "Receive duplicate original details for " << *this; + } + original_details_ = StarGiftAttributeOriginalDetails( + td, telegram_api::move_object_as(attribute)); + if (!original_details_.is_valid()) { + LOG(ERROR) << "Receive invalid original details for " << *this; + } + break; + default: + UNREACHABLE(); + } + } + return; + } + if (constructor_id != telegram_api::starGift::ID) { + LOG(ERROR) << "Receive " << to_string(star_gift_ptr); + return; + } + auto star_gift = telegram_api::move_object_as(star_gift_ptr); if (star_gift->id_ == 0) { LOG(ERROR) << "Receive " << to_string(star_gift); return; @@ -48,6 +116,7 @@ StarGift::StarGift(Td *td, telegram_api::object_ptr &&st id_ = star_gift->id_; star_count_ = StarManager::get_star_count(star_gift->stars_); default_sell_star_count_ = StarManager::get_star_count(star_gift->convert_stars_); + upgrade_star_count_ = StarManager::get_star_count(star_gift->upgrade_stars_); sticker_file_id_ = sticker_id; availability_remains_ = star_gift->availability_remains_; availability_total_ = star_gift->availability_total_; @@ -56,17 +125,42 @@ StarGift::StarGift(Td *td, telegram_api::object_ptr &&st td_api::object_ptr StarGift::get_gift_object(const Td *td) const { CHECK(is_valid()); - return td_api::make_object( - id_, td->stickers_manager_->get_sticker_object(sticker_file_id_), star_count_, default_sell_star_count_, - is_for_birthday_, availability_remains_, availability_total_, first_sale_date_, last_sale_date_); + CHECK(!is_unique_); + return td_api::make_object(id_, td->stickers_manager_->get_sticker_object(sticker_file_id_), + star_count_, default_sell_star_count_, upgrade_star_count_, is_for_birthday_, + availability_remains_, availability_total_, first_sale_date_, + last_sale_date_); +} + +td_api::object_ptr StarGift::get_upgraded_gift_object(Td *td) const { + CHECK(is_valid()); + CHECK(is_unique_); + return td_api::make_object( + id_, title_, num_, unique_availability_issued_, unique_availability_total_, + td->user_manager_->get_user_id_object(owner_user_id_, "upgradedGift"), model_.get_upgraded_gift_model_object(td), + pattern_.get_upgraded_gift_symbol_object(td), backdrop_.get_upgraded_gift_backdrop_object(), + original_details_.get_upgraded_gift_original_details_object(td)); +} + +td_api::object_ptr StarGift::get_sent_gift_object(Td *td) const { + if (is_unique_) { + return td_api::make_object(get_upgraded_gift_object(td)); + } else { + return td_api::make_object(get_gift_object(td)); + } } bool operator==(const StarGift &lhs, const StarGift &rhs) { return lhs.id_ == rhs.id_ && lhs.sticker_file_id_ == rhs.sticker_file_id_ && lhs.star_count_ == rhs.star_count_ && lhs.default_sell_star_count_ == rhs.default_sell_star_count_ && - lhs.availability_remains_ == rhs.availability_remains_ && lhs.availability_total_ == rhs.availability_total_ && - lhs.first_sale_date_ == rhs.first_sale_date_ && lhs.last_sale_date_ == rhs.last_sale_date_ && - lhs.is_for_birthday_ == rhs.is_for_birthday_; + lhs.upgrade_star_count_ == rhs.upgrade_star_count_ && lhs.availability_remains_ == rhs.availability_remains_ && + lhs.availability_total_ == rhs.availability_total_ && lhs.first_sale_date_ == rhs.first_sale_date_ && + lhs.last_sale_date_ == rhs.last_sale_date_ && lhs.is_for_birthday_ == rhs.is_for_birthday_ && + lhs.is_unique_ == rhs.is_unique_ && lhs.model_ == rhs.model_ && lhs.pattern_ == rhs.pattern_ && + lhs.backdrop_ == rhs.backdrop_ && lhs.original_details_ == rhs.original_details_ && lhs.title_ == rhs.title_ && + lhs.owner_user_id_ == rhs.owner_user_id_ && lhs.num_ == rhs.num_ && + lhs.unique_availability_issued_ == rhs.unique_availability_issued_ && + lhs.unique_availability_total_ == rhs.unique_availability_total_; } StringBuilder &operator<<(StringBuilder &string_builder, const StarGift &star_gift) { diff --git a/lib/tgchat/ext/td/td/telegram/StarGift.h b/lib/tgchat/ext/td/td/telegram/StarGift.h index 6038d2dc..2c2032ff 100644 --- a/lib/tgchat/ext/td/td/telegram/StarGift.h +++ b/lib/tgchat/ext/td/td/telegram/StarGift.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,8 +7,10 @@ #pragma once #include "td/telegram/files/FileId.h" +#include "td/telegram/StarGiftAttribute.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" +#include "td/telegram/UserId.h" #include "td/utils/common.h" #include "td/utils/StringBuilder.h" @@ -19,15 +21,28 @@ class Td; class StarGift { int64 id_ = 0; + FileId sticker_file_id_; int64 star_count_ = 0; int64 default_sell_star_count_ = 0; + int64 upgrade_star_count_ = 0; int32 availability_remains_ = 0; int32 availability_total_ = 0; int32 first_sale_date_ = 0; int32 last_sale_date_ = 0; bool is_for_birthday_ = false; + bool is_unique_ = false; + StarGiftAttributeSticker model_; + StarGiftAttributeSticker pattern_; + StarGiftAttributeBackdrop backdrop_; + StarGiftAttributeOriginalDetails original_details_; + string title_; + UserId owner_user_id_; + int32 num_ = 0; + int32 unique_availability_issued_ = 0; + int32 unique_availability_total_ = 0; + friend bool operator==(const StarGift &lhs, const StarGift &rhs); friend StringBuilder &operator<<(StringBuilder &string_builder, const StarGift &star_gift); @@ -35,10 +50,15 @@ class StarGift { public: StarGift() = default; - StarGift(Td *td, telegram_api::object_ptr &&star_gift); + StarGift(Td *td, telegram_api::object_ptr &&star_gift_ptr, bool allow_unique_gift); bool is_valid() const { - return id_ != 0 && sticker_file_id_.is_valid(); + return id_ != 0 && (is_unique_ ? model_.is_valid() && pattern_.is_valid() && backdrop_.is_valid() + : sticker_file_id_.is_valid()); + } + + bool is_unique() const { + return is_unique_; } int64 get_id() const { @@ -46,11 +66,21 @@ class StarGift { } int64 get_star_count() const { + CHECK(!is_unique_); return star_count_; } + int64 get_upgrade_star_count() const { + CHECK(!is_unique_); + return upgrade_star_count_; + } + td_api::object_ptr get_gift_object(const Td *td) const; + td_api::object_ptr get_upgraded_gift_object(Td *td) const; + + td_api::object_ptr get_sent_gift_object(Td *td) const; + template void store(StorerT &storer) const; diff --git a/lib/tgchat/ext/td/td/telegram/StarGift.hpp b/lib/tgchat/ext/td/td/telegram/StarGift.hpp index 67293158..584d2ee7 100644 --- a/lib/tgchat/ext/td/td/telegram/StarGift.hpp +++ b/lib/tgchat/ext/td/td/telegram/StarGift.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,6 +8,7 @@ #include "td/telegram/Global.h" #include "td/telegram/StarGift.h" +#include "td/telegram/StarGiftAttribute.hpp" #include "td/telegram/StickersManager.h" #include "td/telegram/StickersManager.hpp" #include "td/telegram/Td.h" @@ -25,16 +26,25 @@ void StarGift::store(StorerT &storer) const { bool has_default_sell_star_count = default_sell_star_count_ != star_count_ * 85 / 100; bool has_first_sale_date = first_sale_date_ != 0; bool has_last_sale_date = last_sale_date_ != 0; + bool has_original_details = original_details_.is_valid(); + bool has_owner_user_id = owner_user_id_.is_valid(); + bool has_upgrade_star_count = upgrade_star_count_ != 0; BEGIN_STORE_FLAGS(); STORE_FLAG(is_limited); STORE_FLAG(has_default_sell_star_count); STORE_FLAG(has_first_sale_date); STORE_FLAG(has_last_sale_date); STORE_FLAG(is_for_birthday_); + STORE_FLAG(is_unique_); + STORE_FLAG(has_original_details); + STORE_FLAG(has_owner_user_id); + STORE_FLAG(has_upgrade_star_count); END_STORE_FLAGS(); td::store(id_, storer); - td->stickers_manager_->store_sticker(sticker_file_id_, false, storer, "StarGift"); - td::store(star_count_, storer); + if (!is_unique_) { + td->stickers_manager_->store_sticker(sticker_file_id_, false, storer, "StarGift"); + td::store(star_count_, storer); + } if (is_limited) { td::store(availability_remains_, storer); td::store(availability_total_, storer); @@ -48,6 +58,24 @@ void StarGift::store(StorerT &storer) const { if (has_last_sale_date) { td::store(last_sale_date_, storer); } + if (has_upgrade_star_count) { + td::store(upgrade_star_count_, storer); + } + if (is_unique_) { + td::store(model_, storer); + td::store(pattern_, storer); + td::store(backdrop_, storer); + if (has_original_details) { + td::store(original_details_, storer); + } + td::store(title_, storer); + if (has_owner_user_id) { + td::store(owner_user_id_, storer); + } + td::store(num_, storer); + td::store(unique_availability_issued_, storer); + td::store(unique_availability_total_, storer); + } } template @@ -57,16 +85,25 @@ void StarGift::parse(ParserT &parser) { bool has_default_sell_star_count; bool has_first_sale_date; bool has_last_sale_date; + bool has_original_details; + bool has_owner_user_id; + bool has_upgrade_star_count; BEGIN_PARSE_FLAGS(); PARSE_FLAG(is_limited); PARSE_FLAG(has_default_sell_star_count); PARSE_FLAG(has_first_sale_date); PARSE_FLAG(has_last_sale_date); PARSE_FLAG(is_for_birthday_); + PARSE_FLAG(is_unique_); + PARSE_FLAG(has_original_details); + PARSE_FLAG(has_owner_user_id); + PARSE_FLAG(has_upgrade_star_count); END_PARSE_FLAGS(); td::parse(id_, parser); - sticker_file_id_ = td->stickers_manager_->parse_sticker(false, parser); - td::parse(star_count_, parser); + if (!is_unique_) { + sticker_file_id_ = td->stickers_manager_->parse_sticker(false, parser); + td::parse(star_count_, parser); + } if (is_limited) { td::parse(availability_remains_, parser); td::parse(availability_total_, parser); @@ -82,6 +119,24 @@ void StarGift::parse(ParserT &parser) { if (has_last_sale_date) { td::parse(last_sale_date_, parser); } + if (has_upgrade_star_count) { + td::parse(upgrade_star_count_, parser); + } + if (is_unique_) { + td::parse(model_, parser); + td::parse(pattern_, parser); + td::parse(backdrop_, parser); + if (has_original_details) { + td::parse(original_details_, parser); + } + td::parse(title_, parser); + if (has_owner_user_id) { + td::parse(owner_user_id_, parser); + } + td::parse(num_, parser); + td::parse(unique_availability_issued_, parser); + td::parse(unique_availability_total_, parser); + } } } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.cpp b/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.cpp new file mode 100644 index 00000000..0a27b6bd --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.cpp @@ -0,0 +1,102 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/StarGiftAttribute.h" + +#include "td/telegram/StickerFormat.h" +#include "td/telegram/StickersManager.h" +#include "td/telegram/Td.h" +#include "td/telegram/UserManager.h" + +namespace td { + +StarGiftAttributeSticker::StarGiftAttributeSticker( + Td *td, telegram_api::object_ptr &&attribute) + : name_(std::move(attribute->name_)) + , sticker_file_id_(td->stickers_manager_ + ->on_get_sticker_document(std::move(attribute->document_), StickerFormat::Unknown, + "StarGiftAttributeSticker") + .second) + , rarity_permille_(attribute->rarity_permille_) { +} + +StarGiftAttributeSticker::StarGiftAttributeSticker( + Td *td, telegram_api::object_ptr &&attribute) + : name_(std::move(attribute->name_)) + , sticker_file_id_(td->stickers_manager_ + ->on_get_sticker_document(std::move(attribute->document_), StickerFormat::Unknown, + "StarGiftAttributeSticker") + .second) + , rarity_permille_(attribute->rarity_permille_) { +} + +td_api::object_ptr StarGiftAttributeSticker::get_upgraded_gift_model_object( + const Td *td) const { + CHECK(is_valid()); + return td_api::make_object( + name_, td->stickers_manager_->get_sticker_object(sticker_file_id_), rarity_permille_); +} + +td_api::object_ptr StarGiftAttributeSticker::get_upgraded_gift_symbol_object( + const Td *td) const { + CHECK(is_valid()); + return td_api::make_object( + name_, td->stickers_manager_->get_sticker_object(sticker_file_id_), rarity_permille_); +} + +bool operator==(const StarGiftAttributeSticker &lhs, const StarGiftAttributeSticker &rhs) { + return lhs.name_ == rhs.name_ && lhs.sticker_file_id_ == rhs.sticker_file_id_ && + lhs.rarity_permille_ == rhs.rarity_permille_; +} + +StarGiftAttributeBackdrop::StarGiftAttributeBackdrop( + telegram_api::object_ptr &&attribute) + : name_(std::move(attribute->name_)) + , center_color_(attribute->center_color_) + , edge_color_(attribute->edge_color_) + , pattern_color_(attribute->pattern_color_) + , text_color_(attribute->text_color_) + , rarity_permille_(attribute->rarity_permille_) { +} + +td_api::object_ptr StarGiftAttributeBackdrop::get_upgraded_gift_backdrop_object() const { + CHECK(is_valid()); + return td_api::make_object(name_, center_color_, edge_color_, pattern_color_, + text_color_, rarity_permille_); +} + +bool operator==(const StarGiftAttributeBackdrop &lhs, const StarGiftAttributeBackdrop &rhs) { + return lhs.name_ == rhs.name_ && lhs.center_color_ == rhs.center_color_ && lhs.edge_color_ == rhs.edge_color_ && + lhs.pattern_color_ == rhs.pattern_color_ && lhs.text_color_ == rhs.text_color_ && + lhs.rarity_permille_ == rhs.rarity_permille_; +} + +StarGiftAttributeOriginalDetails::StarGiftAttributeOriginalDetails( + Td *td, telegram_api::object_ptr &&attribute) + : sender_user_id_(attribute->sender_id_) + , receiver_user_id_(attribute->recipient_id_) + , date_(attribute->date_) + , message_(get_formatted_text(td->user_manager_.get(), std::move(attribute->message_), true, false, + "starGiftAttributeBackdrop")) { +} + +td_api::object_ptr +StarGiftAttributeOriginalDetails::get_upgraded_gift_original_details_object(Td *td) const { + if (!is_valid()) { + return nullptr; + } + return td_api::make_object( + td->user_manager_->get_user_id_object(sender_user_id_, "upgradedGiftOriginalDetails sender"), + td->user_manager_->get_user_id_object(receiver_user_id_, "upgradedGiftOriginalDetails receiver"), + get_formatted_text_object(td->user_manager_.get(), message_, true, -1), date_); +} + +bool operator==(const StarGiftAttributeOriginalDetails &lhs, const StarGiftAttributeOriginalDetails &rhs) { + return lhs.sender_user_id_ == rhs.sender_user_id_ && lhs.receiver_user_id_ == rhs.receiver_user_id_ && + lhs.date_ == rhs.date_ && lhs.message_ == rhs.message_; +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.h b/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.h new file mode 100644 index 00000000..73ce2caa --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.h @@ -0,0 +1,129 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/files/FileId.h" +#include "td/telegram/MessageEntity.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" +#include "td/telegram/UserId.h" + +#include "td/utils/common.h" +#include "td/utils/StringBuilder.h" + +namespace td { + +class Td; + +class StarGiftAttributeSticker { + string name_; + FileId sticker_file_id_; + int32 rarity_permille_ = 0; + + friend bool operator==(const StarGiftAttributeSticker &lhs, const StarGiftAttributeSticker &rhs); + + public: + StarGiftAttributeSticker() = default; + + StarGiftAttributeSticker(Td *td, telegram_api::object_ptr &&attribute); + + StarGiftAttributeSticker(Td *td, telegram_api::object_ptr &&attribute); + + bool is_valid() const { + return 0 < rarity_permille_ && rarity_permille_ <= 1000 && sticker_file_id_.is_valid(); + } + + td_api::object_ptr get_upgraded_gift_model_object(const Td *td) const; + + td_api::object_ptr get_upgraded_gift_symbol_object(const Td *td) const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); +}; + +bool operator==(const StarGiftAttributeSticker &lhs, const StarGiftAttributeSticker &rhs); + +inline bool operator!=(const StarGiftAttributeSticker &lhs, const StarGiftAttributeSticker &rhs) { + return !(lhs == rhs); +} + +class StarGiftAttributeBackdrop { + string name_; + int32 center_color_ = 0; + int32 edge_color_ = 0; + int32 pattern_color_ = 0; + int32 text_color_ = 0; + int32 rarity_permille_ = 0; + + friend bool operator==(const StarGiftAttributeBackdrop &lhs, const StarGiftAttributeBackdrop &rhs); + + bool is_valid_color(int32 color) const { + return 0 <= color && color <= 0xFFFFFF; + } + + public: + StarGiftAttributeBackdrop() = default; + + explicit StarGiftAttributeBackdrop(telegram_api::object_ptr &&attribute); + + bool is_valid() const { + return 0 < rarity_permille_ && rarity_permille_ <= 1000 && is_valid_color(center_color_) && + is_valid_color(edge_color_) && is_valid_color(pattern_color_) && is_valid_color(text_color_); + } + + td_api::object_ptr get_upgraded_gift_backdrop_object() const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); +}; + +bool operator==(const StarGiftAttributeBackdrop &lhs, const StarGiftAttributeBackdrop &rhs); + +inline bool operator!=(const StarGiftAttributeBackdrop &lhs, const StarGiftAttributeBackdrop &rhs) { + return !(lhs == rhs); +} + +class StarGiftAttributeOriginalDetails { + UserId sender_user_id_; + UserId receiver_user_id_; + int32 date_ = 0; + FormattedText message_; + + friend bool operator==(const StarGiftAttributeOriginalDetails &lhs, const StarGiftAttributeOriginalDetails &rhs); + + public: + StarGiftAttributeOriginalDetails() = default; + + StarGiftAttributeOriginalDetails( + Td *td, telegram_api::object_ptr &&attribute); + + bool is_valid() const { + return (sender_user_id_ == UserId() || sender_user_id_.is_valid()) && receiver_user_id_.is_valid() && date_ > 0; + } + + td_api::object_ptr get_upgraded_gift_original_details_object(Td *td) const; + + template + void store(StorerT &storer) const; + + template + void parse(ParserT &parser); +}; + +bool operator==(const StarGiftAttributeOriginalDetails &lhs, const StarGiftAttributeOriginalDetails &rhs); + +inline bool operator!=(const StarGiftAttributeOriginalDetails &lhs, const StarGiftAttributeOriginalDetails &rhs) { + return !(lhs == rhs); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.hpp b/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.hpp new file mode 100644 index 00000000..9b76dade --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/StarGiftAttribute.hpp @@ -0,0 +1,102 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/StarGiftAttribute.h" +#include "td/telegram/StickersManager.h" +#include "td/telegram/StickersManager.hpp" +#include "td/telegram/Td.h" + +#include "td/utils/common.h" +#include "td/utils/tl_helpers.h" + +namespace td { + +template +void StarGiftAttributeSticker::store(StorerT &storer) const { + CHECK(is_valid()); + Td *td = storer.context()->td().get_actor_unsafe(); + BEGIN_STORE_FLAGS(); + END_STORE_FLAGS(); + td::store(name_, storer); + td->stickers_manager_->store_sticker(sticker_file_id_, false, storer, "StarGiftAttributeSticker"); + td::store(rarity_permille_, storer); +} + +template +void StarGiftAttributeSticker::parse(ParserT &parser) { + Td *td = parser.context()->td().get_actor_unsafe(); + BEGIN_PARSE_FLAGS(); + END_PARSE_FLAGS(); + td::parse(name_, parser); + sticker_file_id_ = td->stickers_manager_->parse_sticker(false, parser); + td::parse(rarity_permille_, parser); +} + +template +void StarGiftAttributeBackdrop::store(StorerT &storer) const { + CHECK(is_valid()); + BEGIN_STORE_FLAGS(); + END_STORE_FLAGS(); + td::store(name_, storer); + td::store(center_color_, storer); + td::store(edge_color_, storer); + td::store(pattern_color_, storer); + td::store(text_color_, storer); + td::store(rarity_permille_, storer); +} + +template +void StarGiftAttributeBackdrop::parse(ParserT &parser) { + BEGIN_PARSE_FLAGS(); + END_PARSE_FLAGS(); + td::parse(name_, parser); + td::parse(center_color_, parser); + td::parse(edge_color_, parser); + td::parse(pattern_color_, parser); + td::parse(text_color_, parser); + td::parse(rarity_permille_, parser); +} + +template +void StarGiftAttributeOriginalDetails::store(StorerT &storer) const { + CHECK(is_valid()); + bool has_sender_user_id = sender_user_id_.is_valid(); + bool has_message = !message_.text.empty(); + BEGIN_STORE_FLAGS(); + STORE_FLAG(has_sender_user_id); + STORE_FLAG(has_message); + END_STORE_FLAGS(); + if (has_sender_user_id) { + td::store(sender_user_id_, storer); + } + td::store(receiver_user_id_, storer); + td::store(date_, storer); + if (has_message) { + td::store(message_, storer); + } +} + +template +void StarGiftAttributeOriginalDetails::parse(ParserT &parser) { + bool has_sender_user_id; + bool has_message; + BEGIN_PARSE_FLAGS(); + PARSE_FLAG(has_sender_user_id); + PARSE_FLAG(has_message); + END_PARSE_FLAGS(); + if (has_sender_user_id) { + td::parse(sender_user_id_, parser); + } + td::parse(receiver_user_id_, parser); + td::parse(date_, parser); + if (has_message) { + td::parse(message_, parser); + } +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarGiftManager.cpp b/lib/tgchat/ext/td/td/telegram/StarGiftManager.cpp index 4a41c9ec..1d6d1c8a 100644 --- a/lib/tgchat/ext/td/td/telegram/StarGiftManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StarGiftManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,20 +7,26 @@ #include "td/telegram/StarGiftManager.h" #include "td/telegram/AuthManager.h" +#include "td/telegram/DialogId.h" #include "td/telegram/DialogManager.h" #include "td/telegram/Global.h" #include "td/telegram/MessageEntity.h" #include "td/telegram/MessageQuote.h" -#include "td/telegram/ServerMessageId.h" +#include "td/telegram/MessagesManager.h" +#include "td/telegram/OnlineManager.h" #include "td/telegram/StarGift.h" +#include "td/telegram/StarGiftAttribute.h" #include "td/telegram/StarManager.h" +#include "td/telegram/StateManager.h" #include "td/telegram/Td.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UpdatesManager.h" #include "td/telegram/UserManager.h" +#include "td/telegram/UserStarGift.h" #include "td/utils/buffer.h" #include "td/utils/logging.h" +#include "td/utils/Random.h" #include "td/utils/Status.h" namespace td { @@ -50,22 +56,15 @@ class GetStarGiftsQuery final : public Td::ResultHandler { } auto results = telegram_api::move_object_as(ptr); vector> options; - FlatHashMap gift_prices; for (auto &gift : results->gifts_) { - StarGift star_gift(td_, std::move(gift)); + StarGift star_gift(td_, std::move(gift), false); if (!star_gift.is_valid()) { continue; } - auto gift_id = star_gift.get_id(); - if (gift_prices.count(gift_id) != 0) { - LOG(ERROR) << "Receive again gift " << gift_id; - continue; - } - gift_prices[gift_id] = star_gift.get_star_count(); + td_->star_gift_manager_->on_get_star_gift(star_gift, true); options.push_back(star_gift.get_gift_object(td_)); } - td_->star_gift_manager_->on_get_gift_prices(std::move(gift_prices)); promise_.set_value(td_api::make_object(std::move(options))); } @@ -176,9 +175,9 @@ class ConvertStarGiftQuery final : public Td::ResultHandler { explicit ConvertStarGiftQuery(Promise &&promise) : promise_(std::move(promise)) { } - void send(telegram_api::object_ptr input_user, MessageId message_id) { + void send(MessageId message_id) { send_query(G()->net_query_creator().create( - telegram_api::payments_convertStarGift(std::move(input_user), message_id.get_server_message_id().get()))); + telegram_api::payments_convertStarGift(message_id.get_server_message_id().get()))); } void on_result(BufferSlice packet) final { @@ -203,14 +202,14 @@ class SaveStarGiftQuery final : public Td::ResultHandler { explicit SaveStarGiftQuery(Promise &&promise) : promise_(std::move(promise)) { } - void send(telegram_api::object_ptr input_user, MessageId message_id, bool is_saved) { + void send(MessageId message_id, bool is_saved) { is_saved_ = is_saved; int32 flags = 0; if (!is_saved) { flags |= telegram_api::payments_saveStarGift::UNSAVE_MASK; } - send_query(G()->net_query_creator().create(telegram_api::payments_saveStarGift( - flags, false /*ignored*/, std::move(input_user), message_id.get_server_message_id().get()))); + send_query(G()->net_query_creator().create( + telegram_api::payments_saveStarGift(flags, false /*ignored*/, message_id.get_server_message_id().get()))); } void on_result(BufferSlice packet) final { @@ -228,6 +227,360 @@ class SaveStarGiftQuery final : public Td::ResultHandler { } }; +class GetUpgradeGiftPreviewQuery final : public Td::ResultHandler { + Promise> promise_; + + public: + explicit GetUpgradeGiftPreviewQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(int64 gift_id) { + send_query(G()->net_query_creator().create(telegram_api::payments_getStarGiftUpgradePreview(gift_id))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for GetUpgradeGiftPreviewQuery: " << to_string(ptr); + auto result = td_api::make_object(); + for (auto &attribute : ptr->sample_attributes_) { + switch (attribute->get_id()) { + case telegram_api::starGiftAttributeModel::ID: { + auto model = StarGiftAttributeSticker( + td_, telegram_api::move_object_as(attribute)); + if (!model.is_valid()) { + LOG(ERROR) << "Receive invalid model"; + } else { + result->models_.push_back(model.get_upgraded_gift_model_object(td_)); + } + break; + } + case telegram_api::starGiftAttributePattern::ID: { + auto pattern = StarGiftAttributeSticker( + td_, telegram_api::move_object_as(attribute)); + if (!pattern.is_valid()) { + LOG(ERROR) << "Receive invalid symbol"; + } else { + result->symbols_.push_back(pattern.get_upgraded_gift_symbol_object(td_)); + } + break; + } + case telegram_api::starGiftAttributeBackdrop::ID: { + auto backdrop = StarGiftAttributeBackdrop( + telegram_api::move_object_as(attribute)); + if (!backdrop.is_valid()) { + LOG(ERROR) << "Receive invalid backdrop"; + } else { + result->backdrops_.push_back(backdrop.get_upgraded_gift_backdrop_object()); + } + break; + } + case telegram_api::starGiftAttributeOriginalDetails::ID: + LOG(ERROR) << "Receive unexpected original details"; + break; + default: + UNREACHABLE(); + } + } + promise_.set_value(std::move(result)); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +static Promise get_gift_upgrade_promise(Td *td, const telegram_api::object_ptr &updates, + Promise> &&promise) { + vector> new_messages = UpdatesManager::get_new_messages(updates.get()); + if (new_messages.size() != 1u || new_messages[0].second || + new_messages[0].first->get_id() != telegram_api::messageService::ID) { + promise.set_error(Status::Error(500, "Receive invalid server response")); + return Auto(); + } + auto message = static_cast(new_messages[0].first); + if (message->action_->get_id() != telegram_api::messageActionStarGiftUnique::ID) { + promise.set_error(Status::Error(500, "Receive invalid server response")); + return Auto(); + } + auto action = static_cast(message->action_.get()); + if (!action->upgrade_ || action->transferred_ || action->refunded_ || + action->gift_->get_id() != telegram_api::starGiftUnique::ID) { + promise.set_error(Status::Error(500, "Receive invalid server response")); + return Auto(); + } + auto message_full_id = MessageFullId::get_message_full_id(new_messages[0].first, false); + return PromiseCreator::lambda([message_full_id, promise = std::move(promise)](Result result) mutable { + if (result.is_error()) { + return promise.set_error(result.move_as_error()); + } + send_closure(G()->messages_manager(), &MessagesManager::finish_gift_upgrade, message_full_id, std::move(promise)); + }); +} + +class UpgradeStarGiftQuery final : public Td::ResultHandler { + Promise> promise_; + + public: + explicit UpgradeStarGiftQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(telegram_api::object_ptr input_user, MessageId message_id, int64 star_count, + bool keep_original_details) { + int32 flags = 0; + if (keep_original_details) { + flags |= telegram_api::payments_upgradeStarGift::KEEP_ORIGINAL_DETAILS_MASK; + } + send_query(G()->net_query_creator().create( + telegram_api::payments_upgradeStarGift(flags, false /*ignored*/, message_id.get_server_message_id().get()))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for UpgradeStarGiftQuery: " << to_string(ptr); + auto promise = get_gift_upgrade_promise(td_, ptr, std::move(promise_)); + td_->updates_manager_->on_get_updates(std::move(ptr), std::move(promise)); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +class UpgradeGiftQuery final : public Td::ResultHandler { + Promise> promise_; + int64 star_count_; + + public: + explicit UpgradeGiftQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(telegram_api::object_ptr input_invoice, int64 payment_form_id, + int64 star_count) { + star_count_ = star_count; + send_query(G()->net_query_creator().create( + telegram_api::payments_sendStarsForm(payment_form_id, std::move(input_invoice)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto payment_result = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for UpgradeGiftQuery: " << to_string(payment_result); + switch (payment_result->get_id()) { + case telegram_api::payments_paymentResult::ID: { + auto result = telegram_api::move_object_as(payment_result); + td_->star_manager_->add_pending_owned_star_count(star_count_, true); + auto promise = get_gift_upgrade_promise(td_, result->updates_, std::move(promise_)); + td_->updates_manager_->on_get_updates(std::move(result->updates_), std::move(promise)); + break; + } + case telegram_api::payments_paymentVerificationNeeded::ID: + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + LOG(ERROR) << "Receive " << to_string(payment_result); + break; + default: + UNREACHABLE(); + } + } + + void on_error(Status status) final { + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + promise_.set_error(std::move(status)); + } +}; + +class GetGiftUpgradePaymentFormQuery final : public Td::ResultHandler { + Promise> promise_; + int64 star_count_; + telegram_api::object_ptr upgrade_input_invoice_; + + public: + explicit GetGiftUpgradePaymentFormQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(telegram_api::object_ptr input_invoice, + telegram_api::object_ptr upgrade_input_invoice, + int64 star_count) { + upgrade_input_invoice_ = std::move(upgrade_input_invoice); + star_count_ = star_count; + td_->star_manager_->add_pending_owned_star_count(-star_count, false); + send_query( + G()->net_query_creator().create(telegram_api::payments_getPaymentForm(0, std::move(input_invoice), nullptr))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto payment_form_ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for GetGiftUpgradePaymentFormQuery: " << to_string(payment_form_ptr); + switch (payment_form_ptr->get_id()) { + case telegram_api::payments_paymentForm::ID: + case telegram_api::payments_paymentFormStars::ID: + LOG(ERROR) << "Receive " << to_string(payment_form_ptr); + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + promise_.set_error(Status::Error(500, "Unsupported")); + break; + case telegram_api::payments_paymentFormStarGift::ID: { + auto payment_form = static_cast(payment_form_ptr.get()); + td_->create_handler(std::move(promise_)) + ->send(std::move(upgrade_input_invoice_), payment_form->form_id_, star_count_); + break; + } + default: + UNREACHABLE(); + } + } + + void on_error(Status status) final { + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + promise_.set_error(std::move(status)); + } +}; + +class TransferStarGiftQuery final : public Td::ResultHandler { + Promise promise_; + + public: + explicit TransferStarGiftQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(MessageId message_id, telegram_api::object_ptr receiver_input_user) { + send_query(G()->net_query_creator().create(telegram_api::payments_transferStarGift( + message_id.get_server_message_id().get(), std::move(receiver_input_user)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for TransferStarGiftQuery: " << to_string(ptr); + td_->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_)); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + +class TransferGiftQuery final : public Td::ResultHandler { + Promise promise_; + int64 star_count_; + + public: + explicit TransferGiftQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(telegram_api::object_ptr input_invoice, int64 payment_form_id, + int64 star_count) { + star_count_ = star_count; + send_query(G()->net_query_creator().create( + telegram_api::payments_sendStarsForm(payment_form_id, std::move(input_invoice)))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto payment_result = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for TransferGiftQuery: " << to_string(payment_result); + switch (payment_result->get_id()) { + case telegram_api::payments_paymentResult::ID: { + auto result = telegram_api::move_object_as(payment_result); + td_->star_manager_->add_pending_owned_star_count(star_count_, true); + td_->updates_manager_->on_get_updates(std::move(result->updates_), std::move(promise_)); + break; + } + case telegram_api::payments_paymentVerificationNeeded::ID: + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + LOG(ERROR) << "Receive " << to_string(payment_result); + break; + default: + UNREACHABLE(); + } + } + + void on_error(Status status) final { + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + promise_.set_error(std::move(status)); + } +}; + +class GetGiftTransferPaymentFormQuery final : public Td::ResultHandler { + Promise promise_; + int64 star_count_; + telegram_api::object_ptr transfer_input_invoice_; + + public: + explicit GetGiftTransferPaymentFormQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(telegram_api::object_ptr input_invoice, + telegram_api::object_ptr transfer_input_invoice, + int64 star_count) { + transfer_input_invoice_ = std::move(transfer_input_invoice); + star_count_ = star_count; + td_->star_manager_->add_pending_owned_star_count(-star_count, false); + send_query( + G()->net_query_creator().create(telegram_api::payments_getPaymentForm(0, std::move(input_invoice), nullptr))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto payment_form_ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for GetGiftTransferPaymentFormQuery: " << to_string(payment_form_ptr); + switch (payment_form_ptr->get_id()) { + case telegram_api::payments_paymentForm::ID: + case telegram_api::payments_paymentFormStars::ID: + LOG(ERROR) << "Receive " << to_string(payment_form_ptr); + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + promise_.set_error(Status::Error(500, "Unsupported")); + break; + case telegram_api::payments_paymentFormStarGift::ID: { + auto payment_form = static_cast(payment_form_ptr.get()); + td_->create_handler(std::move(promise_)) + ->send(std::move(transfer_input_invoice_), payment_form->form_id_, star_count_); + break; + } + default: + UNREACHABLE(); + } + } + + void on_error(Status status) final { + td_->star_manager_->add_pending_owned_star_count(star_count_, false); + promise_.set_error(std::move(status)); + } +}; + class GetUserGiftsQuery final : public Td::ResultHandler { Promise> promise_; UserId user_id_; @@ -261,35 +614,12 @@ class GetUserGiftsQuery final : public Td::ResultHandler { bool is_me = user_id_ == td_->user_manager_->get_my_id(); vector> gifts; for (auto &gift : ptr->gifts_) { - UserId sender_user_id(gift->from_id_); - if (sender_user_id != UserId() && !sender_user_id.is_valid()) { - LOG(ERROR) << "Receive " << sender_user_id << " as sender of a gift"; - sender_user_id = UserId(); - } - if (sender_user_id == UserId() && !gift->name_hidden_) { - LOG(ERROR) << "Receive a gift without a sender"; + UserStarGift user_gift(td_, std::move(gift), is_me); + if (!user_gift.is_valid()) { + LOG(ERROR) << "Receive invalid user gift"; continue; } - if (gift->unsaved_ && !is_me) { - LOG(ERROR) << "Receive unsaved gift for " << user_id_; - gift->unsaved_ = false; - } - StarGift star_gift(td_, std::move(gift->gift_)); - if (!star_gift.is_valid()) { - continue; - } - FormattedText text = - get_formatted_text(td_->user_manager_.get(), std::move(gift->message_), true, false, "userStarGift"); - auto message_id = MessageId(ServerMessageId(gift->msg_id_)); - if (message_id != MessageId() && !message_id.is_valid()) { - LOG(ERROR) << "Receive " << message_id; - message_id = MessageId(); - } - gifts.push_back(td_api::make_object( - td_->user_manager_->get_user_id_object(sender_user_id, "userGift"), - get_formatted_text_object(td_->user_manager_.get(), text, true, -1), gift->name_hidden_, !gift->unsaved_, - gift->date_, star_gift.get_gift_object(td_), message_id.get(), - StarManager::get_star_count(gift->convert_stars_))); + gifts.push_back(user_gift.get_user_gift_object(td_)); } if (!is_me) { td_->user_manager_->on_update_user_gift_count(user_id_, total_count); @@ -302,7 +632,73 @@ class GetUserGiftsQuery final : public Td::ResultHandler { } }; +class GetUserStarGiftQuery final : public Td::ResultHandler { + Promise> promise_; + + public: + explicit GetUserStarGiftQuery(Promise> &&promise) + : promise_(std::move(promise)) { + } + + void send(MessageId message_id) { + send_query(G()->net_query_creator().create( + telegram_api::payments_getUserStarGift({message_id.get_server_message_id().get()}))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for GetUserStarGiftQuery: " << to_string(ptr); + + for (auto &gift : ptr->gifts_) { + UserStarGift user_gift(td_, std::move(gift), true); + if (!user_gift.is_valid()) { + LOG(ERROR) << "Receive invalid user gift"; + continue; + } + return promise_.set_value(user_gift.get_user_gift_object(td_)); + } + promise_.set_error(Status::Error(400, "Gift not found")); + } + + void on_error(Status status) final { + promise_.set_error(std::move(status)); + } +}; + StarGiftManager::StarGiftManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { + update_gift_message_timeout_.set_callback(on_update_gift_message_timeout_callback); + update_gift_message_timeout_.set_callback_data(static_cast(this)); +} + +StarGiftManager::~StarGiftManager() { + Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), gift_full_message_ids_, + gift_full_message_ids_by_id_, being_reloaded_gift_messages_, + user_gift_infos_); +} + +void StarGiftManager::start_up() { + if (!td_->auth_manager_->is_bot()) { + class StateCallback final : public StateManager::Callback { + public: + explicit StateCallback(ActorId parent) : parent_(std::move(parent)) { + } + bool on_online(bool is_online) final { + if (is_online) { + send_closure(parent_, &StarGiftManager::on_online); + } + return parent_.is_alive(); + } + + private: + ActorId parent_; + }; + send_closure(G()->state_manager(), &StateManager::add_callback, make_unique(actor_id(this))); + } } void StarGiftManager::tear_down() { @@ -313,22 +709,35 @@ void StarGiftManager::get_gift_payment_options(Promisecreate_handler(std::move(promise))->send(); } -void StarGiftManager::on_get_gift_prices(FlatHashMap gift_prices) { - if (td_->auth_manager_->is_bot()) { +void StarGiftManager::on_get_star_gift(const StarGift &star_gift, bool from_server) { + if (td_->auth_manager_->is_bot() || !star_gift.is_valid() || star_gift.is_unique()) { + return; + } + if (!from_server && gift_prices_.count(star_gift.get_id())) { return; } - gift_prices_ = std::move(gift_prices); + gift_prices_[star_gift.get_id()] = {star_gift.get_star_count(), star_gift.get_upgrade_star_count()}; +} + +void StarGiftManager::on_get_user_star_gift(MessageFullId message_full_id, bool can_upgrade, int64 upgrade_star_count) { + UserStarGiftInfo info; + info.can_upgrade_ = can_upgrade; + info.upgrade_star_count_ = upgrade_star_count; + user_gift_infos_.set(message_full_id, info); } void StarGiftManager::send_gift(int64 gift_id, UserId user_id, td_api::object_ptr text, - bool is_private, Promise &&promise) { + bool is_private, bool pay_for_upgrade, Promise &&promise) { int64 star_count = 0; if (!td_->auth_manager_->is_bot()) { auto it = gift_prices_.find(gift_id); if (it == gift_prices_.end()) { return promise.set_error(Status::Error(400, "Gift not found")); } - star_count = it->second; + star_count = it->second.first; + if (pay_for_upgrade) { + star_count += it->second.second; + } if (!td_->star_manager_->has_owned_star_count(star_count)) { return promise.set_error(Status::Error(400, "Have not enough Telegram Stars")); } @@ -343,10 +752,14 @@ void StarGiftManager::send_gift(int64 gift_id, UserId user_id, td_api::object_pt if (is_private) { flags |= telegram_api::inputInvoiceStarGift::HIDE_NAME_MASK; } + if (pay_for_upgrade) { + flags |= telegram_api::inputInvoiceStarGift::INCLUDE_UPGRADE_MASK; + } auto input_invoice = telegram_api::make_object( - flags, false /*ignored*/, std::move(input_user), gift_id, nullptr); + flags, false /*ignored*/, false /*ignored*/, std::move(input_user), gift_id, nullptr); auto send_input_invoice = telegram_api::make_object( - flags, false /*ignored*/, td_->user_manager_->get_input_user(user_id).move_as_ok(), gift_id, nullptr); + flags, false /*ignored*/, false /*ignored*/, td_->user_manager_->get_input_user(user_id).move_as_ok(), gift_id, + nullptr); if (!message.text.empty()) { input_invoice->flags_ |= telegram_api::inputInvoiceStarGift::MESSAGE_MASK; input_invoice->message_ = get_input_text_with_entities(td_->user_manager_.get(), message, "send_gift"); @@ -363,7 +776,7 @@ void StarGiftManager::convert_gift(UserId user_id, MessageId message_id, Promise if (!message_id.is_valid() || !message_id.is_server()) { return promise.set_error(Status::Error(400, "Invalid message identifier specified")); } - td_->create_handler(std::move(promise))->send(std::move(input_user), message_id); + td_->create_handler(std::move(promise))->send(message_id); } void StarGiftManager::save_gift(UserId user_id, MessageId message_id, bool is_saved, Promise &&promise) { @@ -371,7 +784,75 @@ void StarGiftManager::save_gift(UserId user_id, MessageId message_id, bool is_sa if (!message_id.is_valid() || !message_id.is_server()) { return promise.set_error(Status::Error(400, "Invalid message identifier specified")); } - td_->create_handler(std::move(promise))->send(std::move(input_user), message_id, is_saved); + td_->create_handler(std::move(promise))->send(message_id, is_saved); +} + +void StarGiftManager::get_gift_upgrade_preview(int64 gift_id, + Promise> &&promise) { + td_->create_handler(std::move(promise))->send(gift_id); +} + +void StarGiftManager::upgrade_gift(UserId user_id, MessageId message_id, bool keep_original_details, + Promise> &&promise) { + TRY_RESULT_PROMISE(promise, input_user, td_->user_manager_->get_input_user(user_id)); + if (!message_id.is_valid() || !message_id.is_server()) { + return promise.set_error(Status::Error(400, "Invalid message identifier specified")); + } + auto message_full_id = MessageFullId{DialogId(user_id), message_id}; + auto star_count = td_->messages_manager_->get_message_gift_upgrade_star_count(message_full_id); + if (star_count < 0) { + if (user_gift_infos_.count(message_full_id) == 0) { + return promise.set_error(Status::Error(400, "Gift not found")); + } + auto info = user_gift_infos_.get(message_full_id); + if (!info.can_upgrade_) { + return promise.set_error(Status::Error(400, "Gift can't be upgraded")); + } + star_count = info.upgrade_star_count_; + } + if (star_count != 0) { + if (!td_->star_manager_->has_owned_star_count(star_count)) { + return promise.set_error(Status::Error(400, "Have not enough Telegram Stars")); + } + int32 flags = 0; + if (keep_original_details) { + flags |= telegram_api::inputInvoiceStarGiftUpgrade::KEEP_ORIGINAL_DETAILS_MASK; + } + auto input_invoice = telegram_api::make_object( + flags, false /*ignored*/, message_id.get_server_message_id().get()); + auto upgrade_input_invoice = telegram_api::make_object( + flags, false /*ignored*/, message_id.get_server_message_id().get()); + td_->create_handler(std::move(promise)) + ->send(std::move(input_invoice), std::move(upgrade_input_invoice), star_count); + } else { + td_->create_handler(std::move(promise)) + ->send(std::move(input_user), message_id, star_count, keep_original_details); + } +} + +void StarGiftManager::transfer_gift(UserId user_id, MessageId message_id, UserId receiver_user_id, int64 star_count, + Promise &&promise) { + TRY_RESULT_PROMISE(promise, input_user, td_->user_manager_->get_input_user(user_id)); + TRY_RESULT_PROMISE(promise, receiver_input_user, td_->user_manager_->get_input_user(receiver_user_id)); + if (!message_id.is_valid() || !message_id.is_server()) { + return promise.set_error(Status::Error(400, "Invalid message identifier specified")); + } + if (star_count < 0) { + return promise.set_error(Status::Error(400, "Invalid amount of Telegram Stars specified")); + } + if (star_count != 0) { + if (!td_->star_manager_->has_owned_star_count(star_count)) { + return promise.set_error(Status::Error(400, "Have not enough Telegram Stars")); + } + auto input_invoice = telegram_api::make_object( + message_id.get_server_message_id().get(), std::move(receiver_input_user)); + auto transfer_input_invoice = telegram_api::make_object( + message_id.get_server_message_id().get(), td_->user_manager_->get_input_user(receiver_user_id).move_as_ok()); + td_->create_handler(std::move(promise)) + ->send(std::move(input_invoice), std::move(transfer_input_invoice), star_count); + } else { + td_->create_handler(std::move(promise))->send(message_id, std::move(receiver_input_user)); + } } void StarGiftManager::get_user_gifts(UserId user_id, const string &offset, int32 limit, @@ -383,4 +864,107 @@ void StarGiftManager::get_user_gifts(UserId user_id, const string &offset, int32 td_->create_handler(std::move(promise))->send(user_id, std::move(input_user), offset, limit); } +void StarGiftManager::get_user_gift(MessageId message_id, Promise> &&promise) { + if (!message_id.is_valid() || !message_id.is_server()) { + return promise.set_error(Status::Error(400, "Invalid message identifier specified")); + } + td_->create_handler(std::move(promise))->send(message_id); +} + +void StarGiftManager::register_gift(MessageFullId message_full_id, const char *source) { + auto message_id = message_full_id.get_message_id(); + if (message_id.is_scheduled()) { + return; + } + CHECK(!td_->auth_manager_->is_bot()); + CHECK(message_id.is_valid()); + CHECK(message_id.is_server()); + LOG(INFO) << "Register gift in " << message_full_id << " from " << source; + auto gift_message_number = ++gift_message_count_; + gift_full_message_ids_.set(message_full_id, gift_message_number); + gift_full_message_ids_by_id_.set(gift_message_number, message_full_id); + update_gift_message_timeout_.add_timeout_in(gift_message_number, 0); +} + +void StarGiftManager::unregister_gift(MessageFullId message_full_id, const char *source) { + auto message_id = message_full_id.get_message_id(); + if (message_id.is_scheduled()) { + return; + } + CHECK(!td_->auth_manager_->is_bot()); + CHECK(message_id.is_valid()); + CHECK(message_id.is_server()); + LOG(INFO) << "Unregister gift in " << message_full_id << " from " << source; + auto message_number = gift_full_message_ids_[message_full_id]; + LOG_CHECK(message_number != 0) << source << ' ' << message_full_id; + gift_full_message_ids_by_id_.erase(message_number); + if (!G()->close_flag()) { + update_gift_message_timeout_.cancel_timeout(message_number); + } + gift_full_message_ids_.erase(message_full_id); +} + +double StarGiftManager::get_gift_message_polling_timeout() const { + double result = td_->online_manager_->is_online() ? 60 : 30 * 60; + return result * Random::fast(70, 100) * 0.01; +} + +void StarGiftManager::on_online() { + if (td_->auth_manager_->is_bot()) { + return; + } + + gift_full_message_ids_.foreach([&](MessageFullId, int64 message_number) { + if (update_gift_message_timeout_.has_timeout(message_number)) { + update_gift_message_timeout_.set_timeout_in(message_number, Random::fast(3, 30)); + } + }); +} + +void StarGiftManager::on_update_gift_message_timeout_callback(void *star_gift_manager_ptr, int64 message_number) { + if (G()->close_flag()) { + return; + } + + auto star_gift_manager = static_cast(star_gift_manager_ptr); + send_closure_later(star_gift_manager->actor_id(star_gift_manager), &StarGiftManager::on_update_gift_message_timeout, + message_number); +} + +void StarGiftManager::on_update_gift_message_timeout(int64 message_number) { + if (G()->close_flag()) { + return; + } + CHECK(!td_->auth_manager_->is_bot()); + auto message_full_id = gift_full_message_ids_by_id_.get(message_number); + if (message_full_id.get_message_id() == MessageId()) { + return; + } + if (!being_reloaded_gift_messages_.insert(message_full_id).second) { + return; + } + LOG(INFO) << "Fetching gift from " << message_full_id; + auto promise = PromiseCreator::lambda([actor_id = actor_id(this), message_full_id](Unit result) { + send_closure(actor_id, &StarGiftManager::on_update_gift_message, message_full_id); + }); + td_->messages_manager_->get_message_from_server(message_full_id, std::move(promise), + "on_update_gift_message_timeout"); +} + +void StarGiftManager::on_update_gift_message(MessageFullId message_full_id) { + if (G()->close_flag()) { + return; + } + auto is_erased = being_reloaded_gift_messages_.erase(message_full_id) > 0; + CHECK(is_erased); + auto message_number = gift_full_message_ids_.get(message_full_id); + if (message_number == 0) { + return; + } + + auto timeout = get_gift_message_polling_timeout(); + LOG(INFO) << "Schedule updating of gift in " << message_full_id << " in " << timeout; + update_gift_message_timeout_.add_timeout_in(message_number, timeout); +} + } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarGiftManager.h b/lib/tgchat/ext/td/td/telegram/StarGiftManager.h index 5b39a24b..309b0e89 100644 --- a/lib/tgchat/ext/td/td/telegram/StarGiftManager.h +++ b/lib/tgchat/ext/td/td/telegram/StarGiftManager.h @@ -1,50 +1,102 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once +#include "td/telegram/MessageFullId.h" #include "td/telegram/MessageId.h" #include "td/telegram/td_api.h" #include "td/telegram/UserId.h" #include "td/actor/actor.h" +#include "td/actor/MultiTimeout.h" #include "td/utils/common.h" #include "td/utils/FlatHashMap.h" +#include "td/utils/FlatHashSet.h" #include "td/utils/Promise.h" +#include "td/utils/WaitFreeHashMap.h" + +#include namespace td { +class StarGift; class Td; class StarGiftManager final : public Actor { public: StarGiftManager(Td *td, ActorShared<> parent); + StarGiftManager(const StarGiftManager &) = delete; + StarGiftManager &operator=(const StarGiftManager &) = delete; + StarGiftManager(StarGiftManager &&) = delete; + StarGiftManager &operator=(StarGiftManager &&) = delete; + ~StarGiftManager() final; void get_gift_payment_options(Promise> &&promise); - void on_get_gift_prices(FlatHashMap gift_prices); + void on_get_star_gift(const StarGift &star_gift, bool from_server); + + void on_get_user_star_gift(MessageFullId message_full_id, bool can_upgrade, int64 upgrade_star_count); void send_gift(int64 gift_id, UserId user_id, td_api::object_ptr text, bool is_private, - Promise &&promise); + bool pay_for_upgrade, Promise &&promise); void convert_gift(UserId user_id, MessageId message_id, Promise &&promise); void save_gift(UserId user_id, MessageId message_id, bool is_saved, Promise &&promise); + void get_gift_upgrade_preview(int64 gift_id, Promise> &&promise); + + void upgrade_gift(UserId user_id, MessageId message_id, bool keep_original_details, + Promise> &&promise); + + void transfer_gift(UserId user_id, MessageId message_id, UserId receiver_user_id, int64 star_count, + Promise &&promise); + void get_user_gifts(UserId user_id, const string &offset, int32 limit, Promise> &&promise); + void get_user_gift(MessageId message_id, Promise> &&promise); + + void register_gift(MessageFullId message_full_id, const char *source); + + void unregister_gift(MessageFullId message_full_id, const char *source); + private: + void start_up() final; + void tear_down() final; + double get_gift_message_polling_timeout() const; + + static void on_update_gift_message_timeout_callback(void *star_gift_manager_ptr, int64 message_number); + + void on_update_gift_message_timeout(int64 message_number); + + void on_update_gift_message(MessageFullId message_full_id); + + void on_online(); + Td *td_; ActorShared<> parent_; - FlatHashMap gift_prices_; + FlatHashMap> gift_prices_; + + int64 gift_message_count_ = 0; + WaitFreeHashMap gift_full_message_ids_; + WaitFreeHashMap gift_full_message_ids_by_id_; + FlatHashSet being_reloaded_gift_messages_; + MultiTimeout update_gift_message_timeout_{"UpdateGiftMessageTimeout"}; + + struct UserStarGiftInfo { + bool can_upgrade_ = false; + int64 upgrade_star_count_ = 0; + }; + WaitFreeHashMap user_gift_infos_; }; } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/StarManager.cpp b/lib/tgchat/ext/td/td/telegram/StarManager.cpp index cdcab5be..fbccde25 100644 --- a/lib/tgchat/ext/td/td/telegram/StarManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StarManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -22,7 +22,9 @@ #include "td/telegram/PasswordManager.h" #include "td/telegram/Photo.h" #include "td/telegram/ServerMessageId.h" +#include "td/telegram/StarAmount.h" #include "td/telegram/StarGift.h" +#include "td/telegram/StarGiftManager.h" #include "td/telegram/StarSubscription.h" #include "td/telegram/StatisticsManager.h" #include "td/telegram/StickersManager.h" @@ -37,6 +39,7 @@ #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/ScopeGuard.h" +#include "td/utils/SliceBuilder.h" #include @@ -227,13 +230,17 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { td_->chat_manager_->on_get_chats(std::move(result->chats_), "GetStarsTransactionsQuery"); bool for_bot = - (dialog_id_.get_type() == DialogType::User && td_->user_manager_->is_user_bot(dialog_id_.get_user_id())) || - td_->auth_manager_->is_bot(); + dialog_id_.get_type() == DialogType::User && td_->user_manager_->is_user_bot(dialog_id_.get_user_id()); + bool for_user = dialog_id_.get_type() == DialogType::User && !for_bot; + bool for_chat = !for_user && !for_bot; + bool for_channel = for_chat && td_->dialog_manager_->is_broadcast_channel(dialog_id_); vector> transactions; for (auto &transaction : result->history_) { vector file_ids; td_api::object_ptr product_info; string bot_payload; + td_api::object_ptr affiliate; + int32 commission_per_mille = 0; if (!transaction->title_.empty() || !transaction->description_.empty() || transaction->photo_ != nullptr) { auto photo = get_web_document_photo(td_->file_manager_.get(), std::move(transaction->photo_), DialogId()); append(file_ids, photo_get_file_ids(photo)); @@ -246,6 +253,26 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { LOG(ERROR) << "Receive Star transaction with bot payload"; } } + if (transaction->starref_peer_ != nullptr) { + DialogId referrer_dialog_id(transaction->starref_peer_); + if (transaction->starref_commission_permille_ > 0 && transaction->starref_commission_permille_ < 1000 && + referrer_dialog_id.is_valid()) { + td_->dialog_manager_->force_create_dialog(referrer_dialog_id, "affiliateInfo", true); + auto referrer_star_amount = StarAmount(std::move(transaction->starref_amount_), true); + affiliate = td_api::make_object( + transaction->starref_commission_permille_, + td_->dialog_manager_->get_chat_id_object(referrer_dialog_id, "affiliateInfo"), + referrer_star_amount.get_star_amount_object()); + } else { + LOG(ERROR) << "Receive invalid affiliate info: " << to_string(transaction); + } + } else if (transaction->starref_commission_permille_ != 0) { + if (transaction->starref_commission_permille_ > 0 && transaction->starref_commission_permille_ < 1000) { + commission_per_mille = transaction->starref_commission_permille_; + } else { + LOG(ERROR) << "Receive invalid commission: " << to_string(transaction); + } + } auto get_paid_media_object = [&](DialogId dialog_id) -> vector> { auto extended_media = transform(std::move(transaction->extended_media_), [td = td_, dialog_id](auto &&media) { return MessageExtendedMedia(td, std::move(media), dialog_id); @@ -258,23 +285,45 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { transaction->extended_media_.clear(); return extended_media_objects; }; - auto transaction_star_count = StarManager::get_star_count(transaction->stars_, true); - auto partner = [&]() -> td_api::object_ptr { + auto get_message_id_object = [&] { + auto message_id = MessageId(ServerMessageId(transaction->msg_id_)); + if (message_id != MessageId() && !message_id.is_valid()) { + LOG(ERROR) << "Receive " << message_id << " in " << to_string(transaction); + message_id = MessageId(); + } + transaction->msg_id_ = 0; + return message_id.get(); + }; + auto transaction_amount = StarAmount(std::move(transaction->stars_), true); + auto is_refund = transaction->refund_; + auto is_purchase = transaction_amount.is_positive() == is_refund; + auto type = [&]() -> td_api::object_ptr { switch (transaction->peer_->get_id()) { case telegram_api::starsTransactionPeerUnsupported::ID: - return td_api::make_object(); + return td_api::make_object(); case telegram_api::starsTransactionPeerPremiumBot::ID: - return td_api::make_object(); + if (for_user) { + return td_api::make_object(); + } + return nullptr; case telegram_api::starsTransactionPeerAppStore::ID: - return td_api::make_object(); + if (for_user) { + return td_api::make_object(); + } + return nullptr; case telegram_api::starsTransactionPeerPlayMarket::ID: - return td_api::make_object(); + if (for_user) { + return td_api::make_object(); + } + return nullptr; case telegram_api::starsTransactionPeerFragment::ID: { if (transaction->gift_) { - transaction->gift_ = false; - return td_api::make_object( - 0, td_api::make_object( - td_->stickers_manager_->get_premium_gift_sticker_object(0, transaction_star_count))); + if (for_user) { + transaction->gift_ = false; + return td_api::make_object( + 0, td_->stickers_manager_->get_premium_gift_sticker_object(0, transaction_amount.get_star_count())); + } + return nullptr; } auto state = [&]() -> td_api::object_ptr { if (transaction->transaction_date_ > 0) { @@ -286,154 +335,241 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { transaction->transaction_url_); } if (transaction->pending_) { - SCOPE_EXIT { - transaction->pending_ = false; - }; + transaction->pending_ = false; return td_api::make_object(); } if (transaction->failed_) { - SCOPE_EXIT { - transaction->failed_ = false; - }; + transaction->failed_ = false; return td_api::make_object(); } return nullptr; }(); - return td_api::make_object(std::move(state)); + if (state != nullptr || is_refund) { + if (for_bot || for_chat) { + return td_api::make_object(std::move(state)); + } + return nullptr; + } + if (for_user || for_bot) { + return td_api::make_object(); + } + return nullptr; } case telegram_api::starsTransactionPeer::ID: { DialogId dialog_id( static_cast(transaction->peer_.get())->peer_); + if (!dialog_id.is_valid()) { + return nullptr; + } + if (commission_per_mille != 0) { + SCOPE_EXIT { + commission_per_mille = 0; + }; + td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true); + auto chat_id = + td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionTypeAffiliateProgramCommission"); + return td_api::make_object(chat_id, + commission_per_mille); + } if (dialog_id.get_type() == DialogType::User) { auto user_id = dialog_id.get_user_id(); + auto user_id_object = td_->user_manager_->get_user_id_object(user_id, "starsTransactionPeer"); if (transaction->stargift_ != nullptr) { - auto gift = StarGift(td_, std::move(transaction->stargift_)); + auto gift = StarGift(td_, std::move(transaction->stargift_), true); transaction->stargift_ = nullptr; if (!gift.is_valid()) { - return td_api::make_object(); + return nullptr; } - auto gift_object = gift.get_gift_object(td_); - auto result = td_api::make_object( - td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerUser"), nullptr); - if ((transaction_star_count > 0) == transaction->refund_) { - result->purpose_ = - td_api::make_object(std::move(gift_object)); + td_->star_gift_manager_->on_get_star_gift(gift, true); + if (is_purchase) { + if (gift.is_unique()) { + if (transaction->stargift_upgrade_) { + if (for_user) { + transaction->stargift_upgrade_ = false; + return td_api::make_object( + gift.get_upgraded_gift_object(td_)); + } + } else { + if (for_user) { + return td_api::make_object( + user_id_object, gift.get_upgraded_gift_object(td_)); + } + } + } else { + if (for_user || for_bot) { + return td_api::make_object(user_id_object, + gift.get_gift_object(td_)); + } + } } else { - result->purpose_ = - td_api::make_object(std::move(gift_object)); + if (gift.is_unique()) { + LOG(ERROR) << "Receive sale of an upgraded gift"; + } else { + if (for_user) { + return td_api::make_object(user_id_object, + gift.get_gift_object(td_)); + } + } } - return std::move(result); + return nullptr; } if (transaction->subscription_period_ > 0) { SCOPE_EXIT { transaction->subscription_period_ = 0; - bot_payload.clear(); }; - return td_api::make_object( - td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBot"), - td_api::make_object( - transaction->subscription_period_, std::move(product_info), bot_payload)); + if (is_purchase) { + if (for_user) { + return td_api::make_object( + user_id_object, transaction->subscription_period_, std::move(product_info)); + } + } else { + if (for_channel) { + return td_api::make_object( + user_id_object, transaction->subscription_period_); + } else if (for_bot) { + SCOPE_EXIT { + bot_payload.clear(); + }; + return td_api::make_object( + user_id_object, transaction->subscription_period_, std::move(product_info), bot_payload, + std::move(affiliate)); + } + } + return nullptr; } - if (for_bot == td_->user_manager_->is_user_bot(user_id)) { - if (transaction->gift_ && !for_bot) { + if (transaction->gift_) { + if (for_user) { transaction->gift_ = false; - return td_api::make_object( + return td_api::make_object( user_id == UserManager::get_service_notifications_user_id() ? 0 - : td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerUser"), - td_api::make_object( - td_->stickers_manager_->get_premium_gift_sticker_object(0, transaction_star_count))); + : td_->user_manager_->get_user_id_object(user_id, "starTransactionTypeUserDeposit"), + td_->stickers_manager_->get_premium_gift_sticker_object(0, transaction_amount.get_star_count())); } - if (!transaction->extended_media_.empty()) { // TODO - return td_api::make_object( - td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBusiness"), - get_paid_media_object(DialogId(user_id))); + return nullptr; + } + if (transaction->subscription_period_ > 0) { + if (for_channel) { + SCOPE_EXIT { + transaction->subscription_period_ = 0; + }; + return td_api::make_object( + user_id_object, transaction->subscription_period_); } - LOG(ERROR) << "Receive Telegram Star transaction with " << user_id; - return td_api::make_object(); + return nullptr; + } + if (transaction->reaction_) { + if (for_channel) { + transaction->reaction_ = false; + return td_api::make_object( + user_id_object, get_message_id_object()); + } + return nullptr; } SCOPE_EXIT { bot_payload.clear(); }; - if (product_info == nullptr || !transaction->extended_media_.empty()) { - return td_api::make_object( - td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBot"), - td_api::make_object( - get_paid_media_object(DialogId(user_id)), bot_payload)); + if (product_info != nullptr) { + if (is_purchase) { + if (for_user) { + return td_api::make_object(user_id_object, + std::move(product_info)); + } + } else { + if (for_bot) { + return td_api::make_object( + user_id_object, std::move(product_info), bot_payload, std::move(affiliate)); + } + } + return nullptr; } - return td_api::make_object( - td_->user_manager_->get_user_id_object(user_id, "starTransactionPartnerBot"), - td_api::make_object(std::move(product_info), - bot_payload)); - } - if (dialog_id.get_type() == DialogType::Channel && transaction->giveaway_post_id_ > 0) { - SCOPE_EXIT { - transaction->giveaway_post_id_ = 0; - }; - td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true); - return td_api::make_object( - td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChat"), - td_api::make_object( - MessageId(ServerMessageId(transaction->giveaway_post_id_)).get())); + if (!transaction->extended_media_.empty() || is_refund || for_bot) { // TODO + if (is_purchase) { + if (for_user) { + return td_api::make_object( + user_id_object, get_paid_media_object(dialog_id)); + } + } else { + if (for_bot) { + return td_api::make_object( + user_id_object, get_paid_media_object(dialog_id_), bot_payload, std::move(affiliate)); + } else if (for_channel) { + return td_api::make_object( + user_id_object, get_message_id_object(), get_paid_media_object(dialog_id_)); + } + } + return nullptr; + } + return nullptr; } - if (td_->dialog_manager_->is_broadcast_channel(dialog_id)) { - if (transaction->subscription_period_ > 0) { + + // partner isn't a user now + td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true); + auto chat_id = td_->dialog_manager_->get_chat_id_object(dialog_id, "starsTransactionPeer"); + if (transaction->giveaway_post_id_ > 0) { + if (for_user && dialog_id.get_type() == DialogType::Channel) { SCOPE_EXIT { - transaction->subscription_period_ = 0; + transaction->giveaway_post_id_ = 0; }; - td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true); - return td_api::make_object( - td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChat"), - td_api::make_object(transaction->subscription_period_)); + return td_api::make_object( + chat_id, MessageId(ServerMessageId(transaction->giveaway_post_id_)).get()); } - if (transaction->reaction_) { + return nullptr; + } + if (transaction->subscription_period_ > 0) { + if (td_->dialog_manager_->is_broadcast_channel(dialog_id) && for_user) { SCOPE_EXIT { - transaction->msg_id_ = 0; - transaction->reaction_ = false; + transaction->subscription_period_ = 0; }; - auto message_id = MessageId(ServerMessageId(transaction->msg_id_)); - if (message_id != MessageId() && !message_id.is_valid()) { - LOG(ERROR) << "Receive " << message_id << " in " << to_string(transaction); - message_id = MessageId(); - } - td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true); - return td_api::make_object( - td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChat"), - td_api::make_object(message_id.get())); + return td_api::make_object( + chat_id, transaction->subscription_period_); } - - SCOPE_EXIT { - transaction->msg_id_ = 0; - }; - auto message_id = MessageId(ServerMessageId(transaction->msg_id_)); - if (message_id != MessageId() && !message_id.is_valid()) { - LOG(ERROR) << "Receive " << message_id << " in " << to_string(transaction); - message_id = MessageId(); + return nullptr; + } + if (transaction->reaction_) { + if (td_->dialog_manager_->is_broadcast_channel(dialog_id) && for_user) { + transaction->reaction_ = false; + return td_api::make_object(chat_id, + get_message_id_object()); } - td_->dialog_manager_->force_create_dialog(dialog_id, "starsTransactionPeer", true); - return td_api::make_object( - td_->dialog_manager_->get_chat_id_object(dialog_id, "starTransactionPartnerChat"), - td_api::make_object(message_id.get(), - get_paid_media_object(dialog_id))); + return nullptr; } - LOG(ERROR) << "Receive Telegram Star transaction with " << dialog_id; - return td_api::make_object(); + if (!transaction->extended_media_.empty() || is_refund) { // TODO + if (td_->dialog_manager_->is_broadcast_channel(dialog_id) && for_user) { + return td_api::make_object( + chat_id, get_message_id_object(), get_paid_media_object(dialog_id)); + } + return nullptr; + } + return nullptr; } case telegram_api::starsTransactionPeerAds::ID: - return td_api::make_object(); + if (for_bot || for_channel) { + return td_api::make_object(); + } + return nullptr; case telegram_api::starsTransactionPeerAPI::ID: { - SCOPE_EXIT { - transaction->floodskip_number_ = 0; - }; - return td_api::make_object(transaction->floodskip_number_); + if (for_bot) { + SCOPE_EXIT { + transaction->floodskip_number_ = 0; + }; + return td_api::make_object(transaction->floodskip_number_); + } + return nullptr; } default: UNREACHABLE(); + return nullptr; } }(); - auto star_transaction = td_api::make_object( - transaction->id_, transaction_star_count, transaction->refund_, transaction->date_, std::move(partner)); - if (star_transaction->partner_->get_id() != td_api::starTransactionPartnerUnsupported::ID) { + if (type == nullptr) { + LOG(ERROR) << "Receive unsupported Star transaction in " << dialog_id_ << ": " << to_string(transaction); + type = td_api::make_object(); + } + auto star_transaction = + td_api::make_object(transaction->id_, transaction_amount.get_star_amount_object(), + is_refund, transaction->date_, std::move(type)); + if (star_transaction->type_->get_id() != td_api::starTransactionTypeUnsupported::ID) { if (product_info != nullptr) { LOG(ERROR) << "Receive product info with " << to_string(star_transaction); } @@ -468,10 +604,19 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { if (transaction->floodskip_number_ != 0) { LOG(ERROR) << "Receive API payment with " << to_string(star_transaction); } + if (affiliate != nullptr) { + LOG(ERROR) << "Receive affiliate with " << to_string(star_transaction); + } + if (commission_per_mille != 0) { + LOG(ERROR) << "Receive commission with " << to_string(star_transaction); + } + if (transaction->stargift_upgrade_) { + LOG(ERROR) << "Receive gift upgrade with " << to_string(star_transaction); + } } if (!file_ids.empty()) { auto file_source_id = - td_->star_manager_->get_star_transaction_file_source_id(dialog_id_, transaction->id_, transaction->refund_); + td_->star_manager_->get_star_transaction_file_source_id(dialog_id_, transaction->id_, is_refund); for (auto file_id : file_ids) { td_->file_manager_->add_file_source(file_id, file_source_id, "GetStarsTransactionsQuery"); } @@ -479,12 +624,12 @@ class GetStarsTransactionsQuery final : public Td::ResultHandler { transactions.push_back(std::move(star_transaction)); } - auto star_count = StarManager::get_star_count(result->balance_, true); + auto star_amount = StarAmount(std::move(result->balance_), true); if (dialog_id_ == td_->dialog_manager_->get_my_dialog_id()) { - td_->star_manager_->on_update_owned_star_count(star_count); + td_->star_manager_->on_update_owned_star_amount(star_amount); } - promise_.set_value( - td_api::make_object(star_count, std::move(transactions), result->next_offset_)); + promise_.set_value(td_api::make_object(star_amount.get_star_amount_object(), + std::move(transactions), result->next_offset_)); } void on_error(Status status) final { @@ -531,11 +676,12 @@ class GetStarsSubscriptionsQuery final : public Td::ResultHandler { subscriptions.push_back(star_subscription.get_star_subscription_object(td_)); } } - auto star_count = StarManager::get_star_count(result->balance_, true); - td_->star_manager_->on_update_owned_star_count(star_count); + + auto star_amount = StarAmount(std::move(result->balance_), true); + td_->star_manager_->on_update_owned_star_amount(star_amount); promise_.set_value(td_api::make_object( - star_count, std::move(subscriptions), StarManager::get_star_count(result->subscriptions_missing_balance_), - result->subscriptions_next_offset_)); + star_amount.get_star_amount_object(), std::move(subscriptions), + StarManager::get_star_count(result->subscriptions_missing_balance_), result->subscriptions_next_offset_)); } void on_error(Status status) final { @@ -663,8 +809,10 @@ static td_api::object_ptr convert_stars_revenue_statu next_withdrawal_in = max(obj->next_withdrawal_at_ - G()->unix_time(), 1); } return td_api::make_object( - StarManager::get_star_count(obj->overall_revenue_), StarManager::get_star_count(obj->current_balance_), - StarManager::get_star_count(obj->available_balance_), obj->withdrawal_enabled_, next_withdrawal_in); + StarAmount(std::move(obj->overall_revenue_), true).get_star_amount_object(), + StarAmount(std::move(obj->current_balance_), true).get_star_amount_object(), + StarAmount(std::move(obj->available_balance_), true).get_star_amount_object(), obj->withdrawal_enabled_, + next_withdrawal_in); } class GetStarsRevenueStatsQuery final : public Td::ResultHandler { @@ -793,8 +941,11 @@ void StarManager::start_up() { auto owned_star_count = G()->td_db()->get_binlog_pmc()->get("owned_star_count"); if (!owned_star_count.empty()) { is_owned_star_count_inited_ = true; - owned_star_count_ = to_integer(owned_star_count); + auto star_count = split(owned_star_count); + owned_star_count_ = to_integer(star_count.first); + owned_nanostar_count_ = to_integer(star_count.second); sent_star_count_ = owned_star_count_; + sent_nanostar_count_ = owned_nanostar_count_; send_closure(G()->td(), &Td::send_update, get_update_owned_star_count_object()); } } @@ -806,23 +957,30 @@ void StarManager::tear_down() { td_api::object_ptr StarManager::get_update_owned_star_count_object() const { CHECK(is_owned_star_count_inited_); // sent_star_count_ can be negative as well as owned_star_count_ - return td_api::make_object(sent_star_count_); + return td_api::make_object( + td_api::make_object(sent_star_count_, sent_nanostar_count_)); } -void StarManager::on_update_owned_star_count(int64 star_count) { +void StarManager::on_update_owned_star_amount(StarAmount star_amount) { if (td_->auth_manager_->is_bot()) { return; } - if (is_owned_star_count_inited_ && star_count == owned_star_count_) { + auto star_count = star_amount.get_star_count(); + auto nanostar_count = star_amount.get_nanostar_count(); + if (is_owned_star_count_inited_ && star_count == owned_star_count_ && nanostar_count == owned_nanostar_count_) { return; } is_owned_star_count_inited_ = true; owned_star_count_ = star_count; - if (owned_star_count_ + pending_owned_star_count_ != sent_star_count_) { + owned_nanostar_count_ = nanostar_count; + if (owned_star_count_ + pending_owned_star_count_ != sent_star_count_ || + owned_nanostar_count_ != sent_nanostar_count_) { sent_star_count_ = owned_star_count_ + pending_owned_star_count_; + sent_nanostar_count_ = owned_nanostar_count_; send_closure(G()->td(), &Td::send_update, get_update_owned_star_count_object()); } - G()->td_db()->get_binlog_pmc()->set("owned_star_count", to_string(owned_star_count_)); + G()->td_db()->get_binlog_pmc()->set("owned_star_count", PSTRING() + << owned_star_count_ << ' ' << owned_nanostar_count_); } void StarManager::add_pending_owned_star_count(int64 star_count, bool move_to_owned) { @@ -833,7 +991,8 @@ void StarManager::add_pending_owned_star_count(int64 star_count, bool move_to_ow if (is_owned_star_count_inited_) { if (move_to_owned) { owned_star_count_ -= star_count; - G()->td_db()->get_binlog_pmc()->set("owned_star_count", to_string(owned_star_count_)); + G()->td_db()->get_binlog_pmc()->set("owned_star_count", PSTRING() + << owned_star_count_ << ' ' << owned_nanostar_count_); } else { sent_star_count_ += star_count; send_closure(G()->td(), &Td::send_update, get_update_owned_star_count_object()); @@ -1062,6 +1221,28 @@ int64 StarManager::get_star_count(int64 amount, bool allow_negative) { return amount; } +int32 StarManager::get_nanostar_count(int64 &star_count, int32 nanostar_count) { + if (-1000000000 >= nanostar_count || nanostar_count >= 1000000000) { + LOG(ERROR) << "Receive " << star_count << " + " << nanostar_count << " Telegram Stars"; + return nanostar_count; + } + if (star_count < 0 && nanostar_count > 0) { + LOG(ERROR) << "Receive " << star_count << " + " << nanostar_count << " Telegram Stars"; + star_count++; + nanostar_count -= 1000000000; + } + if (star_count > 0 && nanostar_count < 0) { + LOG(ERROR) << "Receive " << star_count << " + " << nanostar_count << " Telegram Stars"; + star_count--; + nanostar_count += 1000000000; + } + if (!(star_count < 0 && nanostar_count > 0) && !(star_count > 0 && nanostar_count < 0)) { + return nanostar_count; + } + LOG(ERROR) << "Receive " << star_count << " + " << nanostar_count << " Telegram Stars"; + return 0; +} + int32 StarManager::get_months_by_star_count(int64 star_count) { return star_count <= 1000 ? 3 : (star_count < 2500 ? 6 : 12); } diff --git a/lib/tgchat/ext/td/td/telegram/StarManager.h b/lib/tgchat/ext/td/td/telegram/StarManager.h index 4d78c80c..8d5bb0cf 100644 --- a/lib/tgchat/ext/td/td/telegram/StarManager.h +++ b/lib/tgchat/ext/td/td/telegram/StarManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,6 +8,7 @@ #include "td/telegram/DialogId.h" #include "td/telegram/files/FileSourceId.h" +#include "td/telegram/StarAmount.h" #include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/telegram/UserId.h" @@ -27,7 +28,7 @@ class StarManager final : public Actor { public: StarManager(Td *td, ActorShared<> parent); - void on_update_owned_star_count(int64 star_count); + void on_update_owned_star_amount(StarAmount star_amount); void add_pending_owned_star_count(int64 star_count, bool move_to_owned); @@ -75,6 +76,8 @@ class StarManager final : public Actor { static int64 get_star_count(int64 amount, bool allow_negative = false); + static int32 get_nanostar_count(int64 &star_count, int32 nanostar_count); + static int32 get_months_by_star_count(int64 star_count); void get_current_state(vector> &updates) const; @@ -101,8 +104,10 @@ class StarManager final : public Actor { bool is_owned_star_count_inited_ = false; int64 owned_star_count_ = 0; + int32 owned_nanostar_count_ = 0; int64 pending_owned_star_count_ = 0; int64 sent_star_count_ = 0; + int32 sent_nanostar_count_ = 0; FlatHashMap, DialogIdHash> star_transaction_file_source_ids_[2]; }; diff --git a/lib/tgchat/ext/td/td/telegram/StarSubscription.cpp b/lib/tgchat/ext/td/td/telegram/StarSubscription.cpp index 1c61f0f7..a66705d1 100644 --- a/lib/tgchat/ext/td/td/telegram/StarSubscription.cpp +++ b/lib/tgchat/ext/td/td/telegram/StarSubscription.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StarSubscription.h b/lib/tgchat/ext/td/td/telegram/StarSubscription.h index 474a8462..7ce3e39e 100644 --- a/lib/tgchat/ext/td/td/telegram/StarSubscription.h +++ b/lib/tgchat/ext/td/td/telegram/StarSubscription.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.cpp b/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.cpp index 9a434b0c..d843f925 100644 --- a/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.cpp +++ b/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.h b/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.h index 350e32ff..95ec7074 100644 --- a/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.h +++ b/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.hpp b/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.hpp index e09eb6ef..516fdffb 100644 --- a/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.hpp +++ b/lib/tgchat/ext/td/td/telegram/StarSubscriptionPricing.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StateManager.cpp b/lib/tgchat/ext/td/td/telegram/StateManager.cpp index 1234b54c..ad3bac99 100644 --- a/lib/tgchat/ext/td/td/telegram/StateManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StateManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StateManager.h b/lib/tgchat/ext/td/td/telegram/StateManager.h index 837d733f..3717d49e 100644 --- a/lib/tgchat/ext/td/td/telegram/StateManager.h +++ b/lib/tgchat/ext/td/td/telegram/StateManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StatisticsManager.cpp b/lib/tgchat/ext/td/td/telegram/StatisticsManager.cpp index 54c56c44..cb072bef 100644 --- a/lib/tgchat/ext/td/td/telegram/StatisticsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StatisticsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StatisticsManager.h b/lib/tgchat/ext/td/td/telegram/StatisticsManager.h index 84d1672d..234dacd1 100644 --- a/lib/tgchat/ext/td/td/telegram/StatisticsManager.h +++ b/lib/tgchat/ext/td/td/telegram/StatisticsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerFormat.cpp b/lib/tgchat/ext/td/td/telegram/StickerFormat.cpp index 0d7c66af..847c22ee 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerFormat.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickerFormat.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerFormat.h b/lib/tgchat/ext/td/td/telegram/StickerFormat.h index 60d9c1af..970f2b71 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerFormat.h +++ b/lib/tgchat/ext/td/td/telegram/StickerFormat.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerListType.cpp b/lib/tgchat/ext/td/td/telegram/StickerListType.cpp index fb451215..ad74b023 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerListType.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickerListType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerListType.h b/lib/tgchat/ext/td/td/telegram/StickerListType.h index aeab6967..022c3c4c 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerListType.h +++ b/lib/tgchat/ext/td/td/telegram/StickerListType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.cpp b/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.cpp index 3de3959a..2c68bac3 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.h b/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.h index 2eef9725..bedada8c 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.h +++ b/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.hpp b/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.hpp index 9fa74924..c4d94dcd 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.hpp +++ b/lib/tgchat/ext/td/td/telegram/StickerMaskPosition.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.cpp b/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.cpp index ccadd828..ca815a25 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.h b/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.h index 4f7ac2bc..3c772fec 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.h +++ b/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.hpp b/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.hpp index 24464909..f40791af 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.hpp +++ b/lib/tgchat/ext/td/td/telegram/StickerPhotoSize.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerSetId.cpp b/lib/tgchat/ext/td/td/telegram/StickerSetId.cpp index 3ae9d54f..26bbedb4 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerSetId.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickerSetId.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerSetId.h b/lib/tgchat/ext/td/td/telegram/StickerSetId.h index 4608c760..b1cc4c02 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerSetId.h +++ b/lib/tgchat/ext/td/td/telegram/StickerSetId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerType.cpp b/lib/tgchat/ext/td/td/telegram/StickerType.cpp index 61d6fb3b..a9c01778 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerType.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickerType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickerType.h b/lib/tgchat/ext/td/td/telegram/StickerType.h index 282563de..f7e0149c 100644 --- a/lib/tgchat/ext/td/td/telegram/StickerType.h +++ b/lib/tgchat/ext/td/td/telegram/StickerType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StickersManager.cpp b/lib/tgchat/ext/td/td/telegram/StickersManager.cpp index 9d4299c8..f31a245f 100644 --- a/lib/tgchat/ext/td/td/telegram/StickersManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StickersManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -116,6 +116,44 @@ class GetAllStickersQuery final : public Td::ResultHandler { }; class SearchStickersQuery final : public Td::ResultHandler { + string parameters_; + StickerType sticker_type_; + bool is_first_; + + public: + void send(string &¶meters, StickerType sticker_type, const string &emoji, const string &query, + vector input_language_codes, int32 offset, int32 limit, int64 hash) { + parameters_ = std::move(parameters); + sticker_type_ = sticker_type; + is_first_ = offset == 0; + int32 flags = 0; + if (sticker_type == StickerType::CustomEmoji) { + flags |= telegram_api::messages_searchStickers::EMOJIS_MASK; + } + send_query(G()->net_query_creator().create(telegram_api::messages_searchStickers( + flags, false /*ignored*/, query, emoji, std::move(input_language_codes), offset, limit, hash))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + auto ptr = result_ptr.move_as_ok(); + LOG(INFO) << "Receive result for search stickers: " << to_string(ptr); + td_->stickers_manager_->on_find_stickers_by_query_success(sticker_type_, parameters_, is_first_, std::move(ptr)); + } + + void on_error(Status status) final { + if (!G()->is_expected_error(status)) { + LOG(ERROR) << "Receive error for search stickers: " << status; + } + td_->stickers_manager_->on_find_stickers_by_query_fail(sticker_type_, parameters_, std::move(status)); + } +}; + +class GetStickersQuery final : public Td::ResultHandler { string emoji_; public: @@ -131,13 +169,13 @@ class SearchStickersQuery final : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - LOG(INFO) << "Receive result for search stickers: " << to_string(ptr); + LOG(INFO) << "Receive result for search stickers by emoji: " << to_string(ptr); td_->stickers_manager_->on_find_stickers_success(emoji_, std::move(ptr)); } void on_error(Status status) final { if (!G()->is_expected_error(status)) { - LOG(ERROR) << "Receive error for search stickers: " << status; + LOG(ERROR) << "Receive error for search stickers by emoji: " << status; } td_->stickers_manager_->on_find_stickers_fail(emoji_, std::move(status)); } @@ -4422,8 +4460,12 @@ string StickersManager::get_found_stickers_database_key(StickerType sticker_type return PSTRING() << (sticker_type == StickerType::Regular ? "found_stickers" : "found_custom_emoji") << emoji; } -void StickersManager::search_stickers(StickerType sticker_type, string emoji, int32 limit, +void StickersManager::search_stickers(StickerType sticker_type, string emoji, const string &query, + const vector &input_language_codes, int32 offset, int32 limit, Promise> &&promise) { + if (offset < 0) { + return promise.set_error(Status::Error(400, "Parameter offset must be non-negative")); + } if (limit == 0) { return promise.set_value(get_stickers_object({})); } @@ -4435,6 +4477,10 @@ void StickersManager::search_stickers(StickerType sticker_type, string emoji, in } remove_emoji_modifiers_in_place(emoji, false); + if (!query.empty() || offset > 0) { + emoji = PSTRING() << emoji << '\xFF' << query << '\xFF' << implode(input_language_codes, ' ') << '\xFF' << offset + << '\xFF' << limit; + } if (emoji.empty() || sticker_type == StickerType::Mask) { return promise.set_value(get_stickers_object({})); } @@ -4461,7 +4507,7 @@ void StickersManager::search_stickers(StickerType sticker_type, string emoji, in get_recent_stickers_hash(it->second.sticker_ids_, "search_stickers")); } - if (G()->use_sqlite_pmc()) { + if (G()->use_sqlite_pmc() && offset == 0) { LOG(INFO) << "Trying to load stickers for " << emoji << " from database"; G()->td_db()->get_sqlite_pmc()->get(get_found_stickers_database_key(sticker_type, emoji), PromiseCreator::lambda([sticker_type, emoji](string value) mutable { @@ -4476,9 +4522,17 @@ void StickersManager::search_stickers(StickerType sticker_type, string emoji, in } void StickersManager::reload_found_stickers(StickerType sticker_type, string &&emoji, int64 hash) { + if (emoji.find('\xFF') != string::npos) { + auto parameters = full_split(emoji, '\xFF'); + CHECK(parameters.size() == 5); + td_->create_handler()->send(std::move(emoji), sticker_type, parameters[0], parameters[1], + full_split(parameters[2]), to_integer(parameters[3]), + to_integer(parameters[4]), hash); + return; + } switch (sticker_type) { case StickerType::Regular: - td_->create_handler()->send(std::move(emoji), hash); + td_->create_handler()->send(std::move(emoji), hash); break; case StickerType::CustomEmoji: td_->create_handler()->send(std::move(emoji), hash); @@ -4530,14 +4584,14 @@ void StickersManager::on_search_stickers_finished(StickerType sticker_type, cons } void StickersManager::on_search_stickers_succeeded(StickerType sticker_type, const string &emoji, - vector &&sticker_ids) { + bool need_save_to_database, vector &&sticker_ids) { auto type = static_cast(sticker_type); auto &found_stickers = found_stickers_[type][emoji]; found_stickers.cache_time_ = 300; found_stickers.next_reload_time_ = Time::now() + found_stickers.cache_time_; found_stickers.sticker_ids_ = std::move(sticker_ids); - if (G()->use_sqlite_pmc() && !G()->close_flag()) { + if (G()->use_sqlite_pmc() && !G()->close_flag() && need_save_to_database) { LOG(INFO) << "Save " << sticker_type << " stickers for " << emoji << " to database"; G()->td_db()->get_sqlite_pmc()->set(get_found_stickers_database_key(sticker_type, emoji), log_event_store(found_stickers).as_slice().str(), Auto()); @@ -4559,6 +4613,51 @@ void StickersManager::on_search_stickers_failed(StickerType sticker_type, const } } +void StickersManager::on_find_stickers_by_query_success( + StickerType sticker_type, const string &emoji, bool is_first, + telegram_api::object_ptr &&stickers) { + CHECK(stickers != nullptr); + auto type = static_cast(sticker_type); + switch (stickers->get_id()) { + case telegram_api::messages_foundStickersNotModified::ID: { + auto it = found_stickers_[type].find(emoji); + if (it == found_stickers_[type].end()) { + return on_find_stickers_fail(emoji, Status::Error(500, "Receive messages.foundStickerNotModified")); + } + auto &found_stickers = it->second; + found_stickers.next_reload_time_ = Time::now() + found_stickers.cache_time_; + return on_search_stickers_finished(sticker_type, emoji, found_stickers); + } + case telegram_api::messages_foundStickers::ID: { + auto received_stickers = move_tl_object_as(stickers); + + vector sticker_ids; + for (auto &sticker : received_stickers->stickers_) { + FileId sticker_id = + on_get_sticker_document(std::move(sticker), StickerFormat::Unknown, "on_find_stickers_by_query_success") + .second; + if (sticker_id.is_valid()) { + sticker_ids.push_back(sticker_id); + } + } + + return on_search_stickers_succeeded(sticker_type, emoji, is_first, std::move(sticker_ids)); + } + default: + UNREACHABLE(); + } +} + +void StickersManager::on_find_stickers_by_query_fail(StickerType sticker_type, const string &emoji, Status &&error) { + auto type = static_cast(sticker_type); + if (found_stickers_[type].count(emoji) != 0) { + found_stickers_[type][emoji].cache_time_ = Random::fast(40, 80); + return on_find_stickers_success(emoji, telegram_api::make_object()); + } + + on_search_stickers_failed(sticker_type, emoji, std::move(error)); +} + void StickersManager::on_find_stickers_success(const string &emoji, tl_object_ptr &&stickers) { CHECK(stickers != nullptr); @@ -4586,7 +4685,7 @@ void StickersManager::on_find_stickers_success(const string &emoji, } } - return on_search_stickers_succeeded(sticker_type, emoji, std::move(sticker_ids)); + return on_search_stickers_succeeded(sticker_type, emoji, true, std::move(sticker_ids)); } default: UNREACHABLE(); @@ -4652,7 +4751,7 @@ void StickersManager::on_load_custom_emojis(string emoji, int64 hash, vector(), 0, limit, PromiseCreator::lambda( [promise = mpas.get_promise()](Result> result) mutable { if (result.is_error()) { @@ -8047,8 +8146,8 @@ void StickersManager::on_uploaded_sticker_file(FileUploadId file_upload_id, bool FileType file_type = file_view.get_type(); auto expected_document_type = file_type == FileType::Sticker ? Document::Type::Sticker : Document::Type::General; - auto parsed_document = - td_->documents_manager_->on_get_document(move_tl_object_as(document_ptr), DialogId()); + auto parsed_document = td_->documents_manager_->on_get_document( + move_tl_object_as(document_ptr), DialogId(), false); if (parsed_document.type != expected_document_type) { if (is_url && expected_document_type == Document::Type::General && parsed_document.type == Document::Type::Sticker) { diff --git a/lib/tgchat/ext/td/td/telegram/StickersManager.h b/lib/tgchat/ext/td/td/telegram/StickersManager.h index e686a539..cbbc6345 100644 --- a/lib/tgchat/ext/td/td/telegram/StickersManager.h +++ b/lib/tgchat/ext/td/td/telegram/StickersManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -185,7 +185,8 @@ class StickersManager final : public Actor { vector get_stickers(StickerType sticker_type, string query, int32 limit, DialogId dialog_id, bool force, Promise &&promise); - void search_stickers(StickerType sticker_type, string emoji, int32 limit, + void search_stickers(StickerType sticker_type, string emoji, const string &query, + const vector &input_language_codes, int32 offset, int32 limit, Promise> &&promise); void get_premium_stickers(int32 limit, Promise> &&promise); @@ -430,6 +431,11 @@ class StickersManager final : public Actor { void on_uploaded_sticker_file(FileUploadId file_upload_id, bool is_url, tl_object_ptr media, Promise &&promise); + void on_find_stickers_by_query_success(StickerType sticker_type, const string &emoji, bool is_first, + telegram_api::object_ptr &&stickers); + + void on_find_stickers_by_query_fail(StickerType sticker_type, const string &emoji, Status &&error); + void on_find_stickers_success(const string &emoji, tl_object_ptr &&stickers); void on_find_stickers_fail(const string &emoji, Status &&error); @@ -633,7 +639,8 @@ class StickersManager final : public Actor { void on_search_stickers_finished(StickerType sticker_type, const string &emoji, const FoundStickers &found_stickers); - void on_search_stickers_succeeded(StickerType sticker_type, const string &emoji, vector &&sticker_ids); + void on_search_stickers_succeeded(StickerType sticker_type, const string &emoji, bool need_save_to_database, + vector &&sticker_ids); void on_search_stickers_failed(StickerType sticker_type, const string &emoji, Status &&error); diff --git a/lib/tgchat/ext/td/td/telegram/StickersManager.hpp b/lib/tgchat/ext/td/td/telegram/StickersManager.hpp index 1a3fe845..251f80e4 100644 --- a/lib/tgchat/ext/td/td/telegram/StickersManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/StickersManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StorageManager.cpp b/lib/tgchat/ext/td/td/telegram/StorageManager.cpp index 1a71b0fb..4c466aad 100644 --- a/lib/tgchat/ext/td/td/telegram/StorageManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StorageManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -162,6 +162,7 @@ void StorageManager::on_all_files(FileGcParameters gc_parameters, Resultget_option_string("my_phone_number").empty(), PromiseCreator::lambda([actor_id = actor_id(this), dialog_limit](Result r_file_gc_result) { send_closure(actor_id, &StorageManager::on_gc_finished, dialog_limit, std::move(r_file_gc_result)); })); diff --git a/lib/tgchat/ext/td/td/telegram/StorageManager.h b/lib/tgchat/ext/td/td/telegram/StorageManager.h index 8c0d88ab..608a39bc 100644 --- a/lib/tgchat/ext/td/td/telegram/StorageManager.h +++ b/lib/tgchat/ext/td/td/telegram/StorageManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryContent.cpp b/lib/tgchat/ext/td/td/telegram/StoryContent.cpp index e8293350..3d172107 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryContent.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryContent.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -221,8 +221,8 @@ unique_ptr get_story_content(Td *td, tl_object_ptrdocuments_manager_->on_get_document( - move_tl_object_as(document_ptr), owner_dialog_id, nullptr, Document::Type::Video, - DocumentsManager::Subtype::Story); + move_tl_object_as(document_ptr), owner_dialog_id, false, nullptr, + Document::Type::Video, DocumentsManager::Subtype::Story); if (parsed_document.empty() || parsed_document.type != Document::Type::Video) { LOG(ERROR) << "Receive a story with " << parsed_document; break; @@ -238,7 +238,7 @@ unique_ptr get_story_content(Td *td, tl_object_ptrdocuments_manager_->on_get_document( - move_tl_object_as(alt_document_ptr), owner_dialog_id, nullptr, + move_tl_object_as(alt_document_ptr), owner_dialog_id, false, nullptr, Document::Type::Video, DocumentsManager::Subtype::Story); if (parsed_alt_document.empty() || parsed_alt_document.type != Document::Type::Video) { LOG(ERROR) << "Receive invalid alternative document " << parsed_alt_document; diff --git a/lib/tgchat/ext/td/td/telegram/StoryContent.h b/lib/tgchat/ext/td/td/telegram/StoryContent.h index 7ba75e03..8a0e6879 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryContent.h +++ b/lib/tgchat/ext/td/td/telegram/StoryContent.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryContentType.cpp b/lib/tgchat/ext/td/td/telegram/StoryContentType.cpp index ba4ae50a..346492d9 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryContentType.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryContentType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryContentType.h b/lib/tgchat/ext/td/td/telegram/StoryContentType.h index 3b4491ae..c407ef17 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryContentType.h +++ b/lib/tgchat/ext/td/td/telegram/StoryContentType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryDb.cpp b/lib/tgchat/ext/td/td/telegram/StoryDb.cpp index f7b50d6e..c15c29d2 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryDb.h b/lib/tgchat/ext/td/td/telegram/StoryDb.h index 46544646..92e1df28 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryDb.h +++ b/lib/tgchat/ext/td/td/telegram/StoryDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.cpp b/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.cpp index b86bfede..7c3a3dbc 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.h b/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.h index f464c15c..089752dd 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.h +++ b/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.hpp b/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.hpp index 8df22c98..551e65a0 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/StoryForwardInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryFullId.h b/lib/tgchat/ext/td/td/telegram/StoryFullId.h index 95753b32..232ac5e5 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryFullId.h +++ b/lib/tgchat/ext/td/td/telegram/StoryFullId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryId.h b/lib/tgchat/ext/td/td/telegram/StoryId.h index 66db9338..4ece78dd 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryId.h +++ b/lib/tgchat/ext/td/td/telegram/StoryId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.cpp b/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.cpp index 5b52529b..8ff3b712 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.h b/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.h index 18edacac..af5a68ed 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.h +++ b/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.hpp b/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.hpp index e562b4ba..ce7e69b3 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/StoryInteractionInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryListId.h b/lib/tgchat/ext/td/td/telegram/StoryListId.h index f2934f95..202b6c2e 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryListId.h +++ b/lib/tgchat/ext/td/td/telegram/StoryListId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryManager.cpp b/lib/tgchat/ext/td/td/telegram/StoryManager.cpp index 1690b7ad..898728e3 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryManager.h b/lib/tgchat/ext/td/td/telegram/StoryManager.h index d6e5711b..86cd1648 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryManager.h +++ b/lib/tgchat/ext/td/td/telegram/StoryManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryNotificationSettings.h b/lib/tgchat/ext/td/td/telegram/StoryNotificationSettings.h index 95b85471..a0feb550 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryNotificationSettings.h +++ b/lib/tgchat/ext/td/td/telegram/StoryNotificationSettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryStealthMode.cpp b/lib/tgchat/ext/td/td/telegram/StoryStealthMode.cpp index d44ed53b..78e067a2 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryStealthMode.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryStealthMode.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryStealthMode.h b/lib/tgchat/ext/td/td/telegram/StoryStealthMode.h index eb479930..632aaee2 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryStealthMode.h +++ b/lib/tgchat/ext/td/td/telegram/StoryStealthMode.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryStealthMode.hpp b/lib/tgchat/ext/td/td/telegram/StoryStealthMode.hpp index e6254f7c..5f4c1d6e 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryStealthMode.hpp +++ b/lib/tgchat/ext/td/td/telegram/StoryStealthMode.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryViewer.cpp b/lib/tgchat/ext/td/td/telegram/StoryViewer.cpp index ad7187eb..6a105f60 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryViewer.cpp +++ b/lib/tgchat/ext/td/td/telegram/StoryViewer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/StoryViewer.h b/lib/tgchat/ext/td/td/telegram/StoryViewer.h index ab88d7ef..daf70701 100644 --- a/lib/tgchat/ext/td/td/telegram/StoryViewer.h +++ b/lib/tgchat/ext/td/td/telegram/StoryViewer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SuggestedAction.cpp b/lib/tgchat/ext/td/td/telegram/SuggestedAction.cpp index 9dd0a89b..9c42929d 100644 --- a/lib/tgchat/ext/td/td/telegram/SuggestedAction.cpp +++ b/lib/tgchat/ext/td/td/telegram/SuggestedAction.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,9 +7,8 @@ #include "td/telegram/SuggestedAction.h" #include "td/telegram/ChannelId.h" -#include "td/telegram/ConfigManager.h" -#include "td/telegram/DialogManager.h" #include "td/telegram/Global.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/Td.h" #include "td/actor/actor.h" @@ -52,6 +51,8 @@ SuggestedAction::SuggestedAction(Slice action_str) { init(Type::PremiumGrace); } else if (action_str == Slice("STARS_SUBSCRIPTION_LOW_BALANCE")) { init(Type::StarsSubscriptionLowBalance); + } else if (action_str == Slice("USERPIC_SETUP")) { + init(Type::UserpicSetup); } } @@ -116,6 +117,9 @@ SuggestedAction::SuggestedAction(const td_api::object_ptr SuggestedAction::get_suggested_actio G()->get_option_string("premium_manage_subscription_url", "https://t.me/premiumbot?start=status")); case Type::StarsSubscriptionLowBalance: return td_api::make_object(); + case Type::UserpicSetup: + return td_api::make_object(); default: UNREACHABLE(); return nullptr; @@ -253,18 +261,17 @@ void dismiss_suggested_action(SuggestedAction action, Promise &&promise) { case SuggestedAction::Type::BirthdaySetup: case SuggestedAction::Type::PremiumGrace: case SuggestedAction::Type::StarsSubscriptionLowBalance: - return send_closure_later(G()->config_manager(), &ConfigManager::dismiss_suggested_action, std::move(action), - std::move(promise)); case SuggestedAction::Type::ConvertToGigagroup: - return send_closure_later(G()->dialog_manager(), &DialogManager::dismiss_dialog_suggested_action, + case SuggestedAction::Type::UserpicSetup: + return send_closure_later(G()->suggested_action_manager(), &SuggestedActionManager::dismiss_suggested_action, std::move(action), std::move(promise)); case SuggestedAction::Type::SetPassword: { if (action.otherwise_relogin_days_ < 0) { return promise.set_error(Status::Error(400, "Invalid authorization_delay specified")); } if (action.otherwise_relogin_days_ == 0) { - return send_closure_later(G()->config_manager(), &ConfigManager::dismiss_suggested_action, std::move(action), - std::move(promise)); + return send_closure_later(G()->suggested_action_manager(), &SuggestedActionManager::dismiss_suggested_action, + std::move(action), std::move(promise)); } auto days = narrow_cast(G()->get_option_integer("otherwise_relogin_days")); if (days == action.otherwise_relogin_days_) { diff --git a/lib/tgchat/ext/td/td/telegram/SuggestedAction.h b/lib/tgchat/ext/td/td/telegram/SuggestedAction.h index ca4833c6..ef69243d 100644 --- a/lib/tgchat/ext/td/td/telegram/SuggestedAction.h +++ b/lib/tgchat/ext/td/td/telegram/SuggestedAction.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,6 +10,7 @@ #include "td/telegram/td_api.h" #include "td/utils/common.h" +#include "td/utils/HashTableUtils.h" #include "td/utils/Promise.h" #include "td/utils/Slice.h" @@ -30,7 +31,8 @@ struct SuggestedAction { GiftPremiumForChristmas, BirthdaySetup, PremiumGrace, - StarsSubscriptionLowBalance + StarsSubscriptionLowBalance, + UserpicSetup }; Type type_ = Type::Empty; DialogId dialog_id_; @@ -65,9 +67,14 @@ struct SuggestedAction { void parse(ParserT &parser); }; +struct SuggestedActionHash { + uint32 operator()(SuggestedAction suggested_action) const { + return combine_hashes(DialogIdHash()(suggested_action.dialog_id_), static_cast(suggested_action.type_)); + } +}; + inline bool operator==(const SuggestedAction &lhs, const SuggestedAction &rhs) { - CHECK(lhs.dialog_id_ == rhs.dialog_id_); - return lhs.type_ == rhs.type_; + return lhs.type_ == rhs.type_ && lhs.dialog_id_ == rhs.dialog_id_; } inline bool operator!=(const SuggestedAction &lhs, const SuggestedAction &rhs) { @@ -75,7 +82,9 @@ inline bool operator!=(const SuggestedAction &lhs, const SuggestedAction &rhs) { } inline bool operator<(const SuggestedAction &lhs, const SuggestedAction &rhs) { - CHECK(lhs.dialog_id_ == rhs.dialog_id_); + if (lhs.dialog_id_ != rhs.dialog_id_) { + return lhs.dialog_id_.get() < rhs.dialog_id_.get(); + } return static_cast(lhs.type_) < static_cast(rhs.type_); } diff --git a/lib/tgchat/ext/td/td/telegram/SuggestedAction.hpp b/lib/tgchat/ext/td/td/telegram/SuggestedAction.hpp index a168227d..d4065be8 100644 --- a/lib/tgchat/ext/td/td/telegram/SuggestedAction.hpp +++ b/lib/tgchat/ext/td/td/telegram/SuggestedAction.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SuggestedActionManager.cpp b/lib/tgchat/ext/td/td/telegram/SuggestedActionManager.cpp new file mode 100644 index 00000000..501c656b --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/SuggestedActionManager.cpp @@ -0,0 +1,236 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/SuggestedActionManager.h" + +#include "td/telegram/AccessRights.h" +#include "td/telegram/ChatManager.h" +#include "td/telegram/ConfigManager.h" +#include "td/telegram/DialogManager.h" +#include "td/telegram/Global.h" +#include "td/telegram/logevent/LogEvent.h" +#include "td/telegram/SuggestedAction.hpp" +#include "td/telegram/Td.h" +#include "td/telegram/TdDb.h" +#include "td/telegram/telegram_api.h" + +#include "td/utils/algorithm.h" +#include "td/utils/buffer.h" +#include "td/utils/logging.h" + +namespace td { + +class DismissSuggestionQuery final : public Td::ResultHandler { + Promise promise_; + DialogId dialog_id_; + + public: + explicit DismissSuggestionQuery(Promise &&promise) : promise_(std::move(promise)) { + } + + void send(SuggestedAction action) { + dialog_id_ = action.dialog_id_; + telegram_api::object_ptr input_peer; + if (dialog_id_.is_valid()) { + input_peer = td_->dialog_manager_->get_input_peer(dialog_id_, AccessRights::Read); + CHECK(input_peer != nullptr); + } else { + input_peer = telegram_api::make_object(); + } + + send_query(G()->net_query_creator().create( + telegram_api::help_dismissSuggestion(std::move(input_peer), action.get_suggested_action_str()))); + } + + void on_result(BufferSlice packet) final { + auto result_ptr = fetch_result(packet); + if (result_ptr.is_error()) { + return on_error(result_ptr.move_as_error()); + } + + promise_.set_value(Unit()); + } + + void on_error(Status status) final { + if (dialog_id_.is_valid()) { + td_->dialog_manager_->on_get_dialog_error(dialog_id_, status, "DismissSuggestionQuery"); + } + promise_.set_error(std::move(status)); + } +}; + +SuggestedActionManager::SuggestedActionManager(Td *td, ActorShared<> parent) : td_(td), parent_(std::move(parent)) { +} + +void SuggestedActionManager::start_up() { + auto log_event_string = G()->td_db()->get_binlog_pmc()->get(get_suggested_actions_database_key()); + if (!log_event_string.empty()) { + vector suggested_actions; + auto status = log_event_parse(suggested_actions, log_event_string); + if (status.is_error()) { + LOG(ERROR) << "Failed to parse suggested actions from binlog: " << status; + save_suggested_actions(); + } else { + ::td::update_suggested_actions(suggested_actions_, std::move(suggested_actions)); + } + } +} + +void SuggestedActionManager::hangup() { + while (!dismiss_suggested_action_queries_.empty()) { + auto it = dismiss_suggested_action_queries_.begin(); + auto promises = std::move(it->second); + dismiss_suggested_action_queries_.erase(it); + fail_promises(promises, Global::request_aborted_error()); + } + + stop(); +} + +void SuggestedActionManager::tear_down() { + parent_.reset(); +} + +void SuggestedActionManager::update_suggested_actions(vector &&suggested_actions) { + if (!dismiss_suggested_action_queries_.empty()) { + // do not update suggested actions while dismissing an action + return; + } + if (::td::update_suggested_actions(suggested_actions_, std::move(suggested_actions))) { + save_suggested_actions(); + } +} + +void SuggestedActionManager::hide_suggested_action(SuggestedAction suggested_action) { + if (remove_suggested_action(suggested_actions_, suggested_action)) { + save_suggested_actions(); + } +} + +void SuggestedActionManager::dismiss_suggested_action(SuggestedAction suggested_action, Promise &&promise) { + auto action_str = suggested_action.get_suggested_action_str(); + if (action_str.empty()) { + return promise.set_value(Unit()); + } + + auto dialog_id = suggested_action.dialog_id_; + if (dialog_id != DialogId()) { + TRY_STATUS_PROMISE(promise, td_->dialog_manager_->check_dialog_access(dialog_id, false, AccessRights::Read, + "dismiss_suggested_action")); + + auto it = dialog_suggested_actions_.find(dialog_id); + if (it == dialog_suggested_actions_.end() || !td::contains(it->second, suggested_action)) { + return promise.set_value(Unit()); + } + remove_dialog_suggested_action(suggested_action); + } else { + if (!remove_suggested_action(suggested_actions_, suggested_action)) { + return promise.set_value(Unit()); + } + save_suggested_actions(); + } + + auto &queries = dismiss_suggested_action_queries_[suggested_action]; + queries.push_back(std::move(promise)); + if (queries.size() == 1) { + auto query_promise = PromiseCreator::lambda([actor_id = actor_id(this), suggested_action](Result result) { + send_closure(actor_id, &SuggestedActionManager::on_dismiss_suggested_action, suggested_action, std::move(result)); + }); + td_->create_handler(std::move(query_promise))->send(suggested_action); + } +} + +void SuggestedActionManager::on_dismiss_suggested_action(SuggestedAction suggested_action, Result &&result) { + if (G()->close_flag()) { + return; + } + + auto it = dismiss_suggested_action_queries_.find(suggested_action); + CHECK(it != dismiss_suggested_action_queries_.end()); + auto promises = std::move(it->second); + CHECK(!promises.empty()); + dismiss_suggested_action_queries_.erase(it); + + if (result.is_error()) { + return fail_promises(promises, result.move_as_error()); + } + + if (suggested_action.dialog_id_ != DialogId()) { + remove_dialog_suggested_action(suggested_action); + } else { + if (remove_suggested_action(suggested_actions_, suggested_action)) { + save_suggested_actions(); + } + send_closure(G()->config_manager(), &ConfigManager::reget_app_config, Promise()); + } + + set_promises(promises); +} + +string SuggestedActionManager::get_suggested_actions_database_key() { + return "suggested_actions"; +} + +void SuggestedActionManager::save_suggested_actions() { + if (suggested_actions_.empty()) { + G()->td_db()->get_binlog_pmc()->erase(get_suggested_actions_database_key()); + } else { + G()->td_db()->get_binlog_pmc()->set(get_suggested_actions_database_key(), + log_event_store(suggested_actions_).as_slice().str()); + } +} + +void SuggestedActionManager::set_dialog_pending_suggestions(DialogId dialog_id, vector &&pending_suggestions) { + if (!dismiss_suggested_action_queries_.empty()) { + return; + } + auto it = dialog_suggested_actions_.find(dialog_id); + if (it == dialog_suggested_actions_.end() && !pending_suggestions.empty()) { + return; + } + vector suggested_actions; + for (auto &action_str : pending_suggestions) { + SuggestedAction suggested_action(action_str, dialog_id); + if (!suggested_action.is_empty()) { + if (suggested_action == SuggestedAction{SuggestedAction::Type::ConvertToGigagroup, dialog_id} && + (dialog_id.get_type() != DialogType::Channel || + !td_->chat_manager_->can_convert_channel_to_gigagroup(dialog_id.get_channel_id()))) { + LOG(INFO) << "Skip ConvertToGigagroup suggested action"; + } else { + suggested_actions.push_back(suggested_action); + } + } + } + if (it == dialog_suggested_actions_.end()) { + it = dialog_suggested_actions_.emplace(dialog_id, vector()).first; + } + ::td::update_suggested_actions(it->second, std::move(suggested_actions)); + if (it->second.empty()) { + dialog_suggested_actions_.erase(it); + } +} + +void SuggestedActionManager::remove_dialog_suggested_action(SuggestedAction action) { + auto it = dialog_suggested_actions_.find(action.dialog_id_); + if (it == dialog_suggested_actions_.end()) { + return; + } + remove_suggested_action(it->second, action); + if (it->second.empty()) { + dialog_suggested_actions_.erase(it); + } +} + +void SuggestedActionManager::get_current_state(vector> &updates) const { + if (!suggested_actions_.empty()) { + updates.push_back(get_update_suggested_actions_object(suggested_actions_, {}, "get_current_state")); + } + for (const auto &actions : dialog_suggested_actions_) { + updates.push_back(get_update_suggested_actions_object(actions.second, {}, "get_current_state 2")); + } +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/SuggestedActionManager.h b/lib/tgchat/ext/td/td/telegram/SuggestedActionManager.h new file mode 100644 index 00000000..47fc08d7 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/SuggestedActionManager.h @@ -0,0 +1,61 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/DialogId.h" +#include "td/telegram/SuggestedAction.h" +#include "td/telegram/td_api.h" + +#include "td/actor/actor.h" + +#include "td/utils/common.h" +#include "td/utils/FlatHashMap.h" +#include "td/utils/Promise.h" +#include "td/utils/Status.h" + +namespace td { + +class Td; + +class SuggestedActionManager final : public Actor { + public: + SuggestedActionManager(Td *td, ActorShared<> parent); + + void update_suggested_actions(vector &&suggested_actions); + + void hide_suggested_action(SuggestedAction suggested_action); + + void dismiss_suggested_action(SuggestedAction suggested_action, Promise &&promise); + + void remove_dialog_suggested_action(SuggestedAction action); + + void set_dialog_pending_suggestions(DialogId dialog_id, vector &&pending_suggestions); + + void get_current_state(vector> &updates) const; + + private: + void start_up() final; + + void hangup() final; + + void tear_down() final; + + static string get_suggested_actions_database_key(); + + void save_suggested_actions(); + + void on_dismiss_suggested_action(SuggestedAction suggested_action, Result &&result); + + Td *td_; + ActorShared<> parent_; + + vector suggested_actions_; + FlatHashMap, DialogIdHash> dialog_suggested_actions_; + FlatHashMap>, SuggestedActionHash> dismiss_suggested_action_queries_; +}; + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/Support.cpp b/lib/tgchat/ext/td/td/telegram/Support.cpp index 95904bae..832acb7a 100644 --- a/lib/tgchat/ext/td/td/telegram/Support.cpp +++ b/lib/tgchat/ext/td/td/telegram/Support.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Support.h b/lib/tgchat/ext/td/td/telegram/Support.h index 9f3b5c83..7eed5275 100644 --- a/lib/tgchat/ext/td/td/telegram/Support.h +++ b/lib/tgchat/ext/td/td/telegram/Support.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/SynchronousRequests.cpp b/lib/tgchat/ext/td/td/telegram/SynchronousRequests.cpp index 53a37996..a3719bd2 100644 --- a/lib/tgchat/ext/td/td/telegram/SynchronousRequests.cpp +++ b/lib/tgchat/ext/td/td/telegram/SynchronousRequests.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -301,9 +301,6 @@ td_api::object_ptr SynchronousRequests::do_request( if (request.folder_ == nullptr) { return make_error(400, "Chat folder must be non-empty"); } - if (!check_utf8(request.folder_->title_)) { - return make_error(400, "Chat folder title must be encoded in UTF-8"); - } if (request.folder_->icon_ != nullptr && !check_utf8(request.folder_->icon_->name_)) { return make_error(400, "Chat folder icon name must be encoded in UTF-8"); } diff --git a/lib/tgchat/ext/td/td/telegram/SynchronousRequests.h b/lib/tgchat/ext/td/td/telegram/SynchronousRequests.h index 472c23d9..351958a9 100644 --- a/lib/tgchat/ext/td/td/telegram/SynchronousRequests.h +++ b/lib/tgchat/ext/td/td/telegram/SynchronousRequests.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.cpp b/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.cpp index 89c35611..91ab5c8e 100644 --- a/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.cpp +++ b/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.h b/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.h index e7b3f1ff..b033f33d 100644 --- a/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.h +++ b/lib/tgchat/ext/td/td/telegram/TargetDialogTypes.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Td.cpp b/lib/tgchat/ext/td/td/telegram/Td.cpp index 16f8b680..a7188c83 100644 --- a/lib/tgchat/ext/td/td/telegram/Td.cpp +++ b/lib/tgchat/ext/td/td/telegram/Td.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -50,6 +50,7 @@ #include "td/telegram/LanguagePackManager.h" #include "td/telegram/LinkManager.h" #include "td/telegram/MessageImportManager.h" +#include "td/telegram/MessageQueryManager.h" #include "td/telegram/MessagesManager.h" #include "td/telegram/misc.h" #include "td/telegram/net/ConnectionCreator.h" @@ -72,6 +73,7 @@ #include "td/telegram/PromoDataManager.h" #include "td/telegram/QuickReplyManager.h" #include "td/telegram/ReactionManager.h" +#include "td/telegram/ReferralProgramManager.h" #include "td/telegram/RequestActor.h" #include "td/telegram/Requests.h" #include "td/telegram/SavedMessagesManager.h" @@ -85,6 +87,7 @@ #include "td/telegram/StickersManager.h" #include "td/telegram/StorageManager.h" #include "td/telegram/StoryManager.h" +#include "td/telegram/SuggestedActionManager.h" #include "td/telegram/SynchronousRequests.h" #include "td/telegram/TdDb.h" #include "td/telegram/TermsOfServiceManager.h" @@ -506,6 +509,7 @@ void Td::dec_actor_refcnt() { reset_manager(bot_info_manager_, "BotInfoManager"); reset_manager(business_connection_manager_, "BusinessConnectionManager"); reset_manager(business_manager_, "BusinessManager"); + reset_manager(call_manager_, "CallManager"); reset_manager(callback_queries_manager_, "CallbackQueriesManager"); reset_manager(channel_recommendation_manager_, "ChannelRecommendationManager"); reset_manager(chat_manager_, "ChatManager"); @@ -528,6 +532,7 @@ void Td::dec_actor_refcnt() { reset_manager(inline_queries_manager_, "InlineQueriesManager"); reset_manager(link_manager_, "LinkManager"); reset_manager(message_import_manager_, "MessageImportManager"); + reset_manager(message_query_manager_, "MessageQueryManager"); reset_manager(messages_manager_, "MessagesManager"); reset_manager(notification_manager_, "NotificationManager"); reset_manager(notification_settings_manager_, "NotificationSettingsManager"); @@ -539,6 +544,7 @@ void Td::dec_actor_refcnt() { reset_manager(promo_data_manager_, "PromoDataManager"); reset_manager(quick_reply_manager_, "QuickReplyManager"); reset_manager(reaction_manager_, "ReactionManager"); + reset_manager(referral_program_manager_, "ReferralProgramManager"); reset_manager(saved_messages_manager_, "SavedMessagesManager"); reset_manager(sponsored_message_manager_, "SponsoredMessageManager"); reset_manager(star_gift_manager_, "StarGiftManager"); @@ -546,6 +552,7 @@ void Td::dec_actor_refcnt() { reset_manager(statistics_manager_, "StatisticsManager"); reset_manager(stickers_manager_, "StickersManager"); reset_manager(story_manager_, "StoryManager"); + reset_manager(suggested_action_manager_, "SuggestedActionManager"); reset_manager(terms_of_service_manager_, "TermsOfServiceManager"); reset_manager(theme_manager_, "ThemeManager"); reset_manager(time_zone_manager_, "TimeZoneManager"); @@ -651,7 +658,6 @@ void Td::clear() { // close all pure actors reset_actor(ActorOwn(std::move(alarm_manager_))); - reset_actor(ActorOwn(std::move(call_manager_))); reset_actor(ActorOwn(std::move(cashtag_search_hints_))); reset_actor(ActorOwn(std::move(config_manager_))); reset_actor(ActorOwn(std::move(device_token_manager_))); @@ -680,6 +686,7 @@ void Td::clear() { reset_actor(ActorOwn(std::move(bot_info_manager_actor_))); reset_actor(ActorOwn(std::move(business_connection_manager_actor_))); reset_actor(ActorOwn(std::move(business_manager_actor_))); + reset_actor(ActorOwn(std::move(call_manager_actor_))); reset_actor(ActorOwn(std::move(channel_recommendation_manager_actor_))); reset_actor(ActorOwn(std::move(chat_manager_actor_))); reset_actor(ActorOwn(std::move(common_dialog_manager_actor_))); @@ -700,6 +707,7 @@ void Td::clear() { reset_actor(ActorOwn(std::move(inline_queries_manager_actor_))); reset_actor(ActorOwn(std::move(link_manager_actor_))); reset_actor(ActorOwn(std::move(message_import_manager_actor_))); + reset_actor(ActorOwn(std::move(message_query_manager_actor_))); reset_actor(ActorOwn(std::move(messages_manager_actor_))); reset_actor(ActorOwn(std::move(notification_manager_actor_))); reset_actor(ActorOwn(std::move(notification_settings_manager_actor_))); @@ -711,6 +719,7 @@ void Td::clear() { reset_actor(ActorOwn(std::move(promo_data_manager_actor_))); reset_actor(ActorOwn(std::move(quick_reply_manager_actor_))); reset_actor(ActorOwn(std::move(reaction_manager_actor_))); + reset_actor(ActorOwn(std::move(referral_program_manager_actor_))); reset_actor(ActorOwn(std::move(saved_messages_manager_actor_))); reset_actor(ActorOwn(std::move(sponsored_message_manager_actor_))); reset_actor(ActorOwn(std::move(star_gift_manager_actor_))); @@ -718,6 +727,7 @@ void Td::clear() { reset_actor(ActorOwn(std::move(statistics_manager_actor_))); reset_actor(ActorOwn(std::move(stickers_manager_actor_))); reset_actor(ActorOwn(std::move(story_manager_actor_))); + reset_actor(ActorOwn(std::move(suggested_action_manager_actor_))); reset_actor(ActorOwn(std::move(terms_of_service_manager_actor_))); reset_actor(ActorOwn(std::move(theme_manager_actor_))); reset_actor(ActorOwn(std::move(time_zone_manager_actor_))); @@ -828,7 +838,7 @@ void Td::init(Parameters parameters, Result r_opened_datab // we need to process td_api::getOption along with td_api::setOption for consistency // we need to process td_api::setOption before managers and MTProto header are created, - // because their initialiation may be affected by the options + // because their initialization may be affected by the options complete_pending_preauthentication_requests([](int32 id) { switch (id) { case td_api::getOption::ID: @@ -980,6 +990,8 @@ void Td::process_binlog_events(TdDb::OpenedDatabase &&events) { send_closure_later(poll_manager_actor_, &PollManager::on_binlog_events, std::move(events.to_poll_manager)); + send_closure_later(dialog_manager_actor_, &DialogManager::on_binlog_events, std::move(events.to_dialog_manager)); + send_closure_later(messages_manager_actor_, &MessagesManager::on_binlog_events, std::move(events.to_messages_manager)); @@ -1138,6 +1150,9 @@ void Td::init_managers() { business_manager_ = make_unique(this, create_reference()); business_manager_actor_ = register_actor("BusinessManager", business_manager_.get()); G()->set_business_manager(business_manager_actor_.get()); + call_manager_ = make_unique(this, create_reference()); + call_manager_actor_ = register_actor("CallManager", call_manager_.get()); + G()->set_call_manager(call_manager_actor_.get()); channel_recommendation_manager_ = make_unique(this, create_reference()); channel_recommendation_manager_actor_ = register_actor("ChannelRecommendationManager", channel_recommendation_manager_.get()); @@ -1188,6 +1203,9 @@ void Td::init_managers() { message_import_manager_ = make_unique(this, create_reference()); message_import_manager_actor_ = register_actor("MessageImportManager", message_import_manager_.get()); G()->set_message_import_manager(message_import_manager_actor_.get()); + message_query_manager_ = make_unique(this, create_reference()); + message_query_manager_actor_ = register_actor("MessageQueryManager", message_query_manager_.get()); + G()->set_message_query_manager(message_query_manager_actor_.get()); messages_manager_ = make_unique(this, create_reference()); messages_manager_actor_ = register_actor("MessagesManager", messages_manager_.get()); G()->set_messages_manager(messages_manager_actor_.get()); @@ -1216,6 +1234,9 @@ void Td::init_managers() { reaction_manager_ = make_unique(this, create_reference()); reaction_manager_actor_ = register_actor("ReactionManager", reaction_manager_.get()); G()->set_reaction_manager(reaction_manager_actor_.get()); + referral_program_manager_ = make_unique(this, create_reference()); + referral_program_manager_actor_ = register_actor("ReferralProgramManager", referral_program_manager_.get()); + G()->set_referral_program_manager(referral_program_manager_actor_.get()); saved_messages_manager_ = make_unique(this, create_reference()); saved_messages_manager_actor_ = register_actor("SavedMessagesManager", saved_messages_manager_.get()); G()->set_saved_messages_manager(saved_messages_manager_actor_.get()); @@ -1235,6 +1256,9 @@ void Td::init_managers() { story_manager_ = make_unique(this, create_reference()); story_manager_actor_ = register_actor("StoryManager", story_manager_.get()); G()->set_story_manager(story_manager_actor_.get()); + suggested_action_manager_ = make_unique(this, create_reference()); + suggested_action_manager_actor_ = register_actor("SuggestedActionManager", suggested_action_manager_.get()); + G()->set_suggested_action_manager(suggested_action_manager_actor_.get()); terms_of_service_manager_ = make_unique(this, create_reference()); terms_of_service_manager_actor_ = register_actor("TermsOfServiceManager", terms_of_service_manager_.get()); theme_manager_ = make_unique(this, create_reference()); @@ -1270,8 +1294,6 @@ void Td::init_managers() { } void Td::init_pure_actor_managers() { - call_manager_ = create_actor("CallManager", create_reference()); - G()->set_call_manager(call_manager_.get()); cashtag_search_hints_ = create_actor("CashtagSearchHints", "cashtag_search", '$', create_reference()); device_token_manager_ = create_actor("DeviceTokenManager", create_reference()); hashtag_hints_ = create_actor("HashtagHints", "text", '#', create_reference()); diff --git a/lib/tgchat/ext/td/td/telegram/Td.h b/lib/tgchat/ext/td/td/telegram/Td.h index 6f55a398..d263c5fc 100644 --- a/lib/tgchat/ext/td/td/telegram/Td.h +++ b/lib/tgchat/ext/td/td/telegram/Td.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -70,6 +70,7 @@ class HashtagHints; class LanguagePackManager; class LinkManager; class MessageImportManager; +class MessageQueryManager; class MessagesManager; class NetStatsManager; class NotificationManager; @@ -84,6 +85,7 @@ class PrivacyManager; class PromoDataManager; class QuickReplyManager; class ReactionManager; +class ReferralProgramManager; class Requests; class SavedMessagesManager; class SecureManager; @@ -96,6 +98,7 @@ class StatisticsManager; class StickersManager; class StorageManager; class StoryManager; +class SuggestedActionManager; class TermsOfServiceManager; class ThemeManager; class TimeZoneManager; @@ -176,6 +179,8 @@ class Td final : public Actor { ActorOwn business_connection_manager_actor_; unique_ptr business_manager_; ActorOwn business_manager_actor_; + unique_ptr call_manager_; + ActorOwn call_manager_actor_; unique_ptr channel_recommendation_manager_; ActorOwn channel_recommendation_manager_actor_; unique_ptr chat_manager_; @@ -216,6 +221,8 @@ class Td final : public Actor { ActorOwn link_manager_actor_; unique_ptr message_import_manager_; ActorOwn message_import_manager_actor_; + unique_ptr message_query_manager_; + ActorOwn message_query_manager_actor_; unique_ptr messages_manager_; ActorOwn messages_manager_actor_; unique_ptr notification_manager_; @@ -238,6 +245,8 @@ class Td final : public Actor { ActorOwn quick_reply_manager_actor_; unique_ptr reaction_manager_; ActorOwn reaction_manager_actor_; + unique_ptr referral_program_manager_; + ActorOwn referral_program_manager_actor_; unique_ptr saved_messages_manager_; ActorOwn saved_messages_manager_actor_; unique_ptr sponsored_message_manager_; @@ -252,6 +261,8 @@ class Td final : public Actor { ActorOwn stickers_manager_actor_; unique_ptr story_manager_; ActorOwn story_manager_actor_; + unique_ptr suggested_action_manager_; + ActorOwn suggested_action_manager_actor_; unique_ptr terms_of_service_manager_; ActorOwn terms_of_service_manager_actor_; unique_ptr theme_manager_; @@ -278,7 +289,6 @@ class Td final : public Actor { ActorOwn web_pages_manager_actor_; ActorOwn alarm_manager_; - ActorOwn call_manager_; ActorOwn cashtag_search_hints_; ActorOwn config_manager_; ActorOwn device_token_manager_; diff --git a/lib/tgchat/ext/td/td/telegram/TdCallback.h b/lib/tgchat/ext/td/td/telegram/TdCallback.h index 82b775dd..83fdb5c4 100644 --- a/lib/tgchat/ext/td/td/telegram/TdCallback.h +++ b/lib/tgchat/ext/td/td/telegram/TdCallback.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TdDb.cpp b/lib/tgchat/ext/td/td/telegram/TdDb.cpp index 5998610c..341bf914 100644 --- a/lib/tgchat/ext/td/td/telegram/TdDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/TdDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -92,6 +92,14 @@ Status init_binlog(Binlog &binlog, string path, BinlogKeyValue &binlog_p case LogEvent::HandlerType::StopPoll: events.to_poll_manager.push_back(event.clone()); break; + case LogEvent::HandlerType::ToggleDialogIsBlockedOnServer: + case LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer: + case LogEvent::HandlerType::ToggleDialogIsPinnedOnServer: + case LogEvent::HandlerType::ToggleDialogIsTranslatableOnServer: + case LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer: + case LogEvent::HandlerType::ToggleDialogViewAsMessagesOnServer: + events.to_dialog_manager.push_back(event.clone()); + break; case LogEvent::HandlerType::SendMessage: case LogEvent::HandlerType::DeleteMessage: case LogEvent::HandlerType::DeleteMessagesOnServer: @@ -104,19 +112,14 @@ Status init_binlog(Binlog &binlog, string path, BinlogKeyValue &binlog_p case LogEvent::HandlerType::DeleteDialogHistoryOnServer: case LogEvent::HandlerType::ReadAllDialogMentionsOnServer: case LogEvent::HandlerType::DeleteAllChannelMessagesFromSenderOnServer: - case LogEvent::HandlerType::ToggleDialogIsPinnedOnServer: case LogEvent::HandlerType::ReorderPinnedDialogsOnServer: case LogEvent::HandlerType::SaveDialogDraftMessageOnServer: case LogEvent::HandlerType::UpdateDialogNotificationSettingsOnServer: - case LogEvent::HandlerType::ResetAllNotificationSettingsOnServer: - case LogEvent::HandlerType::ToggleDialogReportSpamStateOnServer: case LogEvent::HandlerType::RegetDialog: case LogEvent::HandlerType::GetChannelDifference: case LogEvent::HandlerType::ReadHistoryInSecretChat: - case LogEvent::HandlerType::ToggleDialogIsMarkedAsUnreadOnServer: case LogEvent::HandlerType::SetDialogFolderIdOnServer: case LogEvent::HandlerType::DeleteScheduledMessagesOnServer: - case LogEvent::HandlerType::ToggleDialogIsBlockedOnServer: case LogEvent::HandlerType::ReadMessageThreadHistoryOnServer: case LogEvent::HandlerType::BlockMessageSenderFromRepliesOnServer: case LogEvent::HandlerType::UnpinAllDialogMessagesOnServer: @@ -124,8 +127,6 @@ Status init_binlog(Binlog &binlog, string path, BinlogKeyValue &binlog_p case LogEvent::HandlerType::DeleteDialogMessagesByDateOnServer: case LogEvent::HandlerType::ReadAllDialogReactionsOnServer: case LogEvent::HandlerType::DeleteTopicHistoryOnServer: - case LogEvent::HandlerType::ToggleDialogIsTranslatableOnServer: - case LogEvent::HandlerType::ToggleDialogViewAsMessagesOnServer: case LogEvent::HandlerType::SendQuickReplyShortcutMessages: events.to_messages_manager.push_back(event.clone()); break; @@ -136,6 +137,7 @@ Status init_binlog(Binlog &binlog, string path, BinlogKeyValue &binlog_p case LogEvent::HandlerType::EditStory: events.to_story_manager.push_back(event.clone()); break; + case LogEvent::HandlerType::ResetAllNotificationSettingsOnServer: case LogEvent::HandlerType::UpdateScopeNotificationSettingsOnServer: case LogEvent::HandlerType::UpdateReactionNotificationSettingsOnServer: events.to_notification_settings_manager.push_back(event.clone()); diff --git a/lib/tgchat/ext/td/td/telegram/TdDb.h b/lib/tgchat/ext/td/td/telegram/TdDb.h index 70813923..74dcfb24 100644 --- a/lib/tgchat/ext/td/td/telegram/TdDb.h +++ b/lib/tgchat/ext/td/td/telegram/TdDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -73,6 +73,7 @@ class TdDb { vector web_page_events; vector save_app_log_events; vector to_account_manager; + vector to_dialog_manager; vector to_messages_manager; vector to_notification_manager; vector to_notification_settings_manager; diff --git a/lib/tgchat/ext/td/td/telegram/TermsOfService.cpp b/lib/tgchat/ext/td/td/telegram/TermsOfService.cpp index 2faff600..432c9565 100644 --- a/lib/tgchat/ext/td/td/telegram/TermsOfService.cpp +++ b/lib/tgchat/ext/td/td/telegram/TermsOfService.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TermsOfService.h b/lib/tgchat/ext/td/td/telegram/TermsOfService.h index 929d3a07..332bfd4f 100644 --- a/lib/tgchat/ext/td/td/telegram/TermsOfService.h +++ b/lib/tgchat/ext/td/td/telegram/TermsOfService.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TermsOfService.hpp b/lib/tgchat/ext/td/td/telegram/TermsOfService.hpp index e106c39f..68eab1f4 100644 --- a/lib/tgchat/ext/td/td/telegram/TermsOfService.hpp +++ b/lib/tgchat/ext/td/td/telegram/TermsOfService.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.cpp b/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.cpp index 5e1a9123..f2253cc7 100644 --- a/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.h b/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.h index aef96d8d..55b9af07 100644 --- a/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.h +++ b/lib/tgchat/ext/td/td/telegram/TermsOfServiceManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ThemeManager.cpp b/lib/tgchat/ext/td/td/telegram/ThemeManager.cpp index 7a1da650..584d271e 100644 --- a/lib/tgchat/ext/td/td/telegram/ThemeManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/ThemeManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ThemeManager.h b/lib/tgchat/ext/td/td/telegram/ThemeManager.h index 333e47ba..98fd0a6b 100644 --- a/lib/tgchat/ext/td/td/telegram/ThemeManager.h +++ b/lib/tgchat/ext/td/td/telegram/ThemeManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ThemeSettings.cpp b/lib/tgchat/ext/td/td/telegram/ThemeSettings.cpp index 0c2c48f9..d2d23b53 100644 --- a/lib/tgchat/ext/td/td/telegram/ThemeSettings.cpp +++ b/lib/tgchat/ext/td/td/telegram/ThemeSettings.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ThemeSettings.h b/lib/tgchat/ext/td/td/telegram/ThemeSettings.h index fb42915c..88c225f3 100644 --- a/lib/tgchat/ext/td/td/telegram/ThemeSettings.h +++ b/lib/tgchat/ext/td/td/telegram/ThemeSettings.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/ThemeSettings.hpp b/lib/tgchat/ext/td/td/telegram/ThemeSettings.hpp index 7b91b859..0fb43469 100644 --- a/lib/tgchat/ext/td/td/telegram/ThemeSettings.hpp +++ b/lib/tgchat/ext/td/td/telegram/ThemeSettings.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TimeZoneManager.cpp b/lib/tgchat/ext/td/td/telegram/TimeZoneManager.cpp index 939fdeac..1fd27492 100644 --- a/lib/tgchat/ext/td/td/telegram/TimeZoneManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/TimeZoneManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TimeZoneManager.h b/lib/tgchat/ext/td/td/telegram/TimeZoneManager.h index 0fe9ae8b..72a54db0 100644 --- a/lib/tgchat/ext/td/td/telegram/TimeZoneManager.h +++ b/lib/tgchat/ext/td/td/telegram/TimeZoneManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TopDialogCategory.cpp b/lib/tgchat/ext/td/td/telegram/TopDialogCategory.cpp index 70cb794e..e21a61a9 100644 --- a/lib/tgchat/ext/td/td/telegram/TopDialogCategory.cpp +++ b/lib/tgchat/ext/td/td/telegram/TopDialogCategory.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TopDialogCategory.h b/lib/tgchat/ext/td/td/telegram/TopDialogCategory.h index 6bcec0d2..c7cb494d 100644 --- a/lib/tgchat/ext/td/td/telegram/TopDialogCategory.h +++ b/lib/tgchat/ext/td/td/telegram/TopDialogCategory.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TopDialogManager.cpp b/lib/tgchat/ext/td/td/telegram/TopDialogManager.cpp index d2dafbf4..34070c3d 100644 --- a/lib/tgchat/ext/td/td/telegram/TopDialogManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/TopDialogManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TopDialogManager.h b/lib/tgchat/ext/td/td/telegram/TopDialogManager.h index 347c61e3..9065e324 100644 --- a/lib/tgchat/ext/td/td/telegram/TopDialogManager.h +++ b/lib/tgchat/ext/td/td/telegram/TopDialogManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.cpp b/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.cpp index 16c80251..36b835ac 100644 --- a/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.cpp +++ b/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.h b/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.h index 5e981b24..06a95673 100644 --- a/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.h +++ b/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.hpp b/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.hpp index 21d89dc8..8b1ce0ae 100644 --- a/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.hpp +++ b/lib/tgchat/ext/td/td/telegram/TranscriptionInfo.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranscriptionManager.cpp b/lib/tgchat/ext/td/td/telegram/TranscriptionManager.cpp index 1c362db5..bc63aeb8 100644 --- a/lib/tgchat/ext/td/td/telegram/TranscriptionManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/TranscriptionManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranscriptionManager.h b/lib/tgchat/ext/td/td/telegram/TranscriptionManager.h index adad7099..fd53fb5d 100644 --- a/lib/tgchat/ext/td/td/telegram/TranscriptionManager.h +++ b/lib/tgchat/ext/td/td/telegram/TranscriptionManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranslationManager.cpp b/lib/tgchat/ext/td/td/telegram/TranslationManager.cpp index e7ecdd57..7df29fab 100644 --- a/lib/tgchat/ext/td/td/telegram/TranslationManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/TranslationManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/TranslationManager.h b/lib/tgchat/ext/td/td/telegram/TranslationManager.h index 67d454d8..22ee519d 100644 --- a/lib/tgchat/ext/td/td/telegram/TranslationManager.h +++ b/lib/tgchat/ext/td/td/telegram/TranslationManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UniqueId.h b/lib/tgchat/ext/td/td/telegram/UniqueId.h index 36e59137..5ac72813 100644 --- a/lib/tgchat/ext/td/td/telegram/UniqueId.h +++ b/lib/tgchat/ext/td/td/telegram/UniqueId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UpdatesManager.cpp b/lib/tgchat/ext/td/td/telegram/UpdatesManager.cpp index 5b76da78..c2462ff1 100644 --- a/lib/tgchat/ext/td/td/telegram/UpdatesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/UpdatesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -66,6 +66,7 @@ #include "td/telegram/SecretChatsManager.h" #include "td/telegram/ServerMessageId.h" #include "td/telegram/SpecialStickerSetType.h" +#include "td/telegram/StarAmount.h" #include "td/telegram/StarManager.h" #include "td/telegram/StateManager.h" #include "td/telegram/StatisticsManager.h" @@ -988,6 +989,7 @@ bool UpdatesManager::is_acceptable_message(const telegram_api::Message *message_ case telegram_api::messageActionGiftStars::ID: case telegram_api::messageActionPrizeStars::ID: case telegram_api::messageActionStarGift::ID: + case telegram_api::messageActionStarGiftUnique::ID: break; case telegram_api::messageActionChatCreate::ID: { auto chat_create = static_cast(action); @@ -1198,7 +1200,7 @@ void UpdatesManager::on_get_updates_impl(tl_object_ptr up make_tl_object(from_id), 0, make_tl_object(update->user_id_), nullptr, std::move(update->fwd_from_), update->via_bot_id_, 0, std::move(update->reply_to_), update->date_, update->message_, nullptr, nullptr, std::move(update->entities_), 0, 0, nullptr, 0, string(), 0, nullptr, - Auto(), update->ttl_period_, 0, 0, nullptr); + Auto(), update->ttl_period_, 0, 0, nullptr, 0); on_pending_update( make_tl_object(std::move(message), update->pts_, update->pts_count_), 0, std::move(promise), "telegram_api::updateShortMessage"); @@ -1213,7 +1215,7 @@ void UpdatesManager::on_get_updates_impl(tl_object_ptr up make_tl_object(update->chat_id_), nullptr, std::move(update->fwd_from_), update->via_bot_id_, 0, std::move(update->reply_to_), update->date_, update->message_, nullptr, nullptr, std::move(update->entities_), 0, 0, nullptr, 0, string(), 0, nullptr, Auto(), update->ttl_period_, 0, 0, - nullptr); + nullptr, 0); on_pending_update( make_tl_object(std::move(message), update->pts_, update->pts_count_), 0, std::move(promise), "telegram_api::updateShortChatMessage"); @@ -4354,7 +4356,7 @@ void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { DialogId dialog_id(ChatId(update->chat_id_)); - if (!td_->dialog_manager_->have_dialog_force(dialog_id, "updateGroupCall")) { + if (dialog_id != DialogId() && !td_->dialog_manager_->have_dialog_force(dialog_id, "updateGroupCall")) { dialog_id = DialogId(ChannelId(update->chat_id_)); if (!td_->dialog_manager_->have_dialog_force(dialog_id, "updateGroupCall")) { dialog_id = DialogId(); @@ -4616,7 +4618,7 @@ void UpdatesManager::on_update(tl_object_ptr update, Promise &&promise) { - td_->star_manager_->on_update_owned_star_count(StarManager::get_star_count(update->balance_, true)); + td_->star_manager_->on_update_owned_star_amount(StarAmount(std::move(update->balance_), true)); promise.set_value(Unit()); } diff --git a/lib/tgchat/ext/td/td/telegram/UpdatesManager.h b/lib/tgchat/ext/td/td/telegram/UpdatesManager.h index 103623bf..817cd710 100644 --- a/lib/tgchat/ext/td/td/telegram/UpdatesManager.h +++ b/lib/tgchat/ext/td/td/telegram/UpdatesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UserId.h b/lib/tgchat/ext/td/td/telegram/UserId.h index 8a5fa1db..9c0544af 100644 --- a/lib/tgchat/ext/td/td/telegram/UserId.h +++ b/lib/tgchat/ext/td/td/telegram/UserId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UserManager.cpp b/lib/tgchat/ext/td/td/telegram/UserManager.cpp index d9dc594a..10b0ddbf 100644 --- a/lib/tgchat/ext/td/td/telegram/UserManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/UserManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -11,6 +11,9 @@ #include "td/telegram/Birthdate.hpp" #include "td/telegram/BlockListId.h" #include "td/telegram/BotMenuButton.h" +#include "td/telegram/BotVerification.h" +#include "td/telegram/BotVerification.hpp" +#include "td/telegram/BotVerifierSettings.hpp" #include "td/telegram/BusinessAwayMessage.h" #include "td/telegram/BusinessGreetingMessage.h" #include "td/telegram/BusinessInfo.h" @@ -53,6 +56,7 @@ #include "td/telegram/PremiumGiftOption.hpp" #include "td/telegram/ReactionListType.h" #include "td/telegram/ReactionManager.h" +#include "td/telegram/ReferralProgramInfo.hpp" #include "td/telegram/SecretChatLayer.h" #include "td/telegram/SecretChatsManager.h" #include "td/telegram/ServerMessageId.h" @@ -64,6 +68,7 @@ #include "td/telegram/telegram_api.h" #include "td/telegram/ThemeManager.h" #include "td/telegram/UpdatesManager.h" +#include "td/telegram/VerificationStatus.h" #include "td/telegram/Version.h" #include "td/db/binlog/BinlogEvent.h" @@ -1438,6 +1443,7 @@ void UserManager::User::store(StorerT &storer) const { bool has_profile_accent_color_id = profile_accent_color_id.is_valid(); bool has_profile_background_custom_emoji_id = profile_background_custom_emoji_id.is_valid(); bool has_bot_active_users = bot_active_users != 0; + bool has_bot_verification_icon = bot_verification_icon.is_valid(); BEGIN_STORE_FLAGS(); STORE_FLAG(is_received); STORE_FLAG(is_verified); @@ -1486,6 +1492,7 @@ void UserManager::User::store(StorerT &storer) const { STORE_FLAG(is_business_bot); STORE_FLAG(has_bot_active_users); STORE_FLAG(has_main_app); + STORE_FLAG(has_bot_verification_icon); END_STORE_FLAGS(); } store(first_name, storer); @@ -1545,6 +1552,9 @@ void UserManager::User::store(StorerT &storer) const { if (has_bot_active_users) { store(bot_active_users, storer); } + if (has_bot_verification_icon) { + store(bot_verification_icon, storer); + } } template @@ -1571,6 +1581,7 @@ void UserManager::User::parse(ParserT &parser) { bool has_profile_accent_color_id = false; bool has_profile_background_custom_emoji_id = false; bool has_bot_active_users = false; + bool has_bot_verification_icon = false; BEGIN_PARSE_FLAGS(); PARSE_FLAG(is_received); PARSE_FLAG(is_verified); @@ -1619,6 +1630,7 @@ void UserManager::User::parse(ParserT &parser) { PARSE_FLAG(is_business_bot); PARSE_FLAG(has_bot_active_users); PARSE_FLAG(has_main_app); + PARSE_FLAG(has_bot_verification_icon); END_PARSE_FLAGS(); } parse(first_name, parser); @@ -1706,6 +1718,9 @@ void UserManager::User::parse(ParserT &parser) { if (has_bot_active_users) { parse(bot_active_users, parser); } + if (has_bot_verification_icon) { + parse(bot_verification_icon, parser); + } if (!check_utf8(first_name)) { LOG(ERROR) << "Have invalid first name \"" << first_name << '"'; @@ -1762,6 +1777,9 @@ void UserManager::UserFull::store(StorerT &storer) const { bool has_background_dark_color = bot_info != nullptr && bot_info->background_dark_color != -1; bool has_header_color = bot_info != nullptr && bot_info->header_color != -1; bool has_header_dark_color = bot_info != nullptr && bot_info->header_dark_color != -1; + bool has_referral_program_info = bot_info != nullptr && bot_info->referral_program_info.is_valid(); + bool has_verifier_settings = bot_info != nullptr && bot_info->verifier_settings != nullptr; + bool has_bot_verification = bot_verification != nullptr; BEGIN_STORE_FLAGS(); STORE_FLAG(has_about); STORE_FLAG(is_blocked); @@ -1806,6 +1824,9 @@ void UserManager::UserFull::store(StorerT &storer) const { STORE_FLAG(has_background_dark_color); STORE_FLAG(has_header_color); STORE_FLAG(has_header_dark_color); + STORE_FLAG(has_referral_program_info); + STORE_FLAG(has_verifier_settings); + STORE_FLAG(has_bot_verification); END_STORE_FLAGS(); } if (has_about) { @@ -1877,6 +1898,15 @@ void UserManager::UserFull::store(StorerT &storer) const { if (has_header_dark_color) { store(bot_info->header_dark_color, storer); } + if (has_referral_program_info) { + store(bot_info->referral_program_info, storer); + } + if (has_verifier_settings) { + store(bot_info->verifier_settings, storer); + } + if (has_bot_verification) { + store(bot_verification, storer); + } } template @@ -1906,6 +1936,9 @@ void UserManager::UserFull::parse(ParserT &parser) { bool has_background_dark_color = false; bool has_header_color = false; bool has_header_dark_color = false; + bool has_referral_program_info = false; + bool has_verifier_settings = false; + bool has_bot_verification = false; BEGIN_PARSE_FLAGS(); PARSE_FLAG(has_about); PARSE_FLAG(is_blocked); @@ -1950,6 +1983,9 @@ void UserManager::UserFull::parse(ParserT &parser) { PARSE_FLAG(has_background_dark_color); PARSE_FLAG(has_header_color); PARSE_FLAG(has_header_dark_color); + PARSE_FLAG(has_referral_program_info); + PARSE_FLAG(has_verifier_settings); + PARSE_FLAG(has_bot_verification); END_PARSE_FLAGS(); } if (has_about) { @@ -2025,6 +2061,15 @@ void UserManager::UserFull::parse(ParserT &parser) { if (has_header_dark_color) { parse(add_bot_info()->header_dark_color, parser); } + if (has_referral_program_info) { + parse(add_bot_info()->referral_program_info, parser); + } + if (has_verifier_settings) { + parse(add_bot_info()->verifier_settings, parser); + } + if (has_bot_verification) { + parse(bot_verification, parser); + } } template @@ -2704,6 +2749,7 @@ void UserManager::on_get_user(telegram_api::object_ptr &&use u->restriction_reasons = std::move(restriction_reasons); u->is_changed = true; } + on_update_user_bot_verification_icon(u, user_id, CustomEmojiId(user->bot_verification_icon_)); } if (u->cache_version != User::CACHE_VERSION && u->is_received) { @@ -3173,6 +3219,13 @@ void UserManager::on_update_user_stories_hidden(User *u, UserId user_id, bool st } } +void UserManager::on_update_user_bot_verification_icon(User *u, UserId user_id, CustomEmojiId bot_verification_icon) { + if (u->bot_verification_icon != bot_verification_icon) { + u->bot_verification_icon = bot_verification_icon; + u->is_changed = true; + } +} + void UserManager::on_update_user_is_contact(User *u, UserId user_id, bool is_contact, bool is_mutual_contact, bool is_close_friend) { if (td_->auth_manager_->is_bot()) { @@ -3581,6 +3634,49 @@ void UserManager::on_update_user_full_commands( } } +void UserManager::on_update_user_referral_program_info(UserId user_id, ReferralProgramInfo &&referral_program_info) { + UserFull *user_full = get_user_full_force(user_id, "on_update_user_referral_program_info"); + if (user_full != nullptr) { + on_update_user_full_referral_program_info(user_full, user_id, std::move(referral_program_info)); + update_user_full(user_full, user_id, "on_update_user_referral_program_info"); + } +} + +void UserManager::on_update_user_full_referral_program_info(UserFull *user_full, UserId user_id, + ReferralProgramInfo &&referral_program_info) { + CHECK(user_full != nullptr); + if (user_full->bot_info == nullptr && !referral_program_info.is_valid()) { + return; + } + auto bot_info = user_full->add_bot_info(); + if (bot_info->referral_program_info != referral_program_info) { + bot_info->referral_program_info = std::move(referral_program_info); + user_full->is_changed = true; + } +} + +void UserManager::on_update_user_verifier_settings(UserId user_id, + unique_ptr &&verifier_settings) { + UserFull *user_full = get_user_full_force(user_id, "on_update_user_verifier_settings"); + if (user_full != nullptr) { + on_update_user_full_verifier_settings(user_full, user_id, std::move(verifier_settings)); + update_user_full(user_full, user_id, "on_update_user_verifier_settings"); + } +} + +void UserManager::on_update_user_full_verifier_settings(UserFull *user_full, UserId user_id, + unique_ptr &&verifier_settings) { + CHECK(user_full != nullptr); + if (user_full->bot_info == nullptr && verifier_settings == nullptr) { + return; + } + auto bot_info = user_full->add_bot_info(); + if (bot_info->verifier_settings != verifier_settings) { + bot_info->verifier_settings = std::move(verifier_settings); + user_full->is_changed = true; + } +} + void UserManager::on_update_user_need_phone_number_privacy_exception(UserId user_id, bool need_phone_number_privacy_exception) { LOG(INFO) << "Receive " << need_phone_number_privacy_exception << " need phone number privacy exception with " @@ -4091,7 +4187,7 @@ UserManager::User *UserManager::get_user_force(UserId user_id, const char *sourc false /*ignored*/, false /*ignored*/, false /*ignored*/, 0, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, user_id.get(), 1, first_name, string(), username, phone_number, std::move(profile_photo), nullptr, bot_info_version, Auto(), - string(), string(), nullptr, vector>(), 0, nullptr, nullptr, + string(), string(), nullptr, vector>(), 0, nullptr, nullptr, 0, 0); on_get_user(std::move(user), "get_user_force"); u = get_user(user_id); @@ -4882,6 +4978,7 @@ void UserManager::set_bot_profile_photo(UserId bot_user_id, void UserManager::set_profile_photo(const td_api::object_ptr &input_photo, bool is_fallback, Promise &&promise) { + dismiss_suggested_action(SuggestedAction{SuggestedAction::Type::UserpicSetup}, Promise()); set_profile_photo_impl(get_my_id(), input_photo, is_fallback, false, std::move(promise)); } @@ -7130,11 +7227,13 @@ void UserManager::on_get_user_full(telegram_api::object_ptrpersonal_channel_id_); auto sponsored_enabled = user->sponsored_enabled_; auto can_view_revenue = user->can_view_revenue_; + auto bot_verification = BotVerification::get_bot_verification(std::move(user->bot_verification_)); if (user_full->can_be_called != can_be_called || user_full->supports_video_calls != supports_video_calls || user_full->has_private_calls != has_private_calls || user_full->voice_messages_forbidden != voice_messages_forbidden || user_full->can_pin_messages != can_pin_messages || user_full->has_pinned_stories != has_pinned_stories || - user_full->sponsored_enabled != sponsored_enabled || user_full->can_view_revenue != can_view_revenue) { + user_full->sponsored_enabled != sponsored_enabled || user_full->can_view_revenue != can_view_revenue || + user_full->bot_verification != bot_verification) { user_full->can_be_called = can_be_called; user_full->supports_video_calls = supports_video_calls; user_full->has_private_calls = has_private_calls; @@ -7143,6 +7242,7 @@ void UserManager::on_get_user_full(telegram_api::object_ptrhas_pinned_stories = has_pinned_stories; user_full->sponsored_enabled = sponsored_enabled; user_full->can_view_revenue = can_view_revenue; + user_full->bot_verification = std::move(bot_verification); user_full->is_changed = true; } @@ -7177,10 +7277,21 @@ void UserManager::on_get_user_full(telegram_api::object_ptradd_bot_info(); AdministratorRights group_administrator_rights(user->bot_group_admin_rights_, ChannelType::Megagroup); AdministratorRights broadcast_administrator_rights(user->bot_broadcast_admin_rights_, ChannelType::Broadcast); + ReferralProgramInfo referral_program_info; + if (user->starref_program_ != nullptr) { + auto bot_user_id = UserId(user->starref_program_->bot_id_); + if (user_id == bot_user_id) { + referral_program_info = ReferralProgramInfo(std::move(user->starref_program_)); + } else { + LOG(ERROR) << "Receive affiliate program for " << bot_user_id << " instead of " << user_id; + } + } if (bot_info->group_administrator_rights != group_administrator_rights || - bot_info->broadcast_administrator_rights != broadcast_administrator_rights) { - bot_info->group_administrator_rights = group_administrator_rights; - bot_info->broadcast_administrator_rights = broadcast_administrator_rights; + bot_info->broadcast_administrator_rights != broadcast_administrator_rights || + bot_info->referral_program_info != referral_program_info) { + bot_info->group_administrator_rights = std::move(group_administrator_rights); + bot_info->broadcast_administrator_rights = std::move(broadcast_administrator_rights); + bot_info->referral_program_info = std::move(referral_program_info); user_full->is_changed = true; } @@ -7193,6 +7304,7 @@ void UserManager::on_get_user_full(telegram_api::object_ptrbot_info_ != nullptr) { description = std::move(user->bot_info_->description_); description_photo = get_photo(td_, std::move(user->bot_info_->description_photo_), DialogId(user_id)); @@ -7201,7 +7313,7 @@ void UserManager::on_get_user_full(telegram_api::object_ptrget_id(); if (document_id == telegram_api::document::ID) { auto parsed_document = td_->documents_manager_->on_get_document( - move_tl_object_as(document), DialogId(user_id)); + move_tl_object_as(document), DialogId(user_id), false); if (parsed_document.type == Document::Type::Animation) { description_animation_file_id = parsed_document.file_id; } else { @@ -7213,6 +7325,9 @@ void UserManager::on_get_user_full(telegram_api::object_ptrbot_info_->commands_)); on_update_user_full_menu_button(user_full, user_id, std::move(user->bot_info_->menu_button_)); on_update_user_full_has_preview_medias(user_full, user_id, user->bot_info_->has_preview_medias_); + on_update_user_full_verifier_settings( + user_full, user_id, + BotVerifierSettings::get_bot_verifier_settings(std::move(user->bot_info_->verifier_settings_))); if (bot_info->privacy_policy_url != user->bot_info_->privacy_policy_url_) { bot_info->privacy_policy_url = std::move(user->bot_info_->privacy_policy_url_); @@ -7394,6 +7509,9 @@ void UserManager::on_load_user_full_from_database(UserId user_id, string value) if (user_full->business_info != nullptr) { user_full->business_info->add_dependencies(dependencies); } + if (user_full->bot_verification != nullptr) { + user_full->bot_verification->add_dependencies(dependencies); + } dependencies.add(user_full->personal_channel_id); if (!dependencies.resolve_force(td_, "on_load_user_full_from_database")) { users_full_.erase(user_id); @@ -7521,6 +7639,7 @@ void UserManager::drop_user_full(UserId user_id) { user_full->common_chat_count = 0; user_full->personal_channel_id = ChannelId(); user_full->business_info = nullptr; + user_full->bot_verification = nullptr; user_full->private_forward_name.clear(); user_full->voice_messages_forbidden = false; user_full->has_pinned_stories = false; @@ -8180,8 +8299,8 @@ td_api::object_ptr UserManager::get_update_unknown_user_obje return td_api::make_object(td_api::make_object( user_id.get(), "", "", nullptr, "", td_api::make_object(), nullptr, td_->theme_manager_->get_accent_color_id_object(AccentColorId(user_id)), 0, -1, 0, nullptr, false, false, false, - false, false, false, "", false, false, false, false, false, have_access, - td_api::make_object(), "", false)); + nullptr, false, false, "", false, false, false, have_access, td_api::make_object(), "", + false)); } int64 UserManager::get_user_id_object(UserId user_id, const char *source) const { @@ -8220,6 +8339,8 @@ td_api::object_ptr UserManager::get_user_object(UserId user_id, co } auto emoji_status = u->last_sent_emoji_status.get_emoji_status_object(); + auto verification_status = + get_verification_status_object(td_, u->is_verified, u->is_scam, u->is_fake, u->bot_verification_icon); auto have_access = user_id == get_my_id() || have_input_peer_user(u, user_id, AccessRights::Know); auto restricts_new_chats = u->contact_require_premium && !u->is_mutual_contact; return td_api::make_object( @@ -8230,10 +8351,10 @@ td_api::object_ptr UserManager::get_user_object(UserId user_id, co u->background_custom_emoji_id.get(), td_->theme_manager_->get_profile_accent_color_id_object(u->profile_accent_color_id), u->profile_background_custom_emoji_id.get(), std::move(emoji_status), u->is_contact, u->is_mutual_contact, - u->is_close_friend, u->is_verified, u->is_premium, u->is_support, - get_restriction_reason_description(u->restriction_reasons), u->is_scam, u->is_fake, - u->max_active_story_id.is_valid(), get_user_has_unread_stories(u), restricts_new_chats, have_access, - std::move(type), u->language_code, u->attach_menu_enabled); + u->is_close_friend, std::move(verification_status), u->is_premium, u->is_support, + get_restriction_reason_description(u->restriction_reasons), u->max_active_story_id.is_valid(), + get_user_has_unread_stories(u), restricts_new_chats, have_access, std::move(type), u->language_code, + u->attach_menu_enabled); } vector UserManager::get_user_ids_object(const vector &user_ids, const char *source) const { @@ -8263,9 +8384,9 @@ td_api::object_ptr UserManager::get_user_full_info_object( if (is_bot) { if (user_full->bot_info == nullptr) { bot_info = td_api::make_object( - user_full->about, string(), nullptr, nullptr, nullptr, Auto(), string(), nullptr, nullptr, -1, -1, -1, -1, - user_full->can_view_revenue, user_full->can_manage_emoji_status, user_full->has_preview_medias, nullptr, - nullptr, nullptr, nullptr); + user_full->about, string(), nullptr, nullptr, nullptr, Auto(), string(), nullptr, nullptr, nullptr, -1, -1, + -1, -1, nullptr, user_full->can_view_revenue, user_full->can_manage_emoji_status, + user_full->has_preview_medias, nullptr, nullptr, nullptr, nullptr); } else { const auto *user_bot_info = user_full->bot_info.get(); auto menu_button = get_bot_menu_button_object(td_, user_bot_info->menu_button.get()); @@ -8282,9 +8403,13 @@ td_api::object_ptr UserManager::get_user_full_info_object( user_bot_info->broadcast_administrator_rights == AdministratorRights() ? nullptr : user_bot_info->broadcast_administrator_rights.get_chat_administrator_rights_object(), - user_bot_info->background_color, user_bot_info->background_dark_color, user_bot_info->header_color, - user_bot_info->header_dark_color, user_full->can_view_revenue, user_full->can_manage_emoji_status, - user_full->has_preview_medias, nullptr, nullptr, nullptr, nullptr); + user_bot_info->referral_program_info.get_affiliate_program_info_object(), user_bot_info->background_color, + user_bot_info->background_dark_color, user_bot_info->header_color, user_bot_info->header_dark_color, + user_bot_info->verifier_settings == nullptr + ? nullptr + : user_bot_info->verifier_settings->get_bot_verification_parameters_object(td_), + user_full->can_view_revenue, user_full->can_manage_emoji_status, user_full->has_preview_medias, nullptr, + nullptr, nullptr, nullptr); } if (u != nullptr && u->can_be_edited_bot && u->usernames.has_editable_username()) { auto bot_username = u->usernames.get_editable_username(); @@ -8326,6 +8451,8 @@ td_api::object_ptr UserManager::get_user_full_info_object( td_->dialog_manager_->force_create_dialog(dialog_id, "get_user_full_info_object", true); personal_chat_id = td_->dialog_manager_->get_chat_id_object(dialog_id, "get_user_full_info_object"); } + auto bot_verification = + user_full->bot_verification == nullptr ? nullptr : user_full->bot_verification->get_bot_verification_object(td_); return td_api::make_object( get_chat_photo_object(td_->file_manager_.get(), user_full->personal_photo), get_chat_photo_object(td_->file_manager_.get(), user_full->photo), @@ -8334,7 +8461,7 @@ td_api::object_ptr UserManager::get_user_full_info_object( !user_full->private_forward_name.empty(), voice_messages_forbidden, user_full->has_pinned_stories, user_full->sponsored_enabled, user_full->need_phone_number_privacy_exception, user_full->wallpaper_overridden, std::move(bio_object), user_full->birthdate.get_birthdate_object(), personal_chat_id, user_full->gift_count, - user_full->common_chat_count, std::move(business_info), std::move(bot_info)); + user_full->common_chat_count, std::move(bot_verification), std::move(business_info), std::move(bot_info)); } td_api::object_ptr UserManager::get_update_contact_close_birthdays() const { diff --git a/lib/tgchat/ext/td/td/telegram/UserManager.h b/lib/tgchat/ext/td/td/telegram/UserManager.h index 72ab9b04..b7b9c926 100644 --- a/lib/tgchat/ext/td/td/telegram/UserManager.h +++ b/lib/tgchat/ext/td/td/telegram/UserManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -11,6 +11,7 @@ #include "td/telegram/Birthdate.h" #include "td/telegram/BotCommand.h" #include "td/telegram/BotMenuButton.h" +#include "td/telegram/BotVerifierSettings.h" #include "td/telegram/ChannelId.h" #include "td/telegram/Contact.h" #include "td/telegram/CustomEmojiId.h" @@ -26,6 +27,7 @@ #include "td/telegram/Photo.h" #include "td/telegram/QueryCombiner.h" #include "td/telegram/QueryMerger.h" +#include "td/telegram/ReferralProgramInfo.h" #include "td/telegram/RestrictionReason.h" #include "td/telegram/SecretChatId.h" #include "td/telegram/StoryId.h" @@ -57,6 +59,7 @@ namespace td { struct BinlogEvent; +class BotVerification; class BusinessAwayMessage; class BusinessGreetingMessage; class BusinessInfo; @@ -157,6 +160,10 @@ class UserManager final : public Actor { void on_update_user_commands(UserId user_id, vector> &&bot_commands); + void on_update_user_referral_program_info(UserId user_id, ReferralProgramInfo &&referral_program_info); + + void on_update_user_verifier_settings(UserId user_id, unique_ptr &&verifier_settings); + void on_update_user_need_phone_number_privacy_exception(UserId user_id, bool need_phone_number_privacy_exception); void on_update_user_wallpaper_overridden(UserId user_id, bool wallpaper_overridden); @@ -505,6 +512,8 @@ class UserManager final : public Actor { int32 bot_active_users = 0; int32 bot_info_version = -1; + CustomEmojiId bot_verification_icon; + AccentColorId accent_color_id; CustomEmojiId background_custom_emoji_id; AccentColorId profile_accent_color_id; @@ -597,6 +606,8 @@ class UserManager final : public Actor { string privacy_policy_url; AdministratorRights group_administrator_rights; AdministratorRights broadcast_administrator_rights; + ReferralProgramInfo referral_program_info; + unique_ptr verifier_settings; string placeholder_path; int32 background_color = -1; @@ -624,6 +635,7 @@ class UserManager final : public Actor { unique_ptr bot_info; unique_ptr business_info; + unique_ptr bot_verification; bool is_blocked = false; bool is_blocked_for_stories = false; @@ -848,6 +860,8 @@ class UserManager final : public Actor { void on_update_user_stories_hidden(User *u, UserId user_id, bool stories_hidden); + void on_update_user_bot_verification_icon(User *u, UserId user_id, CustomEmojiId bot_verification_icon); + void on_update_user_is_contact(User *u, UserId user_id, bool is_contact, bool is_mutual_contact, bool is_close_friend); @@ -876,6 +890,12 @@ class UserManager final : public Actor { static void on_update_user_full_commands(UserFull *user_full, UserId user_id, vector> &&bot_commands); + void on_update_user_full_referral_program_info(UserFull *user_full, UserId user_id, + ReferralProgramInfo &&referral_program_info); + + void on_update_user_full_verifier_settings(UserFull *user_full, UserId user_id, + unique_ptr &&verifier_settings); + void on_update_user_full_need_phone_number_privacy_exception(UserFull *user_full, UserId user_id, bool need_phone_number_privacy_exception) const; diff --git a/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.cpp b/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.cpp index 372daa9b..36de5a3d 100644 --- a/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.cpp +++ b/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.h b/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.h index 3eef0f74..dfa9cc7c 100644 --- a/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.h +++ b/lib/tgchat/ext/td/td/telegram/UserPrivacySetting.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.cpp b/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.cpp index 17e58f93..2d9513db 100644 --- a/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.cpp +++ b/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.h b/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.h index 982828f7..a9ae1152 100644 --- a/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.h +++ b/lib/tgchat/ext/td/td/telegram/UserPrivacySettingRule.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/UserStarGift.cpp b/lib/tgchat/ext/td/td/telegram/UserStarGift.cpp new file mode 100644 index 00000000..611ce701 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/UserStarGift.cpp @@ -0,0 +1,62 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/UserStarGift.h" + +#include "td/telegram/DialogId.h" +#include "td/telegram/ServerMessageId.h" +#include "td/telegram/StarGiftManager.h" +#include "td/telegram/StarManager.h" +#include "td/telegram/Td.h" +#include "td/telegram/UserManager.h" + +#include "td/utils/logging.h" + +namespace td { + +UserStarGift::UserStarGift(Td *td, telegram_api::object_ptr &&gift, bool is_me) + : sender_user_id_(gift->from_id_) + , gift_(td, std::move(gift->gift_), true) + , message_(get_formatted_text(td->user_manager_.get(), std::move(gift->message_), true, false, "userStarGift")) + , message_id_(ServerMessageId(gift->msg_id_)) + , convert_star_count_(StarManager::get_star_count(gift->convert_stars_)) + , upgrade_star_count_(StarManager::get_star_count(gift->upgrade_stars_)) + , transfer_star_count_(StarManager::get_star_count(gift->transfer_stars_)) + , date_(gift->date_) + , can_export_at_(max(0, gift->can_export_at_)) + , is_name_hidden_(gift->name_hidden_) + , is_saved_(!gift->unsaved_) + , can_upgrade_(gift->can_upgrade_) + , can_transfer_((gift->flags_ & telegram_api::userStarGift::TRANSFER_STARS_MASK) != 0) + , was_refunded_(gift->refunded_) { + if (sender_user_id_ != UserId() && !sender_user_id_.is_valid()) { + LOG(ERROR) << "Receive " << sender_user_id_ << " as sender of a gift"; + sender_user_id_ = UserId(); + } + if (!is_saved_ && !is_me) { + LOG(ERROR) << "Receive non-saved gift for another user"; + is_saved_ = true; + } + if (message_id_ != MessageId() && !message_id_.is_valid()) { + LOG(ERROR) << "Receive " << message_id_; + message_id_ = MessageId(); + } + td->star_gift_manager_->on_get_star_gift(gift_, true); + if (is_me && message_id_.is_valid() && sender_user_id_ != UserId()) { + td->star_gift_manager_->on_get_user_star_gift({DialogId(sender_user_id_), message_id_}, can_upgrade_, + upgrade_star_count_ > 0 ? 0 : gift_.get_upgrade_star_count()); + } +} + +td_api::object_ptr UserStarGift::get_user_gift_object(Td *td) const { + return td_api::make_object( + td->user_manager_->get_user_id_object(sender_user_id_, "userGift"), + get_formatted_text_object(td->user_manager_.get(), message_, true, -1), is_name_hidden_, is_saved_, can_upgrade_, + can_transfer_, was_refunded_, date_, gift_.get_sent_gift_object(td), message_id_.get(), convert_star_count_, + upgrade_star_count_, transfer_star_count_, can_export_at_); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/UserStarGift.h b/lib/tgchat/ext/td/td/telegram/UserStarGift.h new file mode 100644 index 00000000..7dba1f01 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/UserStarGift.h @@ -0,0 +1,48 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/MessageEntity.h" +#include "td/telegram/MessageId.h" +#include "td/telegram/StarGift.h" +#include "td/telegram/td_api.h" +#include "td/telegram/telegram_api.h" +#include "td/telegram/UserId.h" + +#include "td/utils/common.h" + +namespace td { + +class Td; + +class UserStarGift { + UserId sender_user_id_; + StarGift gift_; + FormattedText message_; + MessageId message_id_; + int64 convert_star_count_ = 0; + int64 upgrade_star_count_ = 0; + int64 transfer_star_count_ = 0; + int32 date_ = 0; + int32 can_export_at_ = 0; + bool is_name_hidden_ = false; + bool is_saved_ = false; + bool can_upgrade_ = false; + bool can_transfer_ = false; + bool was_refunded_ = false; + + public: + UserStarGift(Td *td, telegram_api::object_ptr &&gift, bool is_me); + + bool is_valid() const { + return gift_.is_valid() && (is_name_hidden_ || sender_user_id_ != UserId()); + } + + td_api::object_ptr get_user_gift_object(Td *td) const; +}; + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/Usernames.cpp b/lib/tgchat/ext/td/td/telegram/Usernames.cpp index 1747b6df..992db430 100644 --- a/lib/tgchat/ext/td/td/telegram/Usernames.cpp +++ b/lib/tgchat/ext/td/td/telegram/Usernames.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Usernames.h b/lib/tgchat/ext/td/td/telegram/Usernames.h index 37f8f3c7..a4cfbf37 100644 --- a/lib/tgchat/ext/td/td/telegram/Usernames.h +++ b/lib/tgchat/ext/td/td/telegram/Usernames.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Venue.cpp b/lib/tgchat/ext/td/td/telegram/Venue.cpp index 08d84e28..54c4c398 100644 --- a/lib/tgchat/ext/td/td/telegram/Venue.cpp +++ b/lib/tgchat/ext/td/td/telegram/Venue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/Venue.h b/lib/tgchat/ext/td/td/telegram/Venue.h index 303bac4d..350235a4 100644 --- a/lib/tgchat/ext/td/td/telegram/Venue.h +++ b/lib/tgchat/ext/td/td/telegram/Venue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VerificationStatus.cpp b/lib/tgchat/ext/td/td/telegram/VerificationStatus.cpp new file mode 100644 index 00000000..cdda0902 --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/VerificationStatus.cpp @@ -0,0 +1,20 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/VerificationStatus.h" + +namespace td { + +td_api::object_ptr get_verification_status_object( + Td *td, bool is_verified, bool is_scam, bool is_fake, CustomEmojiId bot_verification_custom_emoji_id) { + if (!is_verified && !is_scam && !is_fake && !bot_verification_custom_emoji_id.is_valid()) { + return nullptr; + } + return td_api::make_object(is_verified, is_scam, is_fake, + bot_verification_custom_emoji_id.get()); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/VerificationStatus.h b/lib/tgchat/ext/td/td/telegram/VerificationStatus.h new file mode 100644 index 00000000..c35d813c --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/VerificationStatus.h @@ -0,0 +1,19 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/CustomEmojiId.h" +#include "td/telegram/td_api.h" + +namespace td { + +class Td; + +td_api::object_ptr get_verification_status_object( + Td *td, bool is_verified, bool is_scam, bool is_fake, CustomEmojiId bot_verification_custom_emoji_id); + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/Version.h b/lib/tgchat/ext/td/td/telegram/Version.h index 24dd69db..a8e0f32f 100644 --- a/lib/tgchat/ext/td/td/telegram/Version.h +++ b/lib/tgchat/ext/td/td/telegram/Version.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,7 +10,7 @@ namespace td { -constexpr int32 MTPROTO_LAYER = 194; +constexpr int32 MTPROTO_LAYER = 196; enum class Version : int32 { Initial, // 0 diff --git a/lib/tgchat/ext/td/td/telegram/VideoNotesManager.cpp b/lib/tgchat/ext/td/td/telegram/VideoNotesManager.cpp index 84676636..09b8f5f6 100644 --- a/lib/tgchat/ext/td/td/telegram/VideoNotesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/VideoNotesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VideoNotesManager.h b/lib/tgchat/ext/td/td/telegram/VideoNotesManager.h index a97257a0..c783e8a1 100644 --- a/lib/tgchat/ext/td/td/telegram/VideoNotesManager.h +++ b/lib/tgchat/ext/td/td/telegram/VideoNotesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VideoNotesManager.hpp b/lib/tgchat/ext/td/td/telegram/VideoNotesManager.hpp index 7d4095ca..ddcd964c 100644 --- a/lib/tgchat/ext/td/td/telegram/VideoNotesManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/VideoNotesManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VideosManager.cpp b/lib/tgchat/ext/td/td/telegram/VideosManager.cpp index a0aca28b..3f51885c 100644 --- a/lib/tgchat/ext/td/td/telegram/VideosManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/VideosManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VideosManager.h b/lib/tgchat/ext/td/td/telegram/VideosManager.h index 8b2acd43..a847b726 100644 --- a/lib/tgchat/ext/td/td/telegram/VideosManager.h +++ b/lib/tgchat/ext/td/td/telegram/VideosManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VideosManager.hpp b/lib/tgchat/ext/td/td/telegram/VideosManager.hpp index 8cba52b9..d767c1f7 100644 --- a/lib/tgchat/ext/td/td/telegram/VideosManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/VideosManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.cpp b/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.cpp index dcdc02b9..46fc3102 100644 --- a/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.h b/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.h index 6d2e69db..be36d2df 100644 --- a/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.h +++ b/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.hpp b/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.hpp index 6a67a154..07dd45b8 100644 --- a/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/VoiceNotesManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebApp.cpp b/lib/tgchat/ext/td/td/telegram/WebApp.cpp index f4c0bfad..4b5dcd14 100644 --- a/lib/tgchat/ext/td/td/telegram/WebApp.cpp +++ b/lib/tgchat/ext/td/td/telegram/WebApp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -35,7 +35,7 @@ WebApp::WebApp(Td *td, telegram_api::object_ptr &&web_app, int32 document_id = web_app->document_->get_id(); if (document_id == telegram_api::document::ID) { auto parsed_document = td->documents_manager_->on_get_document( - move_tl_object_as(web_app->document_), owner_dialog_id); + move_tl_object_as(web_app->document_), owner_dialog_id, false); if (parsed_document.type == Document::Type::Animation) { animation_file_id_ = parsed_document.file_id; } else { diff --git a/lib/tgchat/ext/td/td/telegram/WebApp.h b/lib/tgchat/ext/td/td/telegram/WebApp.h index a9d9fd25..32fb5cf2 100644 --- a/lib/tgchat/ext/td/td/telegram/WebApp.h +++ b/lib/tgchat/ext/td/td/telegram/WebApp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebApp.hpp b/lib/tgchat/ext/td/td/telegram/WebApp.hpp index f60345f7..5046b33e 100644 --- a/lib/tgchat/ext/td/td/telegram/WebApp.hpp +++ b/lib/tgchat/ext/td/td/telegram/WebApp.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebAppManager.cpp b/lib/tgchat/ext/td/td/telegram/WebAppManager.cpp index be7c60f5..0ab73c3e 100644 --- a/lib/tgchat/ext/td/td/telegram/WebAppManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/WebAppManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -644,6 +644,10 @@ void WebAppManager::invoke_web_view_custom_method(UserId bot_user_id, const stri void WebAppManager::check_download_file_params(UserId bot_user_id, const string &file_name, const string &url, Promise &&promise) { TRY_RESULT_PROMISE(promise, input_user, td_->user_manager_->get_input_user(bot_user_id)); + if (file_name.size() >= 256u || url.size() > 32768u || file_name.find('/') != string::npos || + file_name.find('\\') != string::npos) { + return promise.set_error(Status::Error(400, "The file can't be downloaded")); + } td_->create_handler(std::move(promise))->send(std::move(input_user), file_name, url); } diff --git a/lib/tgchat/ext/td/td/telegram/WebAppManager.h b/lib/tgchat/ext/td/td/telegram/WebAppManager.h index ca781436..c446c647 100644 --- a/lib/tgchat/ext/td/td/telegram/WebAppManager.h +++ b/lib/tgchat/ext/td/td/telegram/WebAppManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.cpp b/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.cpp index 1bf46343..a5966ad2 100644 --- a/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.cpp +++ b/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.h b/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.h index 7b3c4198..f054e53e 100644 --- a/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.h +++ b/lib/tgchat/ext/td/td/telegram/WebAppOpenParameters.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebPageBlock.cpp b/lib/tgchat/ext/td/td/telegram/WebPageBlock.cpp index 9d18781e..02b7d161 100644 --- a/lib/tgchat/ext/td/td/telegram/WebPageBlock.cpp +++ b/lib/tgchat/ext/td/td/telegram/WebPageBlock.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebPageBlock.h b/lib/tgchat/ext/td/td/telegram/WebPageBlock.h index 061670ac..592319df 100644 --- a/lib/tgchat/ext/td/td/telegram/WebPageBlock.h +++ b/lib/tgchat/ext/td/td/telegram/WebPageBlock.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebPageId.h b/lib/tgchat/ext/td/td/telegram/WebPageId.h index 07371ebb..2df51ac4 100644 --- a/lib/tgchat/ext/td/td/telegram/WebPageId.h +++ b/lib/tgchat/ext/td/td/telegram/WebPageId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/WebPagesManager.cpp b/lib/tgchat/ext/td/td/telegram/WebPagesManager.cpp index cc4a379d..4e58b6de 100644 --- a/lib/tgchat/ext/td/td/telegram/WebPagesManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/WebPagesManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -596,7 +596,7 @@ WebPageId WebPagesManager::on_get_web_page(tl_object_ptr int32 document_id = web_page->document_->get_id(); if (document_id == telegram_api::document::ID) { auto parsed_document = td_->documents_manager_->on_get_document( - move_tl_object_as(web_page->document_), owner_dialog_id); + move_tl_object_as(web_page->document_), owner_dialog_id, false); page->document_ = std::move(parsed_document); } } @@ -609,7 +609,7 @@ WebPageId WebPagesManager::on_get_web_page(tl_object_ptr int32 document_id = document->get_id(); if (document_id == telegram_api::document::ID) { auto parsed_document = td_->documents_manager_->on_get_document( - move_tl_object_as(document), owner_dialog_id); + move_tl_object_as(document), owner_dialog_id, false); if (!parsed_document.empty()) { page->documents_.push_back(std::move(parsed_document)); } @@ -2137,7 +2137,7 @@ void WebPagesManager::on_get_web_page_instant_view(WebPage *web_page, tl_object_ if (document_ptr->get_id() == telegram_api::document::ID) { auto document = move_tl_object_as(document_ptr); auto document_id = document->id_; - auto parsed_document = td_->documents_manager_->on_get_document(std::move(document), owner_dialog_id); + auto parsed_document = td_->documents_manager_->on_get_document(std::move(document), owner_dialog_id, false); if (!parsed_document.empty() && document_id != 0) { get_map(parsed_document.type)->emplace(document_id, parsed_document.file_id); } diff --git a/lib/tgchat/ext/td/td/telegram/WebPagesManager.h b/lib/tgchat/ext/td/td/telegram/WebPagesManager.h index df4c85b2..bbd37e5c 100644 --- a/lib/tgchat/ext/td/td/telegram/WebPagesManager.h +++ b/lib/tgchat/ext/td/td/telegram/WebPagesManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/cli.cpp b/lib/tgchat/ext/td/td/telegram/cli.cpp index dddb929a..e8dff9a7 100644 --- a/lib/tgchat/ext/td/td/telegram/cli.cpp +++ b/lib/tgchat/ext/td/td/telegram/cli.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1179,6 +1179,27 @@ class CliClient final : public Actor { arg.custom_emoji_id = as_custom_emoji_id(args); } + struct AffiliateType { + int64 id = 0; + + operator td_api::object_ptr() const { + if (id == 0) { + return td_api::make_object(); + } + if (id > 0) { + return td_api::make_object(id); + } + return td_api::make_object(id); + } + }; + + void get_args(string &args, AffiliateType &arg) const { + arg.id = as_chat_id(args); + if (arg.id == my_id_) { + arg.id = 0; + } + } + struct InputBackground { string background_file; // or @@ -2026,7 +2047,8 @@ class CliClient final : public Actor { string excluded_chat_ids; get_args(filter, title, icon_name, pinned_chat_ids, included_chat_ids, excluded_chat_ids); return td_api::make_object( - title, td_api::make_object(icon_name), -1, is_shareable, as_chat_ids(pinned_chat_ids), + td_api::make_object(td_api::make_object(title, Auto()), true), + td_api::make_object(icon_name), -1, is_shareable, as_chat_ids(pinned_chat_ids), as_chat_ids(included_chat_ids), as_chat_ids(excluded_chat_ids), rand_bool(), rand_bool(), rand_bool(), rand_bool(), rand_bool(), rand_bool(), rand_bool(), rand_bool()); } @@ -2813,9 +2835,11 @@ class CliClient final : public Actor { } else if (op == "sendg" || op == "sendgp") { int64 gift_id; UserId user_id; + bool pay_for_upgrade; string text; - get_args(args, gift_id, user_id, text); - send_request(td_api::make_object(gift_id, user_id, as_formatted_text(text), op == "sendgp")); + get_args(args, gift_id, user_id, pay_for_upgrade, text); + send_request(td_api::make_object(gift_id, user_id, as_formatted_text(text), op == "sendgp", + pay_for_upgrade)); } else if (op == "sellg") { UserId user_id; MessageId message_id; @@ -2827,12 +2851,33 @@ class CliClient final : public Actor { bool is_saved; get_args(args, user_id, message_id, is_saved); send_request(td_api::make_object(user_id, message_id, is_saved)); - } else if (op == "gug") { + } else if (op == "ggup") { + int64 gift_id; + get_args(args, gift_id); + send_request(td_api::make_object(gift_id)); + } else if (op == "ug") { + UserId user_id; + MessageId message_id; + bool keep_original_details; + get_args(args, user_id, message_id, keep_original_details); + send_request(td_api::make_object(user_id, message_id, keep_original_details)); + } else if (op == "tg") { + UserId sender_user_id; + MessageId message_id; + UserId receiver_user_id; + int64 star_count; + get_args(args, sender_user_id, message_id, receiver_user_id, star_count); + send_request(td_api::make_object(sender_user_id, message_id, receiver_user_id, star_count)); + } else if (op == "gugs") { UserId user_id; - string offset; int32 limit; - get_args(args, user_id, offset, limit); + string offset; + get_args(args, user_id, limit, offset); send_request(td_api::make_object(user_id, offset, limit)); + } else if (op == "gug") { + MessageId message_id; + get_args(args, message_id); + send_request(td_api::make_object(message_id)); } else if (op == "rsp") { UserId user_id; string telegram_payment_charge_id; @@ -3097,7 +3142,8 @@ class CliClient final : public Actor { search_chat_id_ = as_chat_id(args); send_request(td_api::make_object( search_chat_id_, "", nullptr, 0, 0, 100, as_search_messages_filter("pvi"), 0, get_saved_messages_topic_id())); - } else if (op == "Search" || op == "SearchA" || op == "SearchM" || op == "SearchC") { + } else if (op == "Search" || op == "SearchA" || op == "SearchM" || op == "SearchP" || op == "SearchG" || + op == "SearchC") { string query; string limit; string filter; @@ -3110,9 +3156,19 @@ class CliClient final : public Actor { if (op == "SearchM") { chat_list = td_api::make_object(); } - send_request(td_api::make_object(std::move(chat_list), op == "SearchC", query, offset, - as_limit(limit), as_search_messages_filter(filter), 1, - 2147483647)); + td_api::object_ptr chat_type_filter; + if (op == "SearchP") { + chat_type_filter = td_api::make_object(); + } + if (op == "SearchG") { + chat_type_filter = td_api::make_object(); + } + if (op == "SearchC") { + chat_type_filter = td_api::make_object(); + } + send_request(td_api::make_object(std::move(chat_list), query, offset, as_limit(limit), + as_search_messages_filter(filter), + std::move(chat_type_filter), 1, 2147483647)); } else if (op == "SCM") { ChatId chat_id; SearchQuery query; @@ -3567,6 +3623,53 @@ class CliClient final : public Actor { string subscription_id; get_args(args, subscription_id); send_request(td_api::make_object(subscription_id)); + } else if (op == "scap" || op == "scapd") { + ChatId chat_id; + int32 commission; + int32 month_count; + get_args(args, chat_id, commission, month_count); + send_request(td_api::make_object( + chat_id, + op == "scapd" ? nullptr : td_api::make_object(commission, month_count))); + } else if (op == "scapr") { + string username; + string referrer; + get_args(args, username, referrer); + send_request(td_api::make_object(username, referrer)); + } else if (op == "sapc" || op == "sapd" || op == "sapr") { + AffiliateType affiliate; + string limit; + string offset; + get_args(args, affiliate, limit, offset); + td_api::object_ptr sort_order; + if (op == "sapd") { + sort_order = td_api::make_object(); + } else if (op == "sapr") { + sort_order = td_api::make_object(); + } + send_request(td_api::make_object(affiliate, std::move(sort_order), offset, + as_limit(limit))); + } else if (op == "capr") { + AffiliateType affiliate; + UserId bot_user_id; + get_args(args, affiliate, bot_user_id); + send_request(td_api::make_object(affiliate, bot_user_id)); + } else if (op == "dapr") { + AffiliateType affiliate; + string url; + get_args(args, affiliate, url); + send_request(td_api::make_object(affiliate, url)); + } else if (op == "gcapr") { + AffiliateType affiliate; + UserId bot_user_id; + get_args(args, affiliate, bot_user_id); + send_request(td_api::make_object(affiliate, bot_user_id)); + } else if (op == "gcaprs") { + AffiliateType affiliate; + string limit; + string offset; + get_args(args, affiliate, limit, offset); + send_request(td_api::make_object(affiliate, offset, as_limit(limit))); } else if (op == "cpfs" || op == "cpfsb") { UserId user_id; string currency; @@ -3650,9 +3753,14 @@ class CliClient final : public Actor { send_request(td_api::make_object( as_sticker_type(op), query, op == "gaseme" ? my_id_ : 0, return_only_main_emoji)); } else if (op == "sst" || op == "sstm" || op == "sste") { - SearchQuery query; - get_args(args, query); - send_request(td_api::make_object(as_sticker_type(op), query.query, query.limit)); + string limit; + string emoji; + string query; + string input_language_codes; + int32 offset; + get_args(args, limit, emoji, query, input_language_codes, offset); + send_request(td_api::make_object( + as_sticker_type(op), emoji, query, autosplit_str(input_language_codes), offset, as_limit(limit))); } else if (op == "ggs") { send_request(td_api::make_object()); } else if (op == "gprst") { @@ -4230,10 +4338,11 @@ class CliClient final : public Actor { if (op == "cc" || op == "CreateCall") { UserId user_id; - get_args(args, user_id); + GroupCallId group_call_id; + get_args(args, user_id, group_call_id); send_request(td_api::make_object( user_id, td_api::make_object(true, true, 65, 65, vector{"2.6", "3.0"}), - rand_bool())); + rand_bool(), group_call_id)); } else if (op == "ac" || op == "AcceptCall") { CallId call_id; get_args(args, call_id); @@ -4289,6 +4398,10 @@ class CliClient final : public Actor { bool is_rtmp_stream; get_args(args, chat_id, title, start_date, is_rtmp_stream); send_request(td_api::make_object(chat_id, title, start_date, is_rtmp_stream)); + } else if (op == "cgc") { + CallId call_id; + get_args(args, call_id); + send_request(td_api::make_object(call_id)); } else if (op == "gvcru") { ChatId chat_id; get_args(args, chat_id); @@ -5979,7 +6092,8 @@ class CliClient final : public Actor { send_request(td_api::make_object(as_chat_folder(args))); } else if (op == "ccfe") { auto chat_folder = td_api::make_object(); - chat_folder->title_ = "empty"; + chat_folder->name_ = td_api::make_object( + td_api::make_object("empty", Auto()), true); chat_folder->included_chat_ids_ = as_chat_ids(args); send_request(td_api::make_object(std::move(chat_folder))); } else if (op == "ecf" || op == "ecfs") { @@ -6542,6 +6656,8 @@ class CliClient final : public Actor { send_request(td_api::make_object(chat_id, message_thread_id)); } else if (op == "grib") { send_request(td_api::make_object()); + } else if (op == "gob") { + send_request(td_api::make_object()); } else if (op == "spc" || op == "su") { send_request(td_api::make_object(args)); } else if (op == "spcs") { @@ -6859,6 +6975,19 @@ class CliClient final : public Actor { string language_code; get_args(args, bot_user_id, language_code); send_request(td_api::make_object(bot_user_id, language_code)); + } else if (op == "smsbv") { + UserId bot_user_id; + string sender_id; + string custom_description; + get_args(args, bot_user_id, sender_id, custom_description); + send_request(td_api::make_object( + bot_user_id, as_message_sender(sender_id), custom_description)); + } else if (op == "rmsbv") { + UserId bot_user_id; + string sender_id; + get_args(args, bot_user_id, sender_id); + send_request( + td_api::make_object(bot_user_id, as_message_sender(sender_id))); } else if (op == "sh") { const string &prefix = args; send_request(td_api::make_object(prefix, 10)); diff --git a/lib/tgchat/ext/td/td/telegram/files/FileBitmask.cpp b/lib/tgchat/ext/td/td/telegram/files/FileBitmask.cpp index 7aa594ab..eced3256 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileBitmask.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileBitmask.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileBitmask.h b/lib/tgchat/ext/td/td/telegram/files/FileBitmask.h index df4a3873..e92d86dd 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileBitmask.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileBitmask.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileData.h b/lib/tgchat/ext/td/td/telegram/files/FileData.h index 6bf53838..264d7e5d 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileData.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileData.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileData.hpp b/lib/tgchat/ext/td/td/telegram/files/FileData.hpp index a3a0c6d2..4e01505a 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileData.hpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileData.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDb.cpp b/lib/tgchat/ext/td/td/telegram/files/FileDb.cpp index 5436f211..a3312caa 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDb.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDb.h b/lib/tgchat/ext/td/td/telegram/files/FileDb.h index 1f1c41d9..7f1235b4 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDb.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDbId.h b/lib/tgchat/ext/td/td/telegram/files/FileDbId.h index 6c7b3d3b..a34ac409 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDbId.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileDbId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.cpp b/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.cpp index 019a9c74..682700e6 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.h b/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.h index accd1903..922e93bc 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileDownloadManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDownloader.cpp b/lib/tgchat/ext/td/td/telegram/files/FileDownloader.cpp index a7a89c70..95745258 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDownloader.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileDownloader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -103,7 +103,7 @@ Result FileDownloader::should_restart_part(Part part, const NetQueryPtr &n case QueryType::ReuploadCDN: { TRY_RESULT(file_hashes, fetch_result(net_query->ok())); add_hash_info(file_hashes); - LOG(DEBUG) << "Part " << part.id << " was reuplaoded to CDN"; + LOG(DEBUG) << "Part " << part.id << " was reuploaded to CDN"; return true; } case QueryType::CDN: { @@ -111,7 +111,7 @@ Result FileDownloader::should_restart_part(Part part, const NetQueryPtr &n TRY_RESULT(file_base, fetch_result(net_query->ok())); CHECK(file_base->get_id() == telegram_api::upload_cdnFileReuploadNeeded::ID); auto file = move_tl_object_as(file_base); - LOG(DEBUG) << "Part " << part.id << " must be reuplaoded to " << oneline(to_string(file)); + LOG(DEBUG) << "Part " << part.id << " must be reuploaded to " << oneline(to_string(file)); cdn_part_reupload_token_[part.id] = file->request_token_.as_slice().str(); return true; } @@ -544,7 +544,9 @@ void FileDownloader::start_up() { if (!is_small_ && (file_type == FileType::VideoNote || file_type == FileType::Document || file_type == FileType::VoiceNote || file_type == FileType::Audio || file_type == FileType::Video || file_type == FileType::Animation || - file_type == FileType::VideoStory || (file_type == FileType::Encrypted && size_ > (1 << 20)))) { + file_type == FileType::VideoStory || file_type == FileType::SelfDestructingVideo || + file_type == FileType::SelfDestructingVideoNote || file_type == FileType::SelfDestructingVoiceNote || + (file_type == FileType::Encrypted && size_ > (1 << 20)))) { delay_dispatcher_ = create_actor("DelayDispatcher", 0.003, actor_shared(this, 1)); next_delay_ = 0.05; } diff --git a/lib/tgchat/ext/td/td/telegram/files/FileDownloader.h b/lib/tgchat/ext/td/td/telegram/files/FileDownloader.h index 68ce7c74..5197c8bd 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileDownloader.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileDownloader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.cpp b/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.cpp index 8b0609cf..c4e3813f 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.h b/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.h index 935a8c92..949e3544 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileEncryptionKey.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.cpp b/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.cpp index 4fb2def9..096b4173 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.h b/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.h index bc7feb87..7c383186 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileFromBytes.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.cpp b/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.cpp index c7acdc01..71a00cd8 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.h b/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.h index 62909b81..11e452c9 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileGcParameters.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.cpp b/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.cpp index cf8c818d..d72f045e 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -26,7 +26,7 @@ namespace td { int VERBOSITY_NAME(file_gc) = VERBOSITY_NAME(INFO); -void FileGcWorker::run_gc(const FileGcParameters ¶meters, std::vector files, +void FileGcWorker::run_gc(const FileGcParameters ¶meters, vector files, bool send_updates, Promise promise) { auto begin_time = Time::now(); VLOG(file_gc) << "Start files GC with " << parameters; @@ -84,12 +84,14 @@ void FileGcWorker::run_gc(const FileGcParameters ¶meters, std::vectorfile_manager(), &FileManager::on_file_unlink, - FullLocalFileLocation(info.file_type, info.path, info.mtime_nsec)); + if (send_updates) { + send_closure(G()->file_manager(), &FileManager::on_file_unlink, + FullLocalFileLocation(info.file_type, info.path, info.mtime_nsec)); + } }; double now = Clocks::system(); diff --git a/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.h b/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.h index f26f0595..08b389d7 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileGcWorker.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -12,6 +12,7 @@ #include "td/actor/actor.h" #include "td/utils/CancellationToken.h" +#include "td/utils/common.h" #include "td/utils/logging.h" #include "td/utils/Promise.h" @@ -28,7 +29,9 @@ class FileGcWorker final : public Actor { public: FileGcWorker(ActorShared<> parent, CancellationToken token) : parent_(std::move(parent)), token_(std::move(token)) { } - void run_gc(const FileGcParameters ¶meters, std::vector files, Promise promise); + + void run_gc(const FileGcParameters ¶meters, vector files, bool send_updates, + Promise promise); private: ActorShared<> parent_; diff --git a/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.cpp b/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.cpp index b40e683d..1494de57 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.h b/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.h index 2c9cc363..db4a8eb1 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileGenerateManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.cpp b/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.cpp index d68fd8cb..613fe52b 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.h b/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.h index 33b936ce..8a7e61c1 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileHashUploader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileId.h b/lib/tgchat/ext/td/td/telegram/files/FileId.h index fde14766..fd3ee85b 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileId.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileId.hpp b/lib/tgchat/ext/td/td/telegram/files/FileId.hpp index 1af96395..611c1fe8 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileId.hpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileId.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.cpp b/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.cpp index 8a8de94a..76f80cda 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.h b/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.h index 7bf0530f..843d5fac 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileLoadManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLoaderActor.h b/lib/tgchat/ext/td/td/telegram/files/FileLoaderActor.h index 00ad01cc..ec5e179a 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLoaderActor.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileLoaderActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.cpp b/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.cpp index b3c2218b..27294018 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -335,7 +335,7 @@ Result check_full_local_location(FullLocalLocationInfo lo if (get_file_type_class(location.file_type_) == FileTypeClass::Photo && size > MAX_PHOTO_SIZE) { return get_file_size_error(" for a photo"); } - if (location.file_type_ == FileType::VideoNote && + if ((location.file_type_ == FileType::VideoNote || location.file_type_ == FileType::SelfDestructingVideoNote) && size > G()->get_option_integer("video_note_size_max", DEFAULT_VIDEO_NOTE_SIZE_MAX)) { return get_file_size_error(" for a video note"); } diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.h b/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.h index e66b1c32..6d6b9506 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileLoaderUtils.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLocation.h b/lib/tgchat/ext/td/td/telegram/files/FileLocation.h index 57ee294c..ad9877ac 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLocation.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileLocation.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -398,6 +398,7 @@ class FullRemoteFileLocation { switch (thumbnail.file_type) { case FileType::Photo: case FileType::PhotoStory: + case FileType::SelfDestructingPhoto: return make_tl_object( id, access_hash, BufferSlice(file_reference_), std::string(1, static_cast(static_cast(thumbnail.thumbnail_type.type)))); diff --git a/lib/tgchat/ext/td/td/telegram/files/FileLocation.hpp b/lib/tgchat/ext/td/td/telegram/files/FileLocation.hpp index befc64ec..aae3d70a 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileLocation.hpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileLocation.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -238,7 +238,8 @@ void FullRemoteFileLocation::parse(ParserT &parser) { case PhotoSizeSource::Type::Thumbnail: if (photo().source_.get_file_type("FullRemoteFileLocation::parse") != file_type_ || (file_type_ != FileType::Photo && file_type_ != FileType::PhotoStory && - file_type_ != FileType::Thumbnail && file_type_ != FileType::EncryptedThumbnail)) { + file_type_ != FileType::SelfDestructingPhoto && file_type_ != FileType::Thumbnail && + file_type_ != FileType::EncryptedThumbnail)) { parser.set_error("Invalid FileType in PhotoRemoteFileLocation Thumbnail"); } break; diff --git a/lib/tgchat/ext/td/td/telegram/files/FileManager.cpp b/lib/tgchat/ext/td/td/telegram/files/FileManager.cpp index 4bfcb15d..163e2c53 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1354,12 +1354,14 @@ string FileManager::get_file_name(FileType file_type, Slice path) { case FileType::ProfilePhoto: case FileType::Photo: case FileType::PhotoStory: + case FileType::SelfDestructingPhoto: if (extension != "jpg" && extension != "jpeg" && extension != "gif" && extension != "png" && extension != "tif" && extension != "bmp") { return fix_file_extension(file_name, "photo", "jpg"); } break; case FileType::VoiceNote: + case FileType::SelfDestructingVoiceNote: if (extension != "ogg" && extension != "oga" && extension != "mp3" && extension != "mpeg3" && extension != "m4a" && extension != "opus") { return fix_file_extension(file_name, "voice", "oga"); @@ -1367,6 +1369,8 @@ string FileManager::get_file_name(FileType file_type, Slice path) { break; case FileType::Video: case FileType::VideoNote: + case FileType::SelfDestructingVideo: + case FileType::SelfDestructingVideoNote: if (extension != "mov" && extension != "3gp" && extension != "mpeg4" && extension != "mp4" && extension != "mkv") { return fix_file_extension(file_name, "video", "mp4"); @@ -2093,7 +2097,7 @@ static int merge_choose_generate_location(const unique_ptrconversion_ >= y->conversion_ ? 0 - : 1; // the bigger conversion, the bigger mtime or at least more stable choise + : 1; // the bigger conversion, the bigger mtime or at least more stable choice } return 2; } @@ -3316,7 +3320,7 @@ void FileManager::run_download(FileNodePtr node, bool force_update_priority) { node->download_id_ = query_id; node->is_download_started_ = false; LOG(INFO) << "Run download of file " << file_id << " of size " << node->size_ << " from " - << node->remote_.full.value() << " with suggested name " << node->suggested_path() << " and encyption key " + << node->remote_.full.value() << " with suggested name " << node->suggested_path() << " and encryption key " << node->encryption_key_; auto download_offset = node->download_offset_; auto download_limit = node->get_download_limit(); diff --git a/lib/tgchat/ext/td/td/telegram/files/FileManager.h b/lib/tgchat/ext/td/td/telegram/files/FileManager.h index 43dad4d2..95e8e6ad 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileManager.hpp b/lib/tgchat/ext/td/td/telegram/files/FileManager.hpp index cbc44007..9fa96d76 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileManager.hpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileManager.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileSourceId.h b/lib/tgchat/ext/td/td/telegram/files/FileSourceId.h index beec623e..1457eed5 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileSourceId.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileSourceId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileSourceId.hpp b/lib/tgchat/ext/td/td/telegram/files/FileSourceId.hpp index 4927d1ed..f0151f31 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileSourceId.hpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileSourceId.hpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileStats.cpp b/lib/tgchat/ext/td/td/telegram/files/FileStats.cpp index 018c3c35..fd80c49b 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileStats.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileStats.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileStats.h b/lib/tgchat/ext/td/td/telegram/files/FileStats.h index 5588e274..e626fe27 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileStats.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileStats.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.cpp b/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.cpp index 072c3295..23ab1433 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.h b/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.h index 8573cafe..a0629ba3 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileStatsWorker.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileType.cpp b/lib/tgchat/ext/td/td/telegram/files/FileType.cpp index cf694192..500aa0f2 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileType.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -49,6 +49,14 @@ FileType get_file_type(const td_api::FileType &file_type) { return FileType::SecureEncrypted; case td_api::fileTypeNotificationSound::ID: return FileType::Ringtone; + case td_api::fileTypeSelfDestructingPhoto::ID: + return FileType::SelfDestructingPhoto; + case td_api::fileTypeSelfDestructingVideo::ID: + return FileType::SelfDestructingVideo; + case td_api::fileTypeSelfDestructingVideoNote::ID: + return FileType::SelfDestructingVideoNote; + case td_api::fileTypeSelfDestructingVoiceNote::ID: + return FileType::SelfDestructingVoiceNote; case td_api::fileTypeNone::ID: return FileType::None; default: @@ -104,6 +112,14 @@ tl_object_ptr get_file_type_object(FileType file_type) { return make_tl_object(); case FileType::VideoStory: return make_tl_object(); + case FileType::SelfDestructingPhoto: + return make_tl_object(); + case FileType::SelfDestructingVideo: + return make_tl_object(); + case FileType::SelfDestructingVideoNote: + return make_tl_object(); + case FileType::SelfDestructingVoiceNote: + return make_tl_object(); case FileType::None: return make_tl_object(); default: @@ -134,10 +150,13 @@ CSlice get_file_type_name(FileType file_type) { case FileType::ProfilePhoto: return CSlice("profile_photos"); case FileType::Photo: + case FileType::SelfDestructingPhoto: return CSlice("photos"); case FileType::VoiceNote: + case FileType::SelfDestructingVoiceNote: return CSlice("voice"); case FileType::Video: + case FileType::SelfDestructingVideo: return CSlice("videos"); case FileType::Document: return CSlice("documents"); @@ -154,6 +173,7 @@ CSlice get_file_type_name(FileType file_type) { case FileType::EncryptedThumbnail: return CSlice("secret_thumbnails"); case FileType::VideoNote: + case FileType::SelfDestructingVideoNote: return CSlice("video_notes"); case FileType::SecureEncrypted: return CSlice("passport"); @@ -186,6 +206,7 @@ FileTypeClass get_file_type_class(FileType file_type) { case FileType::EncryptedThumbnail: case FileType::Wallpaper: case FileType::PhotoStory: + case FileType::SelfDestructingPhoto: return FileTypeClass::Photo; case FileType::Video: case FileType::VoiceNote: @@ -199,6 +220,9 @@ FileTypeClass get_file_type_class(FileType file_type) { case FileType::Ringtone: case FileType::CallLog: case FileType::VideoStory: + case FileType::SelfDestructingVideo: + case FileType::SelfDestructingVideoNote: + case FileType::SelfDestructingVoiceNote: return FileTypeClass::Document; case FileType::SecureDecrypted: case FileType::SecureEncrypted: @@ -265,6 +289,14 @@ StringBuilder &operator<<(StringBuilder &string_builder, FileType file_type) { return string_builder << "PhotoStory"; case FileType::VideoStory: return string_builder << "VideoStory"; + case FileType::SelfDestructingPhoto: + return string_builder << "SelfDestructingPhoto"; + case FileType::SelfDestructingVideo: + return string_builder << "SelfDestructingVideo"; + case FileType::SelfDestructingVideoNote: + return string_builder << "SelfDestructingVideoNote"; + case FileType::SelfDestructingVoiceNote: + return string_builder << "SelfDestructingVoiceNote"; case FileType::Size: case FileType::None: default: @@ -287,6 +319,10 @@ FileDirType get_file_dir_type(FileType file_type) { case FileType::Ringtone: case FileType::PhotoStory: case FileType::VideoStory: + case FileType::SelfDestructingPhoto: + case FileType::SelfDestructingVideo: + case FileType::SelfDestructingVideoNote: + case FileType::SelfDestructingVoiceNote: return FileDirType::Secure; default: return FileDirType::Common; @@ -319,6 +355,10 @@ bool can_reuse_remote_file(FileType file_type) { case FileType::CallLog: case FileType::PhotoStory: case FileType::VideoStory: + case FileType::SelfDestructingPhoto: + case FileType::SelfDestructingVideo: + case FileType::SelfDestructingVideoNote: + case FileType::SelfDestructingVoiceNote: return false; default: return true; diff --git a/lib/tgchat/ext/td/td/telegram/files/FileType.h b/lib/tgchat/ext/td/td/telegram/files/FileType.h index 9f2b869a..4b865b03 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileType.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -37,6 +37,10 @@ enum class FileType : int32 { CallLog, PhotoStory, VideoStory, + SelfDestructingPhoto, + SelfDestructingVideo, + SelfDestructingVideoNote, + SelfDestructingVoiceNote, Size, None }; diff --git a/lib/tgchat/ext/td/td/telegram/files/FileUploadId.h b/lib/tgchat/ext/td/td/telegram/files/FileUploadId.h index 5636b535..dce3f30f 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileUploadId.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileUploadId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.cpp b/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.cpp index c76f0655..f5f3ba9f 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.h b/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.h index 9367a7f5..2bef8732 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileUploadManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileUploader.cpp b/lib/tgchat/ext/td/td/telegram/files/FileUploader.cpp index 21f99ffc..35945625 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileUploader.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/FileUploader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/FileUploader.h b/lib/tgchat/ext/td/td/telegram/files/FileUploader.h index 8d259690..b255f840 100644 --- a/lib/tgchat/ext/td/td/telegram/files/FileUploader.h +++ b/lib/tgchat/ext/td/td/telegram/files/FileUploader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/PartsManager.cpp b/lib/tgchat/ext/td/td/telegram/files/PartsManager.cpp index ab5ced67..eedd5212 100644 --- a/lib/tgchat/ext/td/td/telegram/files/PartsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/PartsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -65,10 +65,6 @@ int32 PartsManager::set_streaming_offset(int64 offset, int64 limit) { return finish(); } -int32 PartsManager::get_pending_count() const { - return pending_count_; -} - void PartsManager::set_streaming_limit(int64 limit) { streaming_limit_ = limit; streaming_ready_size_ = 0; @@ -235,10 +231,6 @@ bool PartsManager::is_part_in_streaming_limit(int part_id) const { auto offset_begin = static_cast(part_id) * static_cast(get_part_size()); auto offset_end = offset_begin + static_cast(get_part(part_id).size); - if (offset_begin >= get_expected_size()) { - return false; - } - if (streaming_limit_ == 0) { return true; } @@ -266,14 +258,17 @@ bool PartsManager::is_streaming_limit_reached() { update_first_not_ready_part(); auto part_id = first_streaming_not_ready_part_; + //LOG(ERROR) << unknown_size_flag_ << ' ' << part_id << ' ' << part_count_ << ' ' << first_not_ready_part_ << ' ' + // << get_estimated_extra() << ' ' << (part_id == part_count_ ? true : is_part_in_streaming_limit(part_id)); + // wrap if (!unknown_size_flag_ && part_id == part_count_) { part_id = first_not_ready_part_; } - if (part_id == part_count_) { - return false; + if (part_id == part_count_ || !is_part_in_streaming_limit(part_id)) { + return get_estimated_extra() == 0; } - return !is_part_in_streaming_limit(part_id); + return false; } Result PartsManager::start_part() { @@ -302,9 +297,11 @@ Result PartsManager::start_part() { } } - if (!is_part_in_streaming_limit(part_id)) { + if (!is_part_in_streaming_limit(part_id) || + static_cast(part_id) * static_cast(get_part_size()) >= (unknown_size_flag_ ? max_size_ : size_)) { return get_empty_part(); } + CHECK(part_status_[part_id] == PartStatus::Empty); on_part_start(part_id); return get_part(part_id); @@ -326,6 +323,9 @@ Status PartsManager::set_known_prefix(int64 size, bool is_ready) { size_ = size; unknown_size_flag_ = false; known_prefix_flag_ = false; + if (streaming_limit_ != 0) { + set_streaming_limit(streaming_limit_); + } } else { part_count_ = static_cast(size / static_cast(part_size_)); } @@ -356,15 +356,17 @@ Status PartsManager::on_part_ok(int part_id, size_t part_size, size_t actual_siz streaming_ready_size_ += narrow_cast(actual_size); } - VLOG(file_loader) << "Transferred part " << part_id << " of size " << part_size + VLOG(file_loader) << "Transferred part " << part_id << " of size " << part_size << " with actual size " << actual_size << ", total ready size = " << ready_size_; int64 offset = narrow_cast(part_size_) * part_id; int64 end_offset = offset + narrow_cast(actual_size); if (unknown_size_flag_) { CHECK(part_size == part_size_); - if (actual_size < part_size_) { - max_size_ = min(max_size_, end_offset); + bool is_size_changed = false; + if (actual_size < part_size_ && end_offset < max_size_) { + max_size_ = end_offset; + is_size_changed = true; } if (actual_size) { min_size_ = max(min_size_, end_offset); @@ -377,6 +379,11 @@ Status PartsManager::on_part_ok(int part_id, size_t part_size, size_t actual_siz } else if (min_size_ == max_size_) { unknown_size_flag_ = false; size_ = min_size_; + is_size_changed = true; + } + + if (is_size_changed && streaming_limit_ != 0) { + set_streaming_limit(streaming_limit_); } } else { if ((actual_size < part_size && offset < size_) || (offset >= size_ && actual_size > 0)) { @@ -418,27 +425,26 @@ int64 PartsManager::get_size_or_zero() const { int64 PartsManager::get_estimated_extra() const { auto total_estimated_extra = get_expected_size() - get_ready_size(); if (streaming_limit_ != 0) { - int64 expected_size = get_expected_size(); - int64 streaming_begin = streaming_offset_ / get_part_size() * get_part_size(); - int64 streaming_end = - (streaming_offset_ + streaming_limit_ + get_part_size() - 1) / get_part_size() * get_part_size(); - int64 streaming_size = streaming_end - streaming_begin; + int64 part_size = get_part_size(); + auto round_up = [part_size](int64 size) { + return (size + part_size - 1) / part_size * part_size; + }; + int64 streaming_begin = streaming_offset_ / part_size * part_size; + int64 streaming_size = 0; if (unknown_size_flag_) { - if (streaming_begin < expected_size) { - streaming_size = min(expected_size - streaming_begin, streaming_size); - } else { - streaming_size = 0; - } + streaming_begin = min(streaming_begin, max_size_); + int64 streaming_end = min(round_up(streaming_offset_ + streaming_limit_), max_size_); + streaming_size = streaming_end - streaming_begin; } else { - if (streaming_end > expected_size) { - int64 total = streaming_limit_; - int64 suffix = 0; - if (streaming_offset_ < expected_size_) { - suffix = expected_size_ - streaming_begin; - total -= expected_size_ - streaming_offset_; + if (streaming_offset_ + streaming_limit_ <= size_) { + int64 streaming_end = min(round_up(streaming_offset_ + streaming_limit_), size_); + streaming_size = streaming_end - streaming_begin; + } else { + if (streaming_offset_ < size_) { + int64 prefix = min(round_up(streaming_offset_ + streaming_limit_ - size_), size_); + int64 suffix = size_ - streaming_begin; + streaming_size = min(size_, prefix + suffix); } - int64 prefix = (total + get_part_size() - 1) / get_part_size() * get_part_size(); - streaming_size = min(expected_size, prefix + suffix); } } int64 res = streaming_size; @@ -465,7 +471,7 @@ int64 PartsManager::get_ready_size() const { int64 PartsManager::get_expected_size() const { if (unknown_size_flag_) { - return max(static_cast(512 * (1 << 10)), get_ready_size() * 2); + return min(max(min_size_ + static_cast(512 << 10), get_ready_size() * 2), max_size_); } return get_size(); } diff --git a/lib/tgchat/ext/td/td/telegram/files/PartsManager.h b/lib/tgchat/ext/td/td/telegram/files/PartsManager.h index 64ccec9b..6937a45e 100644 --- a/lib/tgchat/ext/td/td/telegram/files/PartsManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/PartsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -43,7 +43,6 @@ class PartsManager { int64 get_unchecked_ready_prefix_size(); int64 get_size() const; int64 get_size_or_zero() const; - int64 get_expected_size() const; int64 get_estimated_extra() const; int64 get_ready_size() const; size_t get_part_size() const; @@ -52,7 +51,6 @@ class PartsManager { int32 get_ready_prefix_count(); int64 get_streaming_offset() const; string get_bitmask(); - int32 get_pending_count() const; private: static constexpr int MAX_PART_COUNT = 4000; @@ -102,7 +100,10 @@ class PartsManager { void update_first_empty_part(); void update_first_not_ready_part(); + int64 get_expected_size() const; + bool is_streaming_limit_reached(); + bool is_part_in_streaming_limit(int part_id) const; friend StringBuilder &operator<<(StringBuilder &string_builder, const PartsManager &parts_manager); diff --git a/lib/tgchat/ext/td/td/telegram/files/ResourceManager.cpp b/lib/tgchat/ext/td/td/telegram/files/ResourceManager.cpp index 42bd9e7b..c8c8b715 100644 --- a/lib/tgchat/ext/td/td/telegram/files/ResourceManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/files/ResourceManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/ResourceManager.h b/lib/tgchat/ext/td/td/telegram/files/ResourceManager.h index a1ba7460..f2d8437a 100644 --- a/lib/tgchat/ext/td/td/telegram/files/ResourceManager.h +++ b/lib/tgchat/ext/td/td/telegram/files/ResourceManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/files/ResourceState.cpp b/lib/tgchat/ext/td/td/telegram/files/ResourceState.cpp new file mode 100644 index 00000000..589c289d --- /dev/null +++ b/lib/tgchat/ext/td/td/telegram/files/ResourceState.cpp @@ -0,0 +1,90 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include "td/telegram/files/ResourceState.h" + +#include "td/utils/format.h" + +namespace td { + +void ResourceState::start_use(int64 x) { + using_ += x; + CHECK(used_ + using_ <= limit_); +} + +void ResourceState::stop_use(int64 x) { + CHECK(x <= using_); + using_ -= x; + used_ += x; +} + +void ResourceState::update_limit(int64 extra) { + limit_ += extra; +} + +bool ResourceState::update_estimated_limit(int64 extra) { + // unused() must be positive, i.e. used_ + using_ must be less than limit_ + // TODO: use exact intersection between using_ and extra. + auto using_and_extra_intersection = min(using_, extra); // between 0 and min(using_, extra) + auto new_estimated_limit = used_ + using_ + extra - using_and_extra_intersection; + + // Use extra extra limit + if (new_estimated_limit < limit_) { + auto extra_limit = limit_ - new_estimated_limit; + used_ += extra_limit; + new_estimated_limit += extra_limit; + } + + if (new_estimated_limit == estimated_limit_) { + return false; + } + estimated_limit_ = new_estimated_limit; + return true; +} + +int64 ResourceState::active_limit() const { + return limit_ - used_; +} + +int64 ResourceState::unused() const { + return limit_ - using_ - used_; +} + +int64 ResourceState::estimated_extra() const { + auto new_unused = max(limit_, estimated_limit_) - using_ - used_; + new_unused = static_cast((new_unused + unit_size() - 1) / unit_size() * unit_size()); + return new_unused + using_ + used_ - limit_; +} + +ResourceState &ResourceState::operator+=(const ResourceState &other) { + using_ += other.active_limit(); + used_ += other.used_; + return *this; +} + +ResourceState &ResourceState::operator-=(const ResourceState &other) { + using_ -= other.active_limit(); + used_ -= other.used_; + return *this; +} + +void ResourceState::update_master(const ResourceState &other) { + estimated_limit_ = other.estimated_limit_; + used_ = other.used_; + using_ = other.using_; + unit_size_ = other.unit_size_; +} + +void ResourceState::update_slave(const ResourceState &other) { + limit_ = other.limit_; +} + +StringBuilder &operator<<(StringBuilder &sb, const ResourceState &state) { + return sb << tag("estimated_limit", state.estimated_limit_) << tag("used", state.used_) << tag("using", state.using_) + << tag("limit", state.limit_); +} + +} // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/files/ResourceState.h b/lib/tgchat/ext/td/td/telegram/files/ResourceState.h index 4c4f4936..f49dce0e 100644 --- a/lib/tgchat/ext/td/td/telegram/files/ResourceState.h +++ b/lib/tgchat/ext/td/td/telegram/files/ResourceState.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -7,101 +7,47 @@ #pragma once #include "td/utils/common.h" -#include "td/utils/format.h" #include "td/utils/StringBuilder.h" namespace td { class ResourceState { public: - void start_use(int64 x) { - using_ += x; - CHECK(used_ + using_ <= limit_); - } + void start_use(int64 x); - void stop_use(int64 x) { - CHECK(x <= using_); - using_ -= x; - used_ += x; - } + void stop_use(int64 x); - void update_limit(int64 extra) { - limit_ += extra; - } + void update_limit(int64 extra); - bool update_estimated_limit(int64 extra) { - // unused() must be positive, i.e. used_ + using_ must be less than limit_ - // TODO: use exact intersection between using_ and extra. - auto using_and_extra_intersection = min(using_, extra); // between 0 and min(using_, extra) - auto new_estimated_limit = used_ + using_ + extra - using_and_extra_intersection; - - // Use extra extra limit - if (new_estimated_limit < limit_) { - auto extra_limit = limit_ - new_estimated_limit; - used_ += extra_limit; - new_estimated_limit += extra_limit; - } - - if (new_estimated_limit == estimated_limit_) { - return false; - } - estimated_limit_ = new_estimated_limit; - return true; - } + bool update_estimated_limit(int64 extra); void set_unit_size(size_t new_unit_size) { unit_size_ = new_unit_size; } - int64 active_limit() const { - return limit_ - used_; - } + int64 active_limit() const; int64 get_using() const { return using_; } - int64 unused() const { - return limit_ - using_ - used_; - } + int64 unused() const; - int64 estimated_extra() const { - auto new_unused = max(limit_, estimated_limit_) - using_ - used_; - new_unused = static_cast((new_unused + unit_size() - 1) / unit_size() * unit_size()); - return new_unused + using_ + used_ - limit_; - } + int64 estimated_extra() const; size_t unit_size() const { return unit_size_; } - ResourceState &operator+=(const ResourceState &other) { - using_ += other.active_limit(); - used_ += other.used_; - return *this; - } + ResourceState &operator+=(const ResourceState &other); - ResourceState &operator-=(const ResourceState &other) { - using_ -= other.active_limit(); - used_ -= other.used_; - return *this; - } + ResourceState &operator-=(const ResourceState &other); - void update_master(const ResourceState &other) { - estimated_limit_ = other.estimated_limit_; - used_ = other.used_; - using_ = other.using_; - unit_size_ = other.unit_size_; - } + void update_master(const ResourceState &other); - void update_slave(const ResourceState &other) { - limit_ = other.limit_; - } + void update_slave(const ResourceState &other); - friend StringBuilder &operator<<(StringBuilder &sb, const ResourceState &state) { - return sb << tag("estimated_limit", state.estimated_limit_) << tag("used", state.used_) - << tag("using", state.using_) << tag("limit", state.limit_); - } + friend StringBuilder &operator<<(StringBuilder &sb, const ResourceState &state); private: int64 estimated_limit_ = 0; // me @@ -111,4 +57,6 @@ class ResourceState { size_t unit_size_ = 1; // me }; +StringBuilder &operator<<(StringBuilder &sb, const ResourceState &state); + } // namespace td diff --git a/lib/tgchat/ext/td/td/telegram/logevent/LogEvent.h b/lib/tgchat/ext/td/td/telegram/logevent/LogEvent.h index f9d5331b..915d9266 100644 --- a/lib/tgchat/ext/td/td/telegram/logevent/LogEvent.h +++ b/lib/tgchat/ext/td/td/telegram/logevent/LogEvent.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.cpp b/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.cpp index 4a3adb74..928c561d 100644 --- a/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.cpp +++ b/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.h b/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.h index 3cb5127e..c935097b 100644 --- a/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.h +++ b/lib/tgchat/ext/td/td/telegram/logevent/LogEventHelper.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/logevent/SecretChatEvent.h b/lib/tgchat/ext/td/td/telegram/logevent/SecretChatEvent.h index 699a4f50..bba7f7d1 100644 --- a/lib/tgchat/ext/td/td/telegram/logevent/SecretChatEvent.h +++ b/lib/tgchat/ext/td/td/telegram/logevent/SecretChatEvent.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/misc.cpp b/lib/tgchat/ext/td/td/telegram/misc.cpp index 4df8d017..a77d0418 100644 --- a/lib/tgchat/ext/td/td/telegram/misc.cpp +++ b/lib/tgchat/ext/td/td/telegram/misc.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/misc.h b/lib/tgchat/ext/td/td/telegram/misc.h index bced1fd6..bae968ac 100644 --- a/lib/tgchat/ext/td/td/telegram/misc.h +++ b/lib/tgchat/ext/td/td/telegram/misc.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.cpp b/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.cpp index 98e99bae..3fff0f3b 100644 --- a/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.h b/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.h index 8ee9b408..f9d52331 100644 --- a/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.h +++ b/lib/tgchat/ext/td/td/telegram/net/AuthDataShared.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/AuthKeyState.h b/lib/tgchat/ext/td/td/telegram/net/AuthKeyState.h index c2b60145..6e34170f 100644 --- a/lib/tgchat/ext/td/td/telegram/net/AuthKeyState.h +++ b/lib/tgchat/ext/td/td/telegram/net/AuthKeyState.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.cpp b/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.cpp index 3ecb7fe5..e56fe6a7 100644 --- a/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -10,7 +10,6 @@ #include "td/telegram/Global.h" #include "td/telegram/LinkManager.h" #include "td/telegram/logevent/LogEvent.h" -#include "td/telegram/MessagesManager.h" #include "td/telegram/net/MtprotoHeader.h" #include "td/telegram/net/NetQueryDispatcher.h" #include "td/telegram/net/NetType.h" @@ -558,7 +557,7 @@ void ConnectionCreator::enable_proxy_impl(int32 proxy_id) { void ConnectionCreator::disable_proxy_impl() { if (active_proxy_id_ == 0) { - send_closure(G()->messages_manager(), &MessagesManager::remove_sponsored_dialog); + send_closure(G()->promo_data_manager(), &PromoDataManager::remove_sponsored_dialog); send_closure(G()->promo_data_manager(), &PromoDataManager::reload_promo_data); return; } @@ -592,7 +591,7 @@ void ConnectionCreator::on_proxy_changed(bool from_db) { proxy_ip_address_ = IPAddress(); if (active_proxy_id_ == 0 || !from_db) { - send_closure(G()->messages_manager(), &MessagesManager::remove_sponsored_dialog); + send_closure(G()->promo_data_manager(), &PromoDataManager::remove_sponsored_dialog); } send_closure(G()->promo_data_manager(), &PromoDataManager::reload_promo_data); diff --git a/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.h b/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.h index 37b7447f..5c45f325 100644 --- a/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.h +++ b/lib/tgchat/ext/td/td/telegram/net/ConnectionCreator.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.cpp b/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.cpp index 86f6409d..7cb7f751 100644 --- a/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.h b/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.h index 397b52bf..2f57cf40 100644 --- a/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.h +++ b/lib/tgchat/ext/td/td/telegram/net/DcAuthManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/DcId.h b/lib/tgchat/ext/td/td/telegram/net/DcId.h index 4eb9e046..afb00eb7 100644 --- a/lib/tgchat/ext/td/td/telegram/net/DcId.h +++ b/lib/tgchat/ext/td/td/telegram/net/DcId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/DcOptions.h b/lib/tgchat/ext/td/td/telegram/net/DcOptions.h index 978514de..3fd1d6ea 100644 --- a/lib/tgchat/ext/td/td/telegram/net/DcOptions.h +++ b/lib/tgchat/ext/td/td/telegram/net/DcOptions.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.cpp b/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.cpp index 5ca5d44e..f3191476 100644 --- a/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.h b/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.h index 65c4a8d5..bee31821 100644 --- a/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.h +++ b/lib/tgchat/ext/td/td/telegram/net/DcOptionsSet.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.cpp b/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.cpp index 9f26290a..c7948794 100644 --- a/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.h b/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.h index 2bc20db7..6e4a3439 100644 --- a/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.h +++ b/lib/tgchat/ext/td/td/telegram/net/MtprotoHeader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetActor.cpp b/lib/tgchat/ext/td/td/telegram/net/NetActor.cpp index 12d5bfc0..0a154c2b 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetActor.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetActor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetActor.h b/lib/tgchat/ext/td/td/telegram/net/NetActor.h index 15f4100e..50d507d1 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetActor.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQuery.cpp b/lib/tgchat/ext/td/td/telegram/net/NetQuery.cpp index 9da54dd0..16a89b3b 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQuery.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetQuery.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQuery.h b/lib/tgchat/ext/td/td/telegram/net/NetQuery.h index c1173d5e..b64e4340 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQuery.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQuery.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryCounter.h b/lib/tgchat/ext/td/td/telegram/net/NetQueryCounter.h index cbd5edbc..b987a31c 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryCounter.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryCounter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.cpp b/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.cpp index 7638019e..6faaf375 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.h b/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.h index d2e774be..2df6675e 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryCreator.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.cpp b/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.cpp index 108959b8..72ab66fa 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.h b/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.h index 191c5738..1dc4339c 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryDelayer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.cpp b/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.cpp index fa4fe0f4..df947497 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -213,6 +213,7 @@ Status NetQueryDispatcher::wait_dc_init(DcId dc_id, bool force) { int32 session_count = get_session_count(); bool use_pfs = get_use_pfs(); + int32 main_session_scheduler_id = G()->get_main_session_scheduler_id(); int32 slow_net_scheduler_id = G()->get_slow_net_scheduler_id(); auto raw_dc_id = dc_id.get_raw_id(); @@ -221,8 +222,8 @@ Status NetQueryDispatcher::wait_dc_init(DcId dc_id, bool force) { int32 download_session_count = is_premium ? 8 : 2; int32 download_small_session_count = is_premium ? 8 : 2; dc.main_session_ = create_actor_on_scheduler( - PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":main", get_main_session_scheduler_id(), session_count, - auth_data, true, raw_dc_id == main_dc_id_, use_pfs, false, false, is_cdn); + PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":main", main_session_scheduler_id, session_count, auth_data, + true, raw_dc_id == main_dc_id_, use_pfs, false, false, is_cdn); dc.upload_session_ = create_actor_on_scheduler( PSLICE() << "SessionMultiProxy:" << raw_dc_id << ":upload", slow_net_scheduler_id, upload_session_count, auth_data, false, false, use_pfs, false, true, is_cdn); @@ -341,10 +342,6 @@ bool NetQueryDispatcher::get_use_pfs() { return G()->get_option_boolean("use_pfs") || get_session_count() > 1; } -int32 NetQueryDispatcher::get_main_session_scheduler_id() { - return G()->use_sqlite_pmc() ? -1 : G()->get_database_scheduler_id(); -} - NetQueryDispatcher::NetQueryDispatcher(const std::function()> &create_reference) { auto s_main_dc_id = G()->td_db()->get_binlog_pmc()->get("main_dc_id"); if (!s_main_dc_id.empty()) { @@ -354,8 +351,8 @@ NetQueryDispatcher::NetQueryDispatcher(const std::function()> &cre #if TD_ANDROID || TD_DARWIN_IOS || TD_DARWIN_VISION_OS || TD_DARWIN_WATCH_OS || TD_TEST_VERIFICATION verifier_ = create_actor("NetQueryVerifier", create_reference()); #endif - dc_auth_manager_ = - create_actor_on_scheduler("DcAuthManager", get_main_session_scheduler_id(), create_reference()); + dc_auth_manager_ = create_actor_on_scheduler("DcAuthManager", G()->get_main_session_scheduler_id(), + create_reference()); public_rsa_key_watchdog_ = create_actor("PublicRsaKeyWatchdog", create_reference()); sequence_dispatcher_ = MultiSequenceDispatcher::create("MultiSequenceDispatcher"); diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.h b/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.h index 6023530c..2e6643e8 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryDispatcher.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -89,7 +89,6 @@ class NetQueryDispatcher { Status wait_dc_init(DcId dc_id, bool force); bool is_dc_inited(int32 raw_dc_id); - static int32 get_main_session_scheduler_id(); static int32 get_session_count(); static bool get_use_pfs(); diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.cpp b/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.cpp index c9d561cc..e978cb69 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.h b/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.h index 78e89328..85dabca0 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryStats.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.cpp b/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.cpp index 9aa8c607..fbd76887 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.h b/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.h index 038abf81..db2b4b43 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetQueryVerifier.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.cpp b/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.cpp index e20900b0..32db4c55 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.h b/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.h index d35e36cc..fe2c629b 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetStatsManager.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/NetType.h b/lib/tgchat/ext/td/td/telegram/net/NetType.h index 1b850139..3c85c2d1 100644 --- a/lib/tgchat/ext/td/td/telegram/net/NetType.h +++ b/lib/tgchat/ext/td/td/telegram/net/NetType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/Proxy.cpp b/lib/tgchat/ext/td/td/telegram/net/Proxy.cpp index ac0020f2..b895a804 100644 --- a/lib/tgchat/ext/td/td/telegram/net/Proxy.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/Proxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/Proxy.h b/lib/tgchat/ext/td/td/telegram/net/Proxy.h index cb9adac6..34d8f3b7 100644 --- a/lib/tgchat/ext/td/td/telegram/net/Proxy.h +++ b/lib/tgchat/ext/td/td/telegram/net/Proxy.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.cpp b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.cpp index 8fa12374..ee1e4318 100644 --- a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.h b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.h index a4157efc..f87b68b3 100644 --- a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.h +++ b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedCdn.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.cpp b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.cpp index e32f579c..3ae69db1 100644 --- a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.h b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.h index bbaed538..34ebac34 100644 --- a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.h +++ b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeySharedMain.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.cpp b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.cpp index cc351182..110de616 100644 --- a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.h b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.h index 52d837f3..f9eb6ab0 100644 --- a/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.h +++ b/lib/tgchat/ext/td/td/telegram/net/PublicRsaKeyWatchdog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/Session.cpp b/lib/tgchat/ext/td/td/telegram/net/Session.cpp index 8e4dc2a1..40980f48 100644 --- a/lib/tgchat/ext/td/td/telegram/net/Session.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/Session.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/Session.h b/lib/tgchat/ext/td/td/telegram/net/Session.h index 290d3d67..a557ffb1 100644 --- a/lib/tgchat/ext/td/td/telegram/net/Session.h +++ b/lib/tgchat/ext/td/td/telegram/net/Session.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.cpp b/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.cpp index 6fbaa1ac..21092761 100644 --- a/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.h b/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.h index ad866a9c..3b21b438 100644 --- a/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.h +++ b/lib/tgchat/ext/td/td/telegram/net/SessionMultiProxy.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/SessionProxy.cpp b/lib/tgchat/ext/td/td/telegram/net/SessionProxy.cpp index db242e69..70b4745c 100644 --- a/lib/tgchat/ext/td/td/telegram/net/SessionProxy.cpp +++ b/lib/tgchat/ext/td/td/telegram/net/SessionProxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/SessionProxy.h b/lib/tgchat/ext/td/td/telegram/net/SessionProxy.h index fb3033c5..4bb2da33 100644 --- a/lib/tgchat/ext/td/td/telegram/net/SessionProxy.h +++ b/lib/tgchat/ext/td/td/telegram/net/SessionProxy.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/net/TempAuthKeyWatchdog.h b/lib/tgchat/ext/td/td/telegram/net/TempAuthKeyWatchdog.h index 2da94648..e901d00a 100644 --- a/lib/tgchat/ext/td/td/telegram/net/TempAuthKeyWatchdog.h +++ b/lib/tgchat/ext/td/td/telegram/net/TempAuthKeyWatchdog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_c_client.cpp b/lib/tgchat/ext/td/td/telegram/td_c_client.cpp index 79a6da8c..bea04e92 100644 --- a/lib/tgchat/ext/td/td/telegram/td_c_client.cpp +++ b/lib/tgchat/ext/td/td/telegram/td_c_client.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_c_client.h b/lib/tgchat/ext/td/td/telegram/td_c_client.h index d1621a56..8bab835d 100644 --- a/lib/tgchat/ext/td/td/telegram/td_c_client.h +++ b/lib/tgchat/ext/td/td/telegram/td_c_client.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_emscripten.cpp b/lib/tgchat/ext/td/td/telegram/td_emscripten.cpp index a70cca24..52244ed3 100644 --- a/lib/tgchat/ext/td/td/telegram/td_emscripten.cpp +++ b/lib/tgchat/ext/td/td/telegram/td_emscripten.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_json_client.cpp b/lib/tgchat/ext/td/td/telegram/td_json_client.cpp index e7b59cbc..71f309a5 100644 --- a/lib/tgchat/ext/td/td/telegram/td_json_client.cpp +++ b/lib/tgchat/ext/td/td/telegram/td_json_client.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_json_client.h b/lib/tgchat/ext/td/td/telegram/td_json_client.h index af3456e2..7ae87fc0 100644 --- a/lib/tgchat/ext/td/td/telegram/td_json_client.h +++ b/lib/tgchat/ext/td/td/telegram/td_json_client.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_log.cpp b/lib/tgchat/ext/td/td/telegram/td_log.cpp index e1f896a7..a8960cfc 100644 --- a/lib/tgchat/ext/td/td/telegram/td_log.cpp +++ b/lib/tgchat/ext/td/td/telegram/td_log.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/telegram/td_log.h b/lib/tgchat/ext/td/td/telegram/td_log.h index 607f5879..cb173a16 100644 --- a/lib/tgchat/ext/td/td/telegram/td_log.h +++ b/lib/tgchat/ext/td/td/telegram/td_log.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/tl/TlObject.h b/lib/tgchat/ext/td/td/tl/TlObject.h index ae4d3806..a5c8c748 100644 --- a/lib/tgchat/ext/td/td/tl/TlObject.h +++ b/lib/tgchat/ext/td/td/tl/TlObject.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/tl/tl_dotnet_object.h b/lib/tgchat/ext/td/td/tl/tl_dotnet_object.h index 1c7b0207..9bbd4bd1 100644 --- a/lib/tgchat/ext/td/td/tl/tl_dotnet_object.h +++ b/lib/tgchat/ext/td/td/tl/tl_dotnet_object.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/tl/tl_jni_object.cpp b/lib/tgchat/ext/td/td/tl/tl_jni_object.cpp index 2ede2266..55a7034d 100644 --- a/lib/tgchat/ext/td/td/tl/tl_jni_object.cpp +++ b/lib/tgchat/ext/td/td/tl/tl_jni_object.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/tl/tl_jni_object.h b/lib/tgchat/ext/td/td/tl/tl_jni_object.h index dcc2c1cf..c9d3f300 100644 --- a/lib/tgchat/ext/td/td/tl/tl_jni_object.h +++ b/lib/tgchat/ext/td/td/tl/tl_jni_object.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/tl/tl_json.h b/lib/tgchat/ext/td/td/tl/tl_json.h index 9832ca80..2df9769e 100644 --- a/lib/tgchat/ext/td/td/tl/tl_json.h +++ b/lib/tgchat/ext/td/td/tl/tl_json.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -31,7 +31,7 @@ inline void to_json(JsonValueScope &jv, const JsonInt64 json_int64) { } struct JsonVectorInt64 { - const std::vector &value; + const vector &value; }; inline void to_json(JsonValueScope &jv, const JsonVectorInt64 &vec) { @@ -51,7 +51,7 @@ void to_json(JsonValueScope &jv, const tl_object_ptr &value) { } template -void to_json(JsonValueScope &jv, const std::vector &v) { +void to_json(JsonValueScope &jv, const vector &v) { auto ja = jv.enter_array(); for (auto &value : v) { ja.enter_value() << ToJson(value); @@ -134,14 +134,14 @@ inline Status from_json_bytes(string &to, JsonValue from) { } template -Status from_json(std::vector &to, JsonValue from) { +Status from_json(vector &to, JsonValue from) { if (from.type() != JsonValue::Type::Array) { if (from.type() == JsonValue::Type::Null) { return Status::OK(); } return Status::Error(PSLICE() << "Expected Array, but receive " << from.type()); } - to = std::vector(from.get_array().size()); + to = vector(from.get_array().size()); size_t i = 0; for (auto &value : from.get_array()) { TRY_STATUS(from_json(to[i], std::move(value))); @@ -150,6 +150,22 @@ Status from_json(std::vector &to, JsonValue from) { return Status::OK(); } +inline Status from_json_bytes(vector &to, JsonValue from) { + if (from.type() != JsonValue::Type::Array) { + if (from.type() == JsonValue::Type::Null) { + return Status::OK(); + } + return Status::Error(PSLICE() << "Expected Array, but receive " << from.type()); + } + to = vector(from.get_array().size()); + size_t i = 0; + for (auto &value : from.get_array()) { + TRY_STATUS(from_json_bytes(to[i], std::move(value))); + i++; + } + return Status::OK(); +} + template std::enable_if_t::value, Status> from_json(tl_object_ptr &to, JsonValue from) { if (from.type() != JsonValue::Type::Object) { diff --git a/lib/tgchat/ext/td/td/tl/tl_object_parse.h b/lib/tgchat/ext/td/td/tl/tl_object_parse.h index a1c89d6e..28d1caf7 100644 --- a/lib/tgchat/ext/td/td/tl/tl_object_parse.h +++ b/lib/tgchat/ext/td/td/tl/tl_object_parse.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/td/tl/tl_object_store.h b/lib/tgchat/ext/td/td/tl/tl_object_store.h index 3d3747f8..eb9c1406 100644 --- a/lib/tgchat/ext/td/td/tl/tl_object_store.h +++ b/lib/tgchat/ext/td/td/tl/tl_object_store.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/example/example.cpp b/lib/tgchat/ext/td/tdactor/example/example.cpp index 3243b98c..0c06e838 100644 --- a/lib/tgchat/ext/td/tdactor/example/example.cpp +++ b/lib/tgchat/ext/td/tdactor/example/example.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.cpp b/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.cpp index f57c964f..9ec21e42 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.cpp +++ b/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.h b/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.h index 90dbd2d5..7649c04b 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/ConcurrentScheduler.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.cpp b/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.cpp index 8d01c432..d946d57f 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.cpp +++ b/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.h b/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.h index de6772e4..159839c4 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/MultiPromise.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.cpp b/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.cpp index a8882334..d798a33d 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.cpp +++ b/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.h b/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.h index c460c114..49f96da6 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/MultiTimeout.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/PromiseFuture.h b/lib/tgchat/ext/td/tdactor/td/actor/PromiseFuture.h index ce3b7bb4..84cf4163 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/PromiseFuture.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/PromiseFuture.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/SchedulerLocalStorage.h b/lib/tgchat/ext/td/tdactor/td/actor/SchedulerLocalStorage.h index c004bdba..71f74d4a 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/SchedulerLocalStorage.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/SchedulerLocalStorage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/SignalSlot.h b/lib/tgchat/ext/td/tdactor/td/actor/SignalSlot.h index c5817aa7..d99421e2 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/SignalSlot.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/SignalSlot.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/SleepActor.h b/lib/tgchat/ext/td/tdactor/td/actor/SleepActor.h index b44d3ba0..57ac2b81 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/SleepActor.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/SleepActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/Timeout.h b/lib/tgchat/ext/td/tdactor/td/actor/Timeout.h index eb4ce11e..3f8b6145 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/Timeout.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/Timeout.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/actor.h b/lib/tgchat/ext/td/tdactor/td/actor/actor.h index 318b1574..0b237ca3 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/actor.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/actor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor-decl.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor-decl.h index 0fd1ded0..68920cbb 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor-decl.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor-decl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor.h index 5ec72e34..ba05accd 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/Actor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId-decl.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId-decl.h index 88c82047..f6200052 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId-decl.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId-decl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId.h index 852f57bc..1bdbe6c2 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorId.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo-decl.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo-decl.h index 9eef77a2..8aaad412 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo-decl.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo-decl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo.h index b9ecaafe..e75bd3b1 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/ActorInfo.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/Event.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/Event.h index ceec14f5..8172a43c 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/Event.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/Event.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -22,7 +22,7 @@ class Actor; // Small structure (up to 16 bytes) used to send events between actors. // // There are some predefined types of events: -// NoType -- unitialized event +// NoType -- uninitialized event // Start -- start actor // Stop -- stop actor // Yield -- wake up actor diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull-decl.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull-decl.h index b47443c4..28e4d190 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull-decl.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull-decl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull.h index b285df88..a62a37cc 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/EventFull.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler-decl.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler-decl.h index 3aa9f8c3..f05aa794 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler-decl.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler-decl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.cpp b/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.cpp index f107602f..c7bb795d 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.cpp +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.h b/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.h index 075adbaa..8a23ca03 100644 --- a/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.h +++ b/lib/tgchat/ext/td/tdactor/td/actor/impl/Scheduler.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/test/actors_bugs.cpp b/lib/tgchat/ext/td/tdactor/test/actors_bugs.cpp index f67bb430..9f41c9cc 100644 --- a/lib/tgchat/ext/td/tdactor/test/actors_bugs.cpp +++ b/lib/tgchat/ext/td/tdactor/test/actors_bugs.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/test/actors_main.cpp b/lib/tgchat/ext/td/tdactor/test/actors_main.cpp index 09b9db6e..501c27ec 100644 --- a/lib/tgchat/ext/td/tdactor/test/actors_main.cpp +++ b/lib/tgchat/ext/td/tdactor/test/actors_main.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/test/actors_simple.cpp b/lib/tgchat/ext/td/tdactor/test/actors_simple.cpp index 89a220d5..0fb8a55d 100644 --- a/lib/tgchat/ext/td/tdactor/test/actors_simple.cpp +++ b/lib/tgchat/ext/td/tdactor/test/actors_simple.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdactor/test/actors_workers.cpp b/lib/tgchat/ext/td/tdactor/test/actors_workers.cpp index 14203827..05b0ac6b 100644 --- a/lib/tgchat/ext/td/tdactor/test/actors_workers.cpp +++ b/lib/tgchat/ext/td/tdactor/test/actors_workers.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/BinlogKeyValue.h b/lib/tgchat/ext/td/tddb/td/db/BinlogKeyValue.h index a43c1ba8..1f95a986 100644 --- a/lib/tgchat/ext/td/tddb/td/db/BinlogKeyValue.h +++ b/lib/tgchat/ext/td/tddb/td/db/BinlogKeyValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/DbKey.h b/lib/tgchat/ext/td/tddb/td/db/DbKey.h index 3761b120..1c4d8d9c 100644 --- a/lib/tgchat/ext/td/tddb/td/db/DbKey.h +++ b/lib/tgchat/ext/td/tddb/td/db/DbKey.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/KeyValueSyncInterface.h b/lib/tgchat/ext/td/tddb/td/db/KeyValueSyncInterface.h index 2e68e3f7..33bbfd61 100644 --- a/lib/tgchat/ext/td/tddb/td/db/KeyValueSyncInterface.h +++ b/lib/tgchat/ext/td/tddb/td/db/KeyValueSyncInterface.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SeqKeyValue.h b/lib/tgchat/ext/td/tddb/td/db/SeqKeyValue.h index 125f0360..6b3e0987 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SeqKeyValue.h +++ b/lib/tgchat/ext/td/tddb/td/db/SeqKeyValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.cpp b/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.cpp index 8c4a7e64..8d651c3e 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.h b/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.h index c3da0259..3ba189ad 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.h +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteConnectionSafe.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteDb.cpp b/lib/tgchat/ext/td/tddb/td/db/SqliteDb.cpp index 21415ac2..dbf85d22 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteDb.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteDb.h b/lib/tgchat/ext/td/tddb/td/db/SqliteDb.h index 074c9114..133beb42 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteDb.h +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.cpp b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.cpp index 62f9071f..d79ebb4c 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.h b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.h index 222cbeb1..93625cbf 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.h +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.cpp b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.cpp index 094d97fb..8d705d8f 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.h b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.h index 54658b3e..ef69e040 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.h +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueAsync.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueSafe.h b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueSafe.h index adde5697..28788bc4 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueSafe.h +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteKeyValueSafe.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.cpp b/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.cpp index 55c416a3..f5cf15fd 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.h b/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.h index 6311bc70..bd838f7b 100644 --- a/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.h +++ b/lib/tgchat/ext/td/tddb/td/db/SqliteStatement.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/TQueue.cpp b/lib/tgchat/ext/td/tddb/td/db/TQueue.cpp index 160340e0..61f8c0a9 100644 --- a/lib/tgchat/ext/td/tddb/td/db/TQueue.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/TQueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/TQueue.h b/lib/tgchat/ext/td/tddb/td/db/TQueue.h index 18e29b74..edd940be 100644 --- a/lib/tgchat/ext/td/tddb/td/db/TQueue.h +++ b/lib/tgchat/ext/td/tddb/td/db/TQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/TsSeqKeyValue.h b/lib/tgchat/ext/td/tddb/td/db/TsSeqKeyValue.h index 48dd368d..aabfd683 100644 --- a/lib/tgchat/ext/td/tddb/td/db/TsSeqKeyValue.h +++ b/lib/tgchat/ext/td/tddb/td/db/TsSeqKeyValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.cpp b/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.cpp index 76ca502a..43c0e6e3 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.h b/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.h index 82b8276a..991daa0a 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/Binlog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.cpp b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.cpp index 9ad4c5d6..a8eebc9c 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.h b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.h index 26f2465c..0ff1224d 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogEvent.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogHelper.h b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogHelper.h index cdfcc99d..c5d76098 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogHelper.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogHelper.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogInterface.h b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogInterface.h index c6d6b966..9e674b3f 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogInterface.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/BinlogInterface.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.cpp b/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.cpp index 329e08d3..0050e562 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.h b/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.h index 321e2ebd..3fd7560e 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/ConcurrentBinlog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/binlog_dump.cpp b/lib/tgchat/ext/td/tddb/td/db/binlog/binlog_dump.cpp index 050b7b99..93b39d3b 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/binlog_dump.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/binlog_dump.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.cpp b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.cpp index 5133392b..fd5794d4 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.h b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.h index 682f11c1..5873280c 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsBuffer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp index eb65d6c9..c5ac459d 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.h b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.h index 50f243e5..5496c97c 100644 --- a/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.h +++ b/lib/tgchat/ext/td/tddb/td/db/binlog/detail/BinlogEventsProcessor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.cpp b/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.cpp index d919977e..db782c11 100644 --- a/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.cpp +++ b/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.h b/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.h index ec23d149..a61a82fe 100644 --- a/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.h +++ b/lib/tgchat/ext/td/tddb/td/db/detail/RawSqliteDb.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.h b/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.h index 25de0f40..b8ca027b 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.h +++ b/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.mm b/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.mm index 7703f914..0d56cffd 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.mm +++ b/lib/tgchat/ext/td/tdnet/td/net/DarwinHttp.mm @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.cpp b/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.cpp index 68ba5d1f..04968632 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.h b/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.h index 14a37119..2ff40166 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.h +++ b/lib/tgchat/ext/td/tdnet/td/net/GetHostByNameActor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.cpp index 38510a87..24858862 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.h b/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.h index 1f6a3e35..d7fe37d8 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpChunkedByteFlow.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.cpp index d310004e..5ccbbaf4 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.h b/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.h index b9352933..b2915aef 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpConnectionBase.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.cpp index a229c9b3..a06e3197 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.h b/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.h index 2275b0ea..3df1178d 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpContentLengthByteFlow.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpFile.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpFile.cpp index af3b773a..48c914ad 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpFile.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpFile.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpFile.h b/lib/tgchat/ext/td/tdnet/td/net/HttpFile.h index f66adfc7..7e5dbc5d 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpFile.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpFile.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpHeaderCreator.h b/lib/tgchat/ext/td/tdnet/td/net/HttpHeaderCreator.h index b978c3db..9b815346 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpHeaderCreator.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpHeaderCreator.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.cpp index b300f188..0c5aecc0 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.h b/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.h index 0ae461ee..3dcb59e9 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpInboundConnection.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.cpp index 4c3bb382..1a975c5e 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.h b/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.h index b942a449..cec8fc49 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpOutboundConnection.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.cpp index b15dc0a4..80b0d7b4 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.h b/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.h index 1d336613..93d916e1 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpProxy.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.cpp index 1bcad1e8..dcbbd3f2 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.h b/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.h index 8449c2bc..5d31f1d7 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpQuery.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpReader.cpp b/lib/tgchat/ext/td/tdnet/td/net/HttpReader.cpp index 6e144922..76fa773c 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpReader.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpReader.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/HttpReader.h b/lib/tgchat/ext/td/tdnet/td/net/HttpReader.h index 72635ca8..ab8c7c2b 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/HttpReader.h +++ b/lib/tgchat/ext/td/tdnet/td/net/HttpReader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/NetStats.h b/lib/tgchat/ext/td/tdnet/td/net/NetStats.h index 46f6c77b..c186be16 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/NetStats.h +++ b/lib/tgchat/ext/td/tdnet/td/net/NetStats.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/Socks5.cpp b/lib/tgchat/ext/td/tdnet/td/net/Socks5.cpp index ff5ed30d..68f11296 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/Socks5.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/Socks5.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/Socks5.h b/lib/tgchat/ext/td/tdnet/td/net/Socks5.h index 0e64faa6..26855351 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/Socks5.h +++ b/lib/tgchat/ext/td/tdnet/td/net/Socks5.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/SslCtx.cpp b/lib/tgchat/ext/td/tdnet/td/net/SslCtx.cpp index e12e2013..0bc1ee81 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/SslCtx.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/SslCtx.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/SslCtx.h b/lib/tgchat/ext/td/tdnet/td/net/SslCtx.h index fbad230a..6fae8704 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/SslCtx.h +++ b/lib/tgchat/ext/td/tdnet/td/net/SslCtx.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/SslStream.cpp b/lib/tgchat/ext/td/tdnet/td/net/SslStream.cpp index 22a3e078..2f8c4ce2 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/SslStream.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/SslStream.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/SslStream.h b/lib/tgchat/ext/td/tdnet/td/net/SslStream.h index 172fe547..b0bf2781 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/SslStream.h +++ b/lib/tgchat/ext/td/tdnet/td/net/SslStream.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/TcpListener.cpp b/lib/tgchat/ext/td/tdnet/td/net/TcpListener.cpp index 4201427e..df1253f5 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/TcpListener.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/TcpListener.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/TcpListener.h b/lib/tgchat/ext/td/tdnet/td/net/TcpListener.h index 900be6a1..b840ba93 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/TcpListener.h +++ b/lib/tgchat/ext/td/tdnet/td/net/TcpListener.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.cpp b/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.cpp index de2556f5..ba21adca 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.h b/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.h index fb243843..d872d090 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.h +++ b/lib/tgchat/ext/td/tdnet/td/net/TransparentProxy.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/Wget.cpp b/lib/tgchat/ext/td/tdnet/td/net/Wget.cpp index c16115b9..75f0fee3 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/Wget.cpp +++ b/lib/tgchat/ext/td/tdnet/td/net/Wget.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdnet/td/net/Wget.h b/lib/tgchat/ext/td/tdnet/td/net/Wget.h index bc017a1d..d5053499 100644 --- a/lib/tgchat/ext/td/tdnet/td/net/Wget.h +++ b/lib/tgchat/ext/td/tdnet/td/net/Wget.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_config.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_config.cpp index 8885084d..4807ab80 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_config.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_config.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_config.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_config.h index 5dabb68c..0b3e55fd 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_config.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_config.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_core.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_core.cpp index c6bf5d7d..5aca5733 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_core.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_core.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_core.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_core.h index 863f702a..e7f08543 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_core.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_core.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.cpp index 6dc313b3..30d06a7c 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.h index af888ca4..95009019 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_outputer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.cpp index 3c4467d8..9cfb0090 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.h index 2bae626d..4cd6b925 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_file_utils.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.cpp index e22bf22f..fc405f1e 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.h index a2c1223f..aed64c57 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_generate.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.cpp index c56281f1..a1f8bbf9 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.h index f2d4ff83..83a7c76f 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_outputer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_simple.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_simple.h index 1730baa4..b934cf78 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_simple.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_simple.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_simple_parser.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_simple_parser.h index d3c8edd1..9a94cb81 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_simple_parser.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_simple_parser.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.cpp index 4db3d8c7..e844b3bc 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.h index 6ba525eb..cf334e89 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_string_outputer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.cpp b/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.cpp index c423d7c4..0045d75e 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.cpp +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.h b/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.h index e9fe7d02..18df08b6 100644 --- a/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.h +++ b/lib/tgchat/ext/td/tdtl/td/tl/tl_writer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/generate/generate_mime_types_gperf.cpp b/lib/tgchat/ext/td/tdutils/generate/generate_mime_types_gperf.cpp index 1b56535c..0f7972f5 100644 --- a/lib/tgchat/ext/td/tdutils/generate/generate_mime_types_gperf.cpp +++ b/lib/tgchat/ext/td/tdutils/generate/generate_mime_types_gperf.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/AesCtrByteFlow.h b/lib/tgchat/ext/td/tdutils/td/utils/AesCtrByteFlow.h index 26765eaf..7a9bd209 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/AesCtrByteFlow.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/AesCtrByteFlow.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.cpp b/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.cpp index d9f46baa..872ed5c6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.h b/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.h index 4fce0802..664b36f1 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/AsyncFileLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/AtomicRead.h b/lib/tgchat/ext/td/tdutils/td/utils/AtomicRead.h index 8ca20bfd..8412e455 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/AtomicRead.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/AtomicRead.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/BigNum.cpp b/lib/tgchat/ext/td/tdutils/td/utils/BigNum.cpp index dcaf9811..b8c1290e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/BigNum.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/BigNum.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/BigNum.h b/lib/tgchat/ext/td/tdutils/td/utils/BigNum.h index 1510cc22..6967d87e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/BigNum.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/BigNum.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/BufferedFd.h b/lib/tgchat/ext/td/tdutils/td/utils/BufferedFd.h index 4270829c..734842dd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/BufferedFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/BufferedFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/BufferedReader.h b/lib/tgchat/ext/td/tdutils/td/utils/BufferedReader.h index 58473171..f4b4a78f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/BufferedReader.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/BufferedReader.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.cpp b/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.cpp index 596271b7..d1df558f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.h b/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.h index 1355d62e..4c030afa 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/BufferedUdp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ByteFlow.h b/lib/tgchat/ext/td/tdutils/td/utils/ByteFlow.h index 5a685f5e..83d63d86 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ByteFlow.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ByteFlow.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/CancellationToken.h b/lib/tgchat/ext/td/tdutils/td/utils/CancellationToken.h index 3d47a19e..7667ff64 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/CancellationToken.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/CancellationToken.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ChainScheduler.h b/lib/tgchat/ext/td/tdutils/td/utils/ChainScheduler.h index d30b1a06..9d6bce64 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ChainScheduler.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ChainScheduler.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ChangesProcessor.h b/lib/tgchat/ext/td/tdutils/td/utils/ChangesProcessor.h index e0199a5a..ffc3b2bd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ChangesProcessor.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ChangesProcessor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Closure.h b/lib/tgchat/ext/td/tdutils/td/utils/Closure.h index 37de1247..eb47f661 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Closure.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Closure.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/CombinedLog.h b/lib/tgchat/ext/td/tdutils/td/utils/CombinedLog.h index 682fc272..05281387 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/CombinedLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/CombinedLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ConcurrentHashTable.h b/lib/tgchat/ext/td/tdutils/td/utils/ConcurrentHashTable.h index 0dfbbe34..b7bad15a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ConcurrentHashTable.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ConcurrentHashTable.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Container.h b/lib/tgchat/ext/td/tdutils/td/utils/Container.h index 1ea840f3..dd98df2e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Container.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Container.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Context.h b/lib/tgchat/ext/td/tdutils/td/utils/Context.h index 649bc5bf..d1dcc493 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Context.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Context.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/DecTree.h b/lib/tgchat/ext/td/tdutils/td/utils/DecTree.h index 0f8af734..a448da67 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/DecTree.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/DecTree.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Destructor.h b/lib/tgchat/ext/td/tdutils/td/utils/Destructor.h index b0e32cbf..2afb6a8f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Destructor.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Destructor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Enumerator.h b/lib/tgchat/ext/td/tdutils/td/utils/Enumerator.h index 9a49e055..6df3be16 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Enumerator.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Enumerator.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/EpochBasedMemoryReclamation.h b/lib/tgchat/ext/td/tdutils/td/utils/EpochBasedMemoryReclamation.h index 33d7ecd0..17b0db4c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/EpochBasedMemoryReclamation.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/EpochBasedMemoryReclamation.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.cpp b/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.cpp index f6259f58..a1287989 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.h b/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.h index fd089007..5d8c90dd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ExitGuard.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FileLog.cpp b/lib/tgchat/ext/td/tdutils/td/utils/FileLog.cpp index 150a2906..4b027450 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FileLog.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/FileLog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FileLog.h b/lib/tgchat/ext/td/tdutils/td/utils/FileLog.h index 25762a0e..271713de 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FileLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FileLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMap.h b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMap.h index 6ea919a4..411bd2b9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMap.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMap.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMapChunks.h b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMapChunks.h index fcf9d89d..35a7aee6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMapChunks.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashMapChunks.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashSet.h b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashSet.h index ca4398fd..e72a23d0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashSet.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashSet.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.cpp b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.cpp index f3ec65bb..1c582e62 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.h b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.h index cd7e7509..258a6687 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FlatHashTable.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlFast.h b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlFast.h index 92aa9c0d..6714ab5a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlFast.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlFast.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.cpp b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.cpp index 1635668a..ac57d0c6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.h b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.h index 04272e13..9c783c81 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlGlobal.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlStrict.h b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlStrict.h index ba5be827..5024c880 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/FloodControlStrict.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/FloodControlStrict.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Gzip.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Gzip.cpp index 34fa84bb..77b37413 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Gzip.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Gzip.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Gzip.h b/lib/tgchat/ext/td/tdutils/td/utils/Gzip.h index 71a74595..b5789aa1 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Gzip.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Gzip.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.cpp b/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.cpp index d4ad3c51..659e3ed9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.h b/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.h index c6611bec..f0daedfa 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/GzipByteFlow.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Hash.h b/lib/tgchat/ext/td/tdutils/td/utils/Hash.h index 96977301..9ea6c25f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Hash.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Hash.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HashMap.h b/lib/tgchat/ext/td/tdutils/td/utils/HashMap.h index 6445aef3..bb18f890 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HashMap.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/HashMap.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HashSet.h b/lib/tgchat/ext/td/tdutils/td/utils/HashSet.h index a0b9eb96..fc33f67d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HashSet.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/HashSet.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HashTableUtils.h b/lib/tgchat/ext/td/tdutils/td/utils/HashTableUtils.h index 21d4104d..f6ed5aaf 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HashTableUtils.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/HashTableUtils.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HazardPointers.h b/lib/tgchat/ext/td/tdutils/td/utils/HazardPointers.h index 79715caa..e3459495 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HazardPointers.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/HazardPointers.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -78,7 +78,7 @@ class HazardPointers { } } - // old inteface + // old interface T *protect(size_t thread_id, size_t pos, std::atomic &ptr) { return do_protect(get_hazard_ptr(thread_id, pos), ptr); } diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Heap.h b/lib/tgchat/ext/td/tdutils/td/utils/Heap.h index dacd3345..b34ffae9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Heap.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Heap.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Hints.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Hints.cpp index 4ef7865a..a8539180 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Hints.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Hints.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Hints.h b/lib/tgchat/ext/td/tdutils/td/utils/Hints.h index 4b6072c3..66d645ff 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Hints.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Hints.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.cpp b/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.cpp index da290ae3..d1efdbaa 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.h b/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.h index a2daf078..3288685e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/HttpDate.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.cpp b/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.cpp index 5bc9e4a7..55869002 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.h b/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.h index 13173aed..1e5ad243 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/HttpUrl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.cpp b/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.cpp index a0aebb61..9263a202 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.h b/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.h index 3989cf76..1bccdfcc 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/JsonBuilder.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/List.h b/lib/tgchat/ext/td/tdutils/td/utils/List.h index 36319e68..83f44b43 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/List.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/List.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MapNode.h b/lib/tgchat/ext/td/tdutils/td/utils/MapNode.h index 9d87aad8..1d8f96a5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MapNode.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MapNode.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MemoryLog.h b/lib/tgchat/ext/td/tdutils/td/utils/MemoryLog.h index a925683e..7a88c5cf 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MemoryLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MemoryLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MimeType.cpp b/lib/tgchat/ext/td/tdutils/td/utils/MimeType.cpp index d9515c23..1c5b2cf8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MimeType.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/MimeType.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MimeType.h b/lib/tgchat/ext/td/tdutils/td/utils/MimeType.h index 4702be9b..d0ba6c1b 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MimeType.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MimeType.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MovableValue.h b/lib/tgchat/ext/td/tdutils/td/utils/MovableValue.h index 81787194..ee0813cc 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MovableValue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MovableValue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.cpp b/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.cpp index 60716009..953ec6e4 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.h b/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.h index 1a08768d..51dfafd9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MpmcQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MpmcWaiter.h b/lib/tgchat/ext/td/tdutils/td/utils/MpmcWaiter.h index 2ec315cf..8c4bb629 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MpmcWaiter.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MpmcWaiter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -281,7 +281,7 @@ class MpmcSleepyWaiter { auto view = StateView(state_.load()); //LOG(ERROR) << view.parked_count; if (view.searching_count > 0 || view.parked_count == 0) { - VLOG(waiter) << "Ingore notify: " << view.searching_count << ' ' << view.parked_count; + VLOG(waiter) << "Ignore notify: " << view.searching_count << ' ' << view.parked_count; return; } diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MpscLinkQueue.h b/lib/tgchat/ext/td/tdutils/td/utils/MpscLinkQueue.h index f3a80e8c..b062701f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MpscLinkQueue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MpscLinkQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/MpscPollableQueue.h b/lib/tgchat/ext/td/tdutils/td/utils/MpscPollableQueue.h index a642ee34..25dd70da 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/MpscPollableQueue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/MpscPollableQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Named.h b/lib/tgchat/ext/td/tdutils/td/utils/Named.h index 7290964e..1c7b88fd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Named.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Named.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/NullLog.h b/lib/tgchat/ext/td/tdutils/td/utils/NullLog.h index 7a72d8ab..1dc96bca 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/NullLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/NullLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ObjectPool.h b/lib/tgchat/ext/td/tdutils/td/utils/ObjectPool.h index 2d08d283..b3aebb61 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ObjectPool.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ObjectPool.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Observer.h b/lib/tgchat/ext/td/tdutils/td/utils/Observer.h index 558d6bb6..c0ab8303 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Observer.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Observer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.cpp b/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.cpp index f0dc6184..6abf8c60 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.h b/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.h index 32ef8868..25567bbb 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/OptionParser.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/OrderedEventsProcessor.h b/lib/tgchat/ext/td/tdutils/td/utils/OrderedEventsProcessor.h index 9bf6e14c..5e37fddc 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/OrderedEventsProcessor.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/OrderedEventsProcessor.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Parser.h b/lib/tgchat/ext/td/tdutils/td/utils/Parser.h index 60cad988..ffe47657 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Parser.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Parser.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/PathView.cpp b/lib/tgchat/ext/td/tdutils/td/utils/PathView.cpp index 75b0a64d..5a871069 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/PathView.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/PathView.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/PathView.h b/lib/tgchat/ext/td/tdutils/td/utils/PathView.h index 4a750362..e4e067a0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/PathView.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/PathView.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Promise.h b/lib/tgchat/ext/td/tdutils/td/utils/Promise.h index ce4365d2..630f1541 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Promise.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Promise.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Random.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Random.cpp index 6f42ea19..d83ce337 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Random.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Random.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Random.h b/lib/tgchat/ext/td/tdutils/td/utils/Random.h index b10f8b6b..261e6e88 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Random.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Random.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ScopeGuard.h b/lib/tgchat/ext/td/tdutils/td/utils/ScopeGuard.h index 48919c02..e1d2fd6a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ScopeGuard.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ScopeGuard.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/SetNode.h b/lib/tgchat/ext/td/tdutils/td/utils/SetNode.h index a637a836..167a18c8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/SetNode.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/SetNode.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/SharedObjectPool.h b/lib/tgchat/ext/td/tdutils/td/utils/SharedObjectPool.h index 2f62d839..25e13f1e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/SharedObjectPool.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/SharedObjectPool.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.cpp b/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.cpp index 903f8952..a009fc17 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.h b/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.h index 2e370b4c..361ea4d1 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/SharedSlice.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Slice-decl.h b/lib/tgchat/ext/td/tdutils/td/utils/Slice-decl.h index 9a8493a9..acac8c91 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Slice-decl.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Slice-decl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Slice.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Slice.cpp index 4c73b843..99bd1180 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Slice.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Slice.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Slice.h b/lib/tgchat/ext/td/tdutils/td/utils/Slice.h index 3bfbcddd..1e55c256 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Slice.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Slice.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/SliceBuilder.h b/lib/tgchat/ext/td/tdutils/td/utils/SliceBuilder.h index e790e1be..70e59d00 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/SliceBuilder.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/SliceBuilder.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Span.h b/lib/tgchat/ext/td/tdutils/td/utils/Span.h index 55906ce6..3686885b 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Span.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Span.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/SpinLock.h b/lib/tgchat/ext/td/tdutils/td/utils/SpinLock.h index 5a68f2d9..d2a4f8b3 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/SpinLock.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/SpinLock.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.cpp b/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.cpp index 23e895d0..691afbd8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.h b/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.h index 993deada..a20c6f82 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/StackAllocator.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Status.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Status.cpp index 63636484..91a969f7 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Status.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Status.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Status.h b/lib/tgchat/ext/td/tdutils/td/utils/Status.h index a98885b0..8a976243 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Status.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Status.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/StealingQueue.h b/lib/tgchat/ext/td/tdutils/td/utils/StealingQueue.h index 3377dd56..092dbf80 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/StealingQueue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/StealingQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Storer.h b/lib/tgchat/ext/td/tdutils/td/utils/Storer.h index f44a6b51..53d2d0d0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Storer.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Storer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/StorerBase.h b/lib/tgchat/ext/td/tdutils/td/utils/StorerBase.h index 68efbade..c860054e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/StorerBase.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/StorerBase.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.cpp b/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.cpp index aa39c628..7a6116af 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.h b/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.h index 9251ba2e..b11ae44d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/StringBuilder.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ThreadLocalStorage.h b/lib/tgchat/ext/td/tdutils/td/utils/ThreadLocalStorage.h index 002e6956..cb543c11 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ThreadLocalStorage.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ThreadLocalStorage.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/ThreadSafeCounter.h b/lib/tgchat/ext/td/tdutils/td/utils/ThreadSafeCounter.h index da7f6a43..115531f4 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/ThreadSafeCounter.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/ThreadSafeCounter.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Time.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Time.cpp index db8aafeb..bbcd0ba0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Time.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Time.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Time.h b/lib/tgchat/ext/td/tdutils/td/utils/Time.h index d57c6059..3429438d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Time.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Time.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TimedStat.h b/lib/tgchat/ext/td/tdutils/td/utils/TimedStat.h index e2dd6a77..642db058 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TimedStat.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TimedStat.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Timer.cpp b/lib/tgchat/ext/td/tdutils/td/utils/Timer.cpp index 8721f0b6..98e52389 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Timer.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/Timer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Timer.h b/lib/tgchat/ext/td/tdutils/td/utils/Timer.h index 7fb0141c..ffce64b6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Timer.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Timer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TlDowncastHelper.h b/lib/tgchat/ext/td/tdutils/td/utils/TlDowncastHelper.h index ba5a8ec1..03953027 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TlDowncastHelper.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TlDowncastHelper.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TlStorerToString.h b/lib/tgchat/ext/td/tdutils/td/utils/TlStorerToString.h index cb144fe1..f5b45ac5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TlStorerToString.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TlStorerToString.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.cpp b/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.cpp index 5cf8ae4f..e193c1d2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.h b/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.h index b2abf47b..eb9d8d09 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsCerr.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.cpp b/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.cpp index 067c182b..fb0ac7cd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.h b/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.h index f7464dc2..370054df 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsFileLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsList.h b/lib/tgchat/ext/td/tdutils/td/utils/TsList.h index dacac43d..cd06d76d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsList.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsList.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsLog.cpp b/lib/tgchat/ext/td/tdutils/td/utils/TsLog.cpp index 06cb6b5e..f332eec7 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsLog.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsLog.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/TsLog.h b/lib/tgchat/ext/td/tdutils/td/utils/TsLog.h index ef3127f4..932fa69b 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/TsLog.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/TsLog.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/UInt.h b/lib/tgchat/ext/td/tdutils/td/utils/UInt.h index 87f5881f..b7a37a35 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/UInt.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/UInt.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/Variant.h b/lib/tgchat/ext/td/tdutils/td/utils/Variant.h index d9112ab4..22306954 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/Variant.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/Variant.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/VectorQueue.h b/lib/tgchat/ext/td/tdutils/td/utils/VectorQueue.h index ea0ca686..3607ac1c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/VectorQueue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/VectorQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashMap.h b/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashMap.h index d0d4a0e4..592ac96d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashMap.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashMap.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashSet.h b/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashSet.h index ef956a8d..68d1baab 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashSet.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeHashSet.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeVector.h b/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeVector.h index bf071029..70cb5b20 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeVector.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/WaitFreeVector.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/algorithm.h b/lib/tgchat/ext/td/tdutils/td/utils/algorithm.h index 410854bc..a87de8ec 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/algorithm.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/algorithm.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/as.h b/lib/tgchat/ext/td/tdutils/td/utils/as.h index 741a1e98..c97179d7 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/as.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/as.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/base64.cpp b/lib/tgchat/ext/td/tdutils/td/utils/base64.cpp index 8378cf6a..79623675 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/base64.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/base64.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/base64.h b/lib/tgchat/ext/td/tdutils/td/utils/base64.h index fd2f8b52..fc6a80c2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/base64.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/base64.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/benchmark.h b/lib/tgchat/ext/td/tdutils/td/utils/benchmark.h index 87e4c694..8775bb17 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/benchmark.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/benchmark.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/bits.h b/lib/tgchat/ext/td/tdutils/td/utils/bits.h index 25805435..85634c40 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/bits.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/bits.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/buffer.cpp b/lib/tgchat/ext/td/tdutils/td/utils/buffer.cpp index a24694b8..03f98937 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/buffer.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/buffer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/buffer.h b/lib/tgchat/ext/td/tdutils/td/utils/buffer.h index 6c86577f..6e5084a0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/buffer.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/buffer.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/check.cpp b/lib/tgchat/ext/td/tdutils/td/utils/check.cpp index 617f0bbd..26bcd27a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/check.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/check.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/check.h b/lib/tgchat/ext/td/tdutils/td/utils/check.h index c8068090..4f077ce8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/check.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/check.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/common.h b/lib/tgchat/ext/td/tdutils/td/utils/common.h index 7e2229a0..dd67abcd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/common.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/common.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/crypto.cpp b/lib/tgchat/ext/td/tdutils/td/utils/crypto.cpp index dee0e251..844a1ef1 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/crypto.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/crypto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/crypto.h b/lib/tgchat/ext/td/tdutils/td/utils/crypto.h index 6bacb44f..0579f24d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/crypto.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/crypto.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/emoji.cpp b/lib/tgchat/ext/td/tdutils/td/utils/emoji.cpp index ad5da1f7..0a2c8020 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/emoji.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/emoji.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/emoji.h b/lib/tgchat/ext/td/tdutils/td/utils/emoji.h index 9efd0519..a9877d58 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/emoji.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/emoji.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/filesystem.cpp b/lib/tgchat/ext/td/tdutils/td/utils/filesystem.cpp index 80d9353a..f520bbf2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/filesystem.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/filesystem.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/filesystem.h b/lib/tgchat/ext/td/tdutils/td/utils/filesystem.h index 474728d3..e5090930 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/filesystem.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/filesystem.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.cpp b/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.cpp index 988db011..5ef98db2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.h b/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.h index 33ec2290..b7ad5701 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/find_boundary.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/fixed_vector.h b/lib/tgchat/ext/td/tdutils/td/utils/fixed_vector.h index a026ba96..fc86458b 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/fixed_vector.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/fixed_vector.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/format.h b/lib/tgchat/ext/td/tdutils/td/utils/format.h index cb522080..6d173634 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/format.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/format.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/int_types.h b/lib/tgchat/ext/td/tdutils/td/utils/int_types.h index 4d8effe3..a1203a08 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/int_types.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/int_types.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/invoke.h b/lib/tgchat/ext/td/tdutils/td/utils/invoke.h index ea9ef357..75fdb8cb 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/invoke.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/invoke.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/logging.cpp b/lib/tgchat/ext/td/tdutils/td/utils/logging.cpp index 8ddf8064..ee2c4591 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/logging.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/logging.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/logging.h b/lib/tgchat/ext/td/tdutils/td/utils/logging.h index 010530ad..8d04f4b2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/logging.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/logging.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/misc.cpp b/lib/tgchat/ext/td/tdutils/td/utils/misc.cpp index cb3dcac6..4d3050c6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/misc.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/misc.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/misc.h b/lib/tgchat/ext/td/tdutils/td/utils/misc.h index 9c5a76f6..824d7546 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/misc.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/misc.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/optional.h b/lib/tgchat/ext/td/tdutils/td/utils/optional.h index bb7e4bc8..64b4194c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/optional.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/optional.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/overloaded.h b/lib/tgchat/ext/td/tdutils/td/utils/overloaded.h index af9b3830..b9292cc3 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/overloaded.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/overloaded.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.cpp index 8ef8f64f..2de33b63 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.h b/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.h index 37fc1107..e4a8e16d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/Clocks.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/CxCli.h b/lib/tgchat/ext/td/tdutils/td/utils/port/CxCli.h index 34bfb2bf..51093c00 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/CxCli.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/CxCli.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/EventFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/EventFd.h index a6a336dd..ff411a0c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/EventFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/EventFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/EventFdBase.h b/lib/tgchat/ext/td/tdutils/td/utils/port/EventFdBase.h index 699c602e..be0195ca 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/EventFdBase.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/EventFdBase.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.cpp index 23f7f33d..69f54e3c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.h index f140b356..492a7f76 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/FileFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/FromApp.h b/lib/tgchat/ext/td/tdutils/td/utils/port/FromApp.h index 23125b6c..a7246b91 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/FromApp.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/FromApp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.cpp index 1015fd0c..eedae254 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.h b/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.h index 7caebbad..d5a3901c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/IPAddress.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/IoSlice.h b/lib/tgchat/ext/td/tdutils/td/utils/port/IoSlice.h index 7fc4e268..1a222bd5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/IoSlice.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/IoSlice.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.cpp index 8c857ee4..85cdf75f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.h b/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.h index 8cae55f8..d637d5c9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/MemoryMapping.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/Mutex.h b/lib/tgchat/ext/td/tdutils/td/utils/port/Mutex.h index e2274de7..b4a77113 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/Mutex.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/Mutex.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/Poll.h b/lib/tgchat/ext/td/tdutils/td/utils/port/Poll.h index ecbea841..50798db3 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/Poll.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/Poll.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/PollBase.h b/lib/tgchat/ext/td/tdutils/td/utils/port/PollBase.h index a7d638d7..5b84ea6a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/PollBase.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/PollBase.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.cpp index 94ffb07e..40bbffc1 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.h b/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.h index e9e07285..ec426b25 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/PollFlags.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/RwMutex.h b/lib/tgchat/ext/td/tdutils/td/utils/port/RwMutex.h index 2cc36aa0..2b73d087 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/RwMutex.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/RwMutex.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.cpp index 72578a9b..440a1c8e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.h index dcee8991..14d4f3b3 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/ServerSocketFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.cpp index ac4038c3..364e123c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.h index 40f3a932..3bd6e75d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/SocketFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.cpp index acb0c5dd..90bf3bd6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,6 +17,7 @@ #include "td/utils/port/detail/skip_eintr.h" #include "td/utils/ScopeGuard.h" #include "td/utils/SliceBuilder.h" +#include "td/utils/StackAllocator.h" #include @@ -231,10 +232,13 @@ Result mem_stat() { fd.close(); }; - constexpr int TMEM_SIZE = 10000; - char mem[TMEM_SIZE]; + constexpr size_t TMEM_SIZE = 65536; + auto buf = StackAllocator::alloc(TMEM_SIZE); + char *mem = buf.as_slice().data(); TRY_RESULT(size, fd.read(MutableSlice(mem, TMEM_SIZE - 1))); - CHECK(size < TMEM_SIZE - 1); + if (size >= TMEM_SIZE - 1) { + return Status::Error("The file /proc/self/status is too big"); + } mem[size] = 0; const char *s = mem; @@ -312,11 +316,12 @@ Status cpu_stat_self(CpuStat &stat) { fd.close(); }; - constexpr int TMEM_SIZE = 10000; - char mem[TMEM_SIZE]; + constexpr size_t TMEM_SIZE = 65536; + auto buf = StackAllocator::alloc(TMEM_SIZE); + char *mem = buf.as_slice().data(); TRY_RESULT(size, fd.read(MutableSlice(mem, TMEM_SIZE - 1))); if (size >= TMEM_SIZE - 1) { - return Status::Error("Failed for read /proc/self/stat"); + return Status::Error("The file /proc/self/stat is too big"); } mem[size] = 0; @@ -350,11 +355,12 @@ Status cpu_stat_total(CpuStat &stat) { fd.close(); }; - constexpr int TMEM_SIZE = 10000; - char mem[TMEM_SIZE]; + constexpr size_t TMEM_SIZE = 65536; + auto buf = StackAllocator::alloc(TMEM_SIZE); + char *mem = buf.as_slice().data(); TRY_RESULT(size, fd.read(MutableSlice(mem, TMEM_SIZE - 1))); if (size >= TMEM_SIZE - 1) { - return Status::Error("Failed for read /proc/stat"); + return Status::Error("The file /proc/stat is too big"); } mem[size] = 0; diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.h b/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.h index da105617..305f71d4 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/Stat.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.cpp index a0320e7f..1db6581f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.h b/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.h index b78f85ac..da23659a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/StdStreams.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.cpp index cd4641b1..fd7643a8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.h index 53d7755b..1ce8c339 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/UdpSocketFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/config.h b/lib/tgchat/ext/td/tdutils/td/utils/port/config.h index b5c9774c..02675d38 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/config.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/config.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.cpp index 79fd1ab6..63c4dc41 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.h index f9c17dc9..a8d4228e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Epoll.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.cpp index 865f10c4..1a3bc188 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.h index 30c2bdfb..225a1212 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdBsd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.cpp index 48b6de53..227c567a 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.h index c6f0adf4..c05a81a3 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdLinux.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.cpp index f6d82ca8..c38c4307 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.h index ec134d3f..9ca76c37 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/EventFdWindows.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.cpp index df5087c6..48e75a5c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.h index 878a88bf..a82ae13d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Iocp.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.cpp index 3c65c0f8..dc7626a6 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.h index a0ea7f0f..e735e9dd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/KQueue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.cpp index 479498ee..4f128927 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.h index a2af773b..b5d6c295 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/NativeFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.cpp index 3dcb9710..0dbb1b55 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.h index 34307eb0..343a6211 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Poll.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/PollableFd.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/PollableFd.h index a0539dfc..2f46cfeb 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/PollableFd.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/PollableFd.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.cpp index a0dc2b27..dd54c0e0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.h index c6d170ae..2b11d05c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/Select.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.cpp index b8c40730..c17e8d24 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.h index c575a3ec..6e0f2bb0 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadIdGuard.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.cpp index 2c7fb18e..dd9bfeeb 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.h index 867bc451..cbcfce87 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadPthread.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadStl.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadStl.h index aacb342b..4bff1317 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadStl.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/ThreadStl.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.cpp index b7df5176..c814d8dd 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.h index b5cf345c..83b6def2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/WineventPoll.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/skip_eintr.h b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/skip_eintr.h index f743cff9..c941c448 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/detail/skip_eintr.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/detail/skip_eintr.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/path.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/path.cpp index 4d94ac5e..d7574b80 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/path.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/path.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/path.h b/lib/tgchat/ext/td/tdutils/td/utils/port/path.h index 1d611356..4448c973 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/path.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/path.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/platform.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/platform.cpp index 39b1fe3d..bd76280d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/platform.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/platform.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/platform.h b/lib/tgchat/ext/td/tdutils/td/utils/port/platform.h index 7ca7ee20..d6ee70a5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/platform.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/platform.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.cpp index 7d3d63ea..658e1c5d 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.h b/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.h index 569385bf..cf53f7b8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/rlimit.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/signals.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/signals.cpp index cce7d7c7..b8375a21 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/signals.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/signals.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/signals.h b/lib/tgchat/ext/td/tdutils/td/utils/port/signals.h index 27bf1aaf..d01b712b 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/signals.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/signals.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.cpp index 43305a01..73fa415e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.h b/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.h index e3c6b7dc..3608ace5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/sleep.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.cpp index eddaa85e..485aa6ed 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.h b/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.h index bea26ed1..312c8e59 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/stacktrace.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/thread.h b/lib/tgchat/ext/td/tdutils/td/utils/port/thread.h index 03eba998..96cbb9ae 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/thread.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/thread.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.cpp index c5d8ee9e..5984a68e 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -23,7 +23,7 @@ void add_thread_local_destructor(unique_ptr destructor) { } // namespace detail void clear_thread_locals() { - // ensure that no destructors were added during destructors invokation + // ensure that no destructors were added during destructors invocation auto to_delete = detail::thread_local_destructors; detail::thread_local_destructors = nullptr; delete to_delete; diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.h b/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.h index b8d8aa2b..288bc8ea 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/thread_local.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/uname.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/uname.cpp index 5b9dc855..97a797a9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/uname.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/uname.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/uname.h b/lib/tgchat/ext/td/tdutils/td/utils/port/uname.h index 25fc1ee2..7685909f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/uname.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/uname.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/user.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/user.cpp index b6512807..4263097c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/user.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/user.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/user.h b/lib/tgchat/ext/td/tdutils/td/utils/port/user.h index 9d52d110..80f155d8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/user.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/user.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.cpp b/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.cpp index 7ea36648..1dd6fa53 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.h b/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.h index 12be2eb9..e310dbc2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/port/wstring_convert.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/queue.h b/lib/tgchat/ext/td/tdutils/td/utils/queue.h index f888ff8e..3ce0e2e8 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/queue.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/queue.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/tests.cpp b/lib/tgchat/ext/td/tdutils/td/utils/tests.cpp index e47d915f..bc224b5c 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/tests.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/tests.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/tests.h b/lib/tgchat/ext/td/tdutils/td/utils/tests.h index b5bda386..bdb8a108 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/tests.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/tests.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/tl_helpers.h b/lib/tgchat/ext/td/tdutils/td/utils/tl_helpers.h index f0b95d93..134fdaae 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/tl_helpers.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/tl_helpers.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.cpp b/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.cpp index 9a346a26..d6d29141 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.h b/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.h index f08009b5..57f69cee 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/tl_parsers.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/tl_storers.h b/lib/tgchat/ext/td/tdutils/td/utils/tl_storers.h index 0ddecdd1..a72c03a2 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/tl_storers.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/tl_storers.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/translit.cpp b/lib/tgchat/ext/td/tdutils/td/utils/translit.cpp index 22dd80bb..bdbe84ea 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/translit.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/translit.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/translit.h b/lib/tgchat/ext/td/tdutils/td/utils/translit.h index ca2625d8..8c26a323 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/translit.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/translit.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/type_traits.h b/lib/tgchat/ext/td/tdutils/td/utils/type_traits.h index 803bcadd..7ec72fb5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/type_traits.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/type_traits.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/uint128.h b/lib/tgchat/ext/td/tdutils/td/utils/uint128.h index c8167d8b..ca64dbf9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/uint128.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/uint128.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/unicode.cpp b/lib/tgchat/ext/td/tdutils/td/utils/unicode.cpp index fcaef759..0c2a39d9 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/unicode.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/unicode.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/unicode.h b/lib/tgchat/ext/td/tdutils/td/utils/unicode.h index a577be1a..b27279c5 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/unicode.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/unicode.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/unique_ptr.h b/lib/tgchat/ext/td/tdutils/td/utils/unique_ptr.h index dcda841e..b2896b10 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/unique_ptr.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/unique_ptr.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/unique_value_ptr.h b/lib/tgchat/ext/td/tdutils/td/utils/unique_value_ptr.h index cbbb5dbf..ce195851 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/unique_value_ptr.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/unique_value_ptr.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/utf8.cpp b/lib/tgchat/ext/td/tdutils/td/utils/utf8.cpp index 414dc7b4..05525ada 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/utf8.cpp +++ b/lib/tgchat/ext/td/tdutils/td/utils/utf8.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/td/utils/utf8.h b/lib/tgchat/ext/td/tdutils/td/utils/utf8.h index 588b94dc..b9db903f 100644 --- a/lib/tgchat/ext/td/tdutils/td/utils/utf8.h +++ b/lib/tgchat/ext/td/tdutils/td/utils/utf8.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/ChainScheduler.cpp b/lib/tgchat/ext/td/tdutils/test/ChainScheduler.cpp index f93a7181..19df4f8c 100644 --- a/lib/tgchat/ext/td/tdutils/test/ChainScheduler.cpp +++ b/lib/tgchat/ext/td/tdutils/test/ChainScheduler.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/ConcurrentHashMap.cpp b/lib/tgchat/ext/td/tdutils/test/ConcurrentHashMap.cpp index 7fbe25d0..6a30eb34 100644 --- a/lib/tgchat/ext/td/tdutils/test/ConcurrentHashMap.cpp +++ b/lib/tgchat/ext/td/tdutils/test/ConcurrentHashMap.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/Enumerator.cpp b/lib/tgchat/ext/td/tdutils/test/Enumerator.cpp index 5eb82547..dd1077ee 100644 --- a/lib/tgchat/ext/td/tdutils/test/Enumerator.cpp +++ b/lib/tgchat/ext/td/tdutils/test/Enumerator.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/EpochBasedMemoryReclamation.cpp b/lib/tgchat/ext/td/tdutils/test/EpochBasedMemoryReclamation.cpp index de34f024..8c694d7f 100644 --- a/lib/tgchat/ext/td/tdutils/test/EpochBasedMemoryReclamation.cpp +++ b/lib/tgchat/ext/td/tdutils/test/EpochBasedMemoryReclamation.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/HashSet.cpp b/lib/tgchat/ext/td/tdutils/test/HashSet.cpp index 089adf30..8595f39f 100644 --- a/lib/tgchat/ext/td/tdutils/test/HashSet.cpp +++ b/lib/tgchat/ext/td/tdutils/test/HashSet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/HazardPointers.cpp b/lib/tgchat/ext/td/tdutils/test/HazardPointers.cpp index f71fd32c..731e73a1 100644 --- a/lib/tgchat/ext/td/tdutils/test/HazardPointers.cpp +++ b/lib/tgchat/ext/td/tdutils/test/HazardPointers.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/HttpUrl.cpp b/lib/tgchat/ext/td/tdutils/test/HttpUrl.cpp index 63a2c75c..1b26c7ec 100644 --- a/lib/tgchat/ext/td/tdutils/test/HttpUrl.cpp +++ b/lib/tgchat/ext/td/tdutils/test/HttpUrl.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/List.cpp b/lib/tgchat/ext/td/tdutils/test/List.cpp index 0204df82..1fc8ae70 100644 --- a/lib/tgchat/ext/td/tdutils/test/List.cpp +++ b/lib/tgchat/ext/td/tdutils/test/List.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/MpmcQueue.cpp b/lib/tgchat/ext/td/tdutils/test/MpmcQueue.cpp index 130f6db4..fdb3099b 100644 --- a/lib/tgchat/ext/td/tdutils/test/MpmcQueue.cpp +++ b/lib/tgchat/ext/td/tdutils/test/MpmcQueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/MpmcWaiter.cpp b/lib/tgchat/ext/td/tdutils/test/MpmcWaiter.cpp index 2040b852..668bfbd1 100644 --- a/lib/tgchat/ext/td/tdutils/test/MpmcWaiter.cpp +++ b/lib/tgchat/ext/td/tdutils/test/MpmcWaiter.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/MpscLinkQueue.cpp b/lib/tgchat/ext/td/tdutils/test/MpscLinkQueue.cpp index 48887306..10564d69 100644 --- a/lib/tgchat/ext/td/tdutils/test/MpscLinkQueue.cpp +++ b/lib/tgchat/ext/td/tdutils/test/MpscLinkQueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/OptionParser.cpp b/lib/tgchat/ext/td/tdutils/test/OptionParser.cpp index cab904c3..4ff31a50 100644 --- a/lib/tgchat/ext/td/tdutils/test/OptionParser.cpp +++ b/lib/tgchat/ext/td/tdutils/test/OptionParser.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/OrderedEventsProcessor.cpp b/lib/tgchat/ext/td/tdutils/test/OrderedEventsProcessor.cpp index 23c93aef..166b7442 100644 --- a/lib/tgchat/ext/td/tdutils/test/OrderedEventsProcessor.cpp +++ b/lib/tgchat/ext/td/tdutils/test/OrderedEventsProcessor.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/SharedObjectPool.cpp b/lib/tgchat/ext/td/tdutils/test/SharedObjectPool.cpp index 89ebec56..652b0aa5 100644 --- a/lib/tgchat/ext/td/tdutils/test/SharedObjectPool.cpp +++ b/lib/tgchat/ext/td/tdutils/test/SharedObjectPool.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/SharedSlice.cpp b/lib/tgchat/ext/td/tdutils/test/SharedSlice.cpp index 14fd9562..5f44a87c 100644 --- a/lib/tgchat/ext/td/tdutils/test/SharedSlice.cpp +++ b/lib/tgchat/ext/td/tdutils/test/SharedSlice.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/StealingQueue.cpp b/lib/tgchat/ext/td/tdutils/test/StealingQueue.cpp index 0a2f0d08..9cfe5b05 100644 --- a/lib/tgchat/ext/td/tdutils/test/StealingQueue.cpp +++ b/lib/tgchat/ext/td/tdutils/test/StealingQueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/WaitFreeHashMap.cpp b/lib/tgchat/ext/td/tdutils/test/WaitFreeHashMap.cpp index 7726b226..ee7e57df 100644 --- a/lib/tgchat/ext/td/tdutils/test/WaitFreeHashMap.cpp +++ b/lib/tgchat/ext/td/tdutils/test/WaitFreeHashMap.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/WaitFreeHashSet.cpp b/lib/tgchat/ext/td/tdutils/test/WaitFreeHashSet.cpp index 6d090d36..d14d4c49 100644 --- a/lib/tgchat/ext/td/tdutils/test/WaitFreeHashSet.cpp +++ b/lib/tgchat/ext/td/tdutils/test/WaitFreeHashSet.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/WaitFreeVector.cpp b/lib/tgchat/ext/td/tdutils/test/WaitFreeVector.cpp index ed2f921c..1edf4fbe 100644 --- a/lib/tgchat/ext/td/tdutils/test/WaitFreeVector.cpp +++ b/lib/tgchat/ext/td/tdutils/test/WaitFreeVector.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/bitmask.cpp b/lib/tgchat/ext/td/tdutils/test/bitmask.cpp index ae2aa7ec..4a7e0204 100644 --- a/lib/tgchat/ext/td/tdutils/test/bitmask.cpp +++ b/lib/tgchat/ext/td/tdutils/test/bitmask.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/buffer.cpp b/lib/tgchat/ext/td/tdutils/test/buffer.cpp index 0f410add..8a30c67b 100644 --- a/lib/tgchat/ext/td/tdutils/test/buffer.cpp +++ b/lib/tgchat/ext/td/tdutils/test/buffer.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/crypto.cpp b/lib/tgchat/ext/td/tdutils/test/crypto.cpp index 813abe02..e77ea2cd 100644 --- a/lib/tgchat/ext/td/tdutils/test/crypto.cpp +++ b/lib/tgchat/ext/td/tdutils/test/crypto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/emoji.cpp b/lib/tgchat/ext/td/tdutils/test/emoji.cpp index 40e11550..91bfbbd4 100644 --- a/lib/tgchat/ext/td/tdutils/test/emoji.cpp +++ b/lib/tgchat/ext/td/tdutils/test/emoji.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/filesystem.cpp b/lib/tgchat/ext/td/tdutils/test/filesystem.cpp index 428d674e..95c4cb8b 100644 --- a/lib/tgchat/ext/td/tdutils/test/filesystem.cpp +++ b/lib/tgchat/ext/td/tdutils/test/filesystem.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/gzip.cpp b/lib/tgchat/ext/td/tdutils/test/gzip.cpp index 5e1baff9..0686c693 100644 --- a/lib/tgchat/ext/td/tdutils/test/gzip.cpp +++ b/lib/tgchat/ext/td/tdutils/test/gzip.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/hashset_benchmark.cpp b/lib/tgchat/ext/td/tdutils/test/hashset_benchmark.cpp index 35e1ae5a..81c729ff 100644 --- a/lib/tgchat/ext/td/tdutils/test/hashset_benchmark.cpp +++ b/lib/tgchat/ext/td/tdutils/test/hashset_benchmark.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/heap.cpp b/lib/tgchat/ext/td/tdutils/test/heap.cpp index ba1e3b8b..21bdc9b3 100644 --- a/lib/tgchat/ext/td/tdutils/test/heap.cpp +++ b/lib/tgchat/ext/td/tdutils/test/heap.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/json.cpp b/lib/tgchat/ext/td/tdutils/test/json.cpp index 928dea80..2f896a7d 100644 --- a/lib/tgchat/ext/td/tdutils/test/json.cpp +++ b/lib/tgchat/ext/td/tdutils/test/json.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/log.cpp b/lib/tgchat/ext/td/tdutils/test/log.cpp index 4a85cacc..be5f1bf3 100644 --- a/lib/tgchat/ext/td/tdutils/test/log.cpp +++ b/lib/tgchat/ext/td/tdutils/test/log.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/misc.cpp b/lib/tgchat/ext/td/tdutils/test/misc.cpp index 1bc314c5..3dbae15b 100644 --- a/lib/tgchat/ext/td/tdutils/test/misc.cpp +++ b/lib/tgchat/ext/td/tdutils/test/misc.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/port.cpp b/lib/tgchat/ext/td/tdutils/test/port.cpp index ccdf0b5d..4c9a841a 100644 --- a/lib/tgchat/ext/td/tdutils/test/port.cpp +++ b/lib/tgchat/ext/td/tdutils/test/port.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/pq.cpp b/lib/tgchat/ext/td/tdutils/test/pq.cpp index b499b31e..49fbd265 100644 --- a/lib/tgchat/ext/td/tdutils/test/pq.cpp +++ b/lib/tgchat/ext/td/tdutils/test/pq.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/tdutils/test/variant.cpp b/lib/tgchat/ext/td/tdutils/test/variant.cpp index 4c71780a..1c1673b9 100644 --- a/lib/tgchat/ext/td/tdutils/test/variant.cpp +++ b/lib/tgchat/ext/td/tdutils/test/variant.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/country_info.cpp b/lib/tgchat/ext/td/test/country_info.cpp index 2fe59de2..7bf84c8f 100644 --- a/lib/tgchat/ext/td/test/country_info.cpp +++ b/lib/tgchat/ext/td/test/country_info.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/crypto.cpp b/lib/tgchat/ext/td/test/crypto.cpp index 0de3d464..2440107c 100644 --- a/lib/tgchat/ext/td/test/crypto.cpp +++ b/lib/tgchat/ext/td/test/crypto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/data.cpp b/lib/tgchat/ext/td/test/data.cpp index e0516dd1..0954c327 100644 --- a/lib/tgchat/ext/td/test/data.cpp +++ b/lib/tgchat/ext/td/test/data.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/data.h b/lib/tgchat/ext/td/test/data.h index 99e19362..b096b763 100644 --- a/lib/tgchat/ext/td/test/data.h +++ b/lib/tgchat/ext/td/test/data.h @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/db.cpp b/lib/tgchat/ext/td/test/db.cpp index 4fe75c15..73f57a41 100644 --- a/lib/tgchat/ext/td/test/db.cpp +++ b/lib/tgchat/ext/td/test/db.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/fuzz_url.cpp b/lib/tgchat/ext/td/test/fuzz_url.cpp index f29e7c12..c12bb149 100644 --- a/lib/tgchat/ext/td/test/fuzz_url.cpp +++ b/lib/tgchat/ext/td/test/fuzz_url.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/http.cpp b/lib/tgchat/ext/td/test/http.cpp index 5deca6d0..bcd7329a 100644 --- a/lib/tgchat/ext/td/test/http.cpp +++ b/lib/tgchat/ext/td/test/http.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/link.cpp b/lib/tgchat/ext/td/test/link.cpp index c8407535..c3784429 100644 --- a/lib/tgchat/ext/td/test/link.cpp +++ b/lib/tgchat/ext/td/test/link.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -244,6 +244,10 @@ static auto change_phone_number() { return td::td_api::make_object(); } +static auto chat_affiliate_program(const td::string &username, const td::string &referral) { + return td::td_api::make_object(username, referral); +} + static auto chat_boost(const td::string &url) { return td::td_api::make_object(url); } @@ -1085,6 +1089,22 @@ TEST(Link, parse_internal_link_part3) { parse_internal_link("t.me//username?start=", nullptr); parse_internal_link("https://telegram.dog/tele%63ram?start=t%63st", bot_start("telecram", "tcst")); + parse_internal_link("tg:resolve?domain=username&start=_tgr_", bot_start("username", "_tgr_")); + parse_internal_link("tg:resolve?domain=username&start=_tgr_aSd", chat_affiliate_program("username", "aSd")); + parse_internal_link("tg:resolve?domain=username&start=_tgr_a%30Sd", chat_affiliate_program("username", "a0Sd")); + + parse_internal_link("t.me/username/0/a//s/as?start=_tgr_", bot_start("username", "_tgr_")); + parse_internal_link("t.me/username/0/a//s/as?start=_tgr_aSd", chat_affiliate_program("username", "aSd")); + parse_internal_link("t.me/username/0/a//s/as?start=_tgr_a%30Sd", chat_affiliate_program("username", "a0Sd")); + + parse_internal_link("tg:resolve?domain=username&ref=", public_chat("username")); + parse_internal_link("tg:resolve?domain=username&ref=aSd", chat_affiliate_program("username", "aSd")); + parse_internal_link("tg:resolve?domain=username&ref=a%30Sd", chat_affiliate_program("username", "a0Sd")); + + parse_internal_link("t.me/username/0/a//s/as?ref=", public_chat("username")); + parse_internal_link("t.me/username/0/a//s/as?ref=aSd", chat_affiliate_program("username", "aSd")); + parse_internal_link("t.me/username/0/a//s/as?ref=a%30Sd", chat_affiliate_program("username", "a0Sd")); + parse_internal_link("tg:resolve?domain=username&startgroup=aasdasd", bot_start_in_group("username", "aasdasd", nullptr)); parse_internal_link("TG://resolve?domain=username&startgroup=", bot_start_in_group("username", "", nullptr)); diff --git a/lib/tgchat/ext/td/test/main.cpp b/lib/tgchat/ext/td/test/main.cpp index 6cd81fd4..f6f6a090 100644 --- a/lib/tgchat/ext/td/test/main.cpp +++ b/lib/tgchat/ext/td/test/main.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/message_entities.cpp b/lib/tgchat/ext/td/test/message_entities.cpp index 920991b2..599ad86c 100644 --- a/lib/tgchat/ext/td/test/message_entities.cpp +++ b/lib/tgchat/ext/td/test/message_entities.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -1222,11 +1222,19 @@ TEST(MessageEntities, fix_formatted_text) { check_fix_formatted_text( "\xe2\x80\x8f\xe2\x80\x8f \xe2\x80\x8e\xe2\x80\x8e\xe2\x80\x8e\xe2\x80\x8c \xe2\x80\x8f\xe2\x80\x8e " - "\xe2\x80\x8f", + "\xe2\x80\x8f a", {}, "\xe2\x80\x8c\xe2\x80\x8f \xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8e\xe2\x80\x8c \xe2\x80\x8c\xe2\x80\x8e " - "\xe2\x80\x8f", + "\xe2\x80\x8f a", {}); + check_fix_formatted_text( + "\xe2\x80\x8f\xe2\x80\x8f \xe2\x80\x8e\xe2\x80\x8e\xe2\x80\x8e\xe2\x80\x8c \xe2\x80\x8f\xe2\x80\x8e " + "\xe2\x80\x8f", + {}, false, false, false, true); + check_fix_formatted_text( + "\xe2\x80\x8f\xe2\x80\x8f \xe2\x80\x8e\xe2\x80\x8e\xe2\x80\x8e\xe2\x80\x8c \xe2\x80\x8f\xe2\x80\x8e " + "\xe2\x80\x8f", + {}, "", {}); } TEST(MessageEntities, is_visible_url) { diff --git a/lib/tgchat/ext/td/test/mtproto.cpp b/lib/tgchat/ext/td/test/mtproto.cpp index 72d1af5d..b21d0905 100644 --- a/lib/tgchat/ext/td/test/mtproto.cpp +++ b/lib/tgchat/ext/td/test/mtproto.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/online.cpp b/lib/tgchat/ext/td/test/online.cpp index db5faa87..a85858b9 100644 --- a/lib/tgchat/ext/td/test/online.cpp +++ b/lib/tgchat/ext/td/test/online.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/poll.cpp b/lib/tgchat/ext/td/test/poll.cpp index 757d9c0e..4e2baa08 100644 --- a/lib/tgchat/ext/td/test/poll.cpp +++ b/lib/tgchat/ext/td/test/poll.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/query_merger.cpp b/lib/tgchat/ext/td/test/query_merger.cpp index 12114070..dc2e254c 100644 --- a/lib/tgchat/ext/td/test/query_merger.cpp +++ b/lib/tgchat/ext/td/test/query_merger.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/secret.cpp b/lib/tgchat/ext/td/test/secret.cpp index 48523ec2..22f6e53d 100644 --- a/lib/tgchat/ext/td/test/secret.cpp +++ b/lib/tgchat/ext/td/test/secret.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/secure_storage.cpp b/lib/tgchat/ext/td/test/secure_storage.cpp index e115e751..fa1cc95f 100644 --- a/lib/tgchat/ext/td/test/secure_storage.cpp +++ b/lib/tgchat/ext/td/test/secure_storage.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/set_with_position.cpp b/lib/tgchat/ext/td/test/set_with_position.cpp index ca2742f8..e7b9acee 100644 --- a/lib/tgchat/ext/td/test/set_with_position.cpp +++ b/lib/tgchat/ext/td/test/set_with_position.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/string_cleaning.cpp b/lib/tgchat/ext/td/test/string_cleaning.cpp index a1bb9e98..38d9c4cd 100644 --- a/lib/tgchat/ext/td/test/string_cleaning.cpp +++ b/lib/tgchat/ext/td/test/string_cleaning.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/tdclient.cpp b/lib/tgchat/ext/td/test/tdclient.cpp index 66f0ae61..0c2b1233 100644 --- a/lib/tgchat/ext/td/test/tdclient.cpp +++ b/lib/tgchat/ext/td/test/tdclient.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/ext/td/test/tqueue.cpp b/lib/tgchat/ext/td/test/tqueue.cpp index 50f58e4d..3a574742 100644 --- a/lib/tgchat/ext/td/test/tqueue.cpp +++ b/lib/tgchat/ext/td/test/tqueue.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/lib/tgchat/src/tgchat.cpp b/lib/tgchat/src/tgchat.cpp index c556244e..f25e6149 100644 --- a/lib/tgchat/src/tgchat.cpp +++ b/lib/tgchat/src/tgchat.cpp @@ -1,6 +1,6 @@ // tgchat.cpp // -// Copyright (c) 2020-2024 Kristofer Berggren +// Copyright (c) 2020-2025 Kristofer Berggren // All rights reserved. // // nchat is distributed under the MIT license, see LICENSE for details. @@ -41,7 +41,7 @@ // #define SIMULATED_SPONSORED_MESSAGES -static const int s_TdlibDate = 20241117; +static const int s_TdlibDate = 20250101; namespace detail { diff --git a/src/nchat.1 b/src/nchat.1 index 73c830c7..d85f36e0 100644 --- a/src/nchat.1 +++ b/src/nchat.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH NCHAT "1" "January 2025" "nchat 5.5.1" "User Commands" +.TH NCHAT "1" "January 2025" "nchat 5.5.2" "User Commands" .SH NAME nchat \- ncurses chat .SH SYNOPSIS