Merge branch 'master' into gift-resale

This commit is contained in:
Ilya Laktyushin 2025-04-10 17:22:10 +04:00
commit 0c524a3e8b
34 changed files with 1570 additions and 280 deletions

View File

@ -899,7 +899,6 @@ public final class OngoingGroupCallContext {
}
return OngoingGroupCallRequestedVideoChannel(
audioSsrc: channel.audioSsrc,
userId: channel.peerId,
endpointId: channel.endpointId,
ssrcGroups: channel.ssrcGroups.map { group in
return OngoingGroupCallSsrcGroup(

View File

@ -194,6 +194,8 @@ Result<int32> tl_constructor_from_string(td_api::Object *object, const std::stri
Result<int32> tl_constructor_from_string(td_api::Function *object, const std::string &str);
Status from_json(td_api::acceptedGiftTypes &to, JsonObject &from);
Status from_json(td_api::accountTtl &to, JsonObject &from);
Status from_json(td_api::address &to, JsonObject &from);
@ -270,6 +272,8 @@ Status from_json(td_api::businessAwayMessageScheduleCustom &to, JsonObject &from
Status from_json(td_api::businessAwayMessageSettings &to, JsonObject &from);
Status from_json(td_api::businessBotRights &to, JsonObject &from);
Status from_json(td_api::businessConnectedBot &to, JsonObject &from);
Status from_json(td_api::businessFeatureLocation &to, JsonObject &from);
@ -532,6 +536,8 @@ Status from_json(td_api::formattedText &to, JsonObject &from);
Status from_json(td_api::forumTopicIcon &to, JsonObject &from);
Status from_json(td_api::giftSettings &to, JsonObject &from);
Status from_json(td_api::giveawayParameters &to, JsonObject &from);
Status from_json(td_api::groupCallVideoQualityThumbnail &to, JsonObject &from);
@ -1734,6 +1740,10 @@ Status from_json(td_api::deleteBusinessChatLink &to, JsonObject &from);
Status from_json(td_api::deleteBusinessConnectedBot &to, JsonObject &from);
Status from_json(td_api::deleteBusinessMessages &to, JsonObject &from);
Status from_json(td_api::deleteBusinessStory &to, JsonObject &from);
Status from_json(td_api::deleteChat &to, JsonObject &from);
Status from_json(td_api::deleteChatBackground &to, JsonObject &from);
@ -1814,6 +1824,8 @@ Status from_json(td_api::editBusinessMessageReplyMarkup &to, JsonObject &from);
Status from_json(td_api::editBusinessMessageText &to, JsonObject &from);
Status from_json(td_api::editBusinessStory &to, JsonObject &from);
Status from_json(td_api::editChatFolder &to, JsonObject &from);
Status from_json(td_api::editChatFolderInviteLink &to, JsonObject &from);
@ -1928,6 +1940,8 @@ Status from_json(td_api::getBotSimilarBotCount &to, JsonObject &from);
Status from_json(td_api::getBotSimilarBots &to, JsonObject &from);
Status from_json(td_api::getBusinessAccountStarAmount &to, JsonObject &from);
Status from_json(td_api::getBusinessChatLinkInfo &to, JsonObject &from);
Status from_json(td_api::getBusinessChatLinks &to, JsonObject &from);
@ -2320,6 +2334,8 @@ Status from_json(td_api::getSavedOrderInfo &to, JsonObject &from);
Status from_json(td_api::getScopeNotificationSettings &to, JsonObject &from);
Status from_json(td_api::getSearchSponsoredChats &to, JsonObject &from);
Status from_json(td_api::getSearchedForTags &to, JsonObject &from);
Status from_json(td_api::getSecretChat &to, JsonObject &from);
@ -2434,6 +2450,8 @@ Status from_json(td_api::getWebAppUrl &to, JsonObject &from);
Status from_json(td_api::getWebPageInstantView &to, JsonObject &from);
Status from_json(td_api::giftPremiumWithStars &to, JsonObject &from);
Status from_json(td_api::hideContactCloseBirthdays &to, JsonObject &from);
Status from_json(td_api::hideSuggestedAction &to, JsonObject &from);
@ -2478,6 +2496,8 @@ Status from_json(td_api::openChatSimilarChat &to, JsonObject &from);
Status from_json(td_api::openMessageContent &to, JsonObject &from);
Status from_json(td_api::openSponsoredChat &to, JsonObject &from);
Status from_json(td_api::openStory &to, JsonObject &from);
Status from_json(td_api::openWebApp &to, JsonObject &from);
@ -2512,6 +2532,8 @@ Status from_json(td_api::readAllMessageThreadMentions &to, JsonObject &from);
Status from_json(td_api::readAllMessageThreadReactions &to, JsonObject &from);
Status from_json(td_api::readBusinessMessage &to, JsonObject &from);
Status from_json(td_api::readChatList &to, JsonObject &from);
Status from_json(td_api::readFilePart &to, JsonObject &from);
@ -2604,6 +2626,8 @@ Status from_json(td_api::reportMessageReactions &to, JsonObject &from);
Status from_json(td_api::reportPhoneNumberCodeMissing &to, JsonObject &from);
Status from_json(td_api::reportSponsoredChat &to, JsonObject &from);
Status from_json(td_api::reportStory &to, JsonObject &from);
Status from_json(td_api::reportSupergroupAntiSpamFalsePositive &to, JsonObject &from);
@ -2794,6 +2818,16 @@ Status from_json(td_api::setBotProfilePhoto &to, JsonObject &from);
Status from_json(td_api::setBotUpdatesStatus &to, JsonObject &from);
Status from_json(td_api::setBusinessAccountBio &to, JsonObject &from);
Status from_json(td_api::setBusinessAccountGiftSettings &to, JsonObject &from);
Status from_json(td_api::setBusinessAccountName &to, JsonObject &from);
Status from_json(td_api::setBusinessAccountProfilePhoto &to, JsonObject &from);
Status from_json(td_api::setBusinessAccountUsername &to, JsonObject &from);
Status from_json(td_api::setBusinessAwayMessageSettings &to, JsonObject &from);
Status from_json(td_api::setBusinessConnectedBot &to, JsonObject &from);
@ -2884,6 +2918,8 @@ Status from_json(td_api::setForumTopicNotificationSettings &to, JsonObject &from
Status from_json(td_api::setGameScore &to, JsonObject &from);
Status from_json(td_api::setGiftSettings &to, JsonObject &from);
Status from_json(td_api::setGroupCallParticipantIsSpeaking &to, JsonObject &from);
Status from_json(td_api::setGroupCallParticipantVolumeLevel &to, JsonObject &from);
@ -3126,6 +3162,8 @@ Status from_json(td_api::toggleSupergroupUsernameIsActive &to, JsonObject &from)
Status from_json(td_api::toggleUsernameIsActive &to, JsonObject &from);
Status from_json(td_api::transferBusinessAccountStars &to, JsonObject &from);
Status from_json(td_api::transferChatOwnership &to, JsonObject &from);
Status from_json(td_api::transferGift &to, JsonObject &from);
@ -3152,12 +3190,16 @@ Status from_json(td_api::viewMessages &to, JsonObject &from);
Status from_json(td_api::viewPremiumFeature &to, JsonObject &from);
Status from_json(td_api::viewSponsoredChat &to, JsonObject &from);
Status from_json(td_api::viewTrendingStickerSets &to, JsonObject &from);
Status from_json(td_api::writeGeneratedFilePart &to, JsonObject &from);
void to_json(JsonValueScope &jv, const td_api::accentColor &object);
void to_json(JsonValueScope &jv, const td_api::acceptedGiftTypes &object);
void to_json(JsonValueScope &jv, const td_api::accountInfo &object);
void to_json(JsonValueScope &jv, const td_api::accountTtl &object);
@ -3342,6 +3384,8 @@ void to_json(JsonValueScope &jv, const td_api::businessAwayMessageSettings &obje
void to_json(JsonValueScope &jv, const td_api::businessBotManageBar &object);
void to_json(JsonValueScope &jv, const td_api::businessBotRights &object);
void to_json(JsonValueScope &jv, const td_api::businessChatLink &object);
void to_json(JsonValueScope &jv, const td_api::businessChatLinkInfo &object);
@ -4064,6 +4108,8 @@ void to_json(JsonValueScope &jv, const td_api::gameHighScores &object);
void to_json(JsonValueScope &jv, const td_api::gift &object);
void to_json(JsonValueScope &jv, const td_api::giftSettings &object);
void to_json(JsonValueScope &jv, const td_api::giftUpgradePreview &object);
void to_json(JsonValueScope &jv, const td_api::gifts &object);
@ -4662,6 +4708,10 @@ void to_json(JsonValueScope &jv, const td_api::messageUpgradedGift &object);
void to_json(JsonValueScope &jv, const td_api::messageRefundedUpgradedGift &object);
void to_json(JsonValueScope &jv, const td_api::messagePaidMessagesRefunded &object);
void to_json(JsonValueScope &jv, const td_api::messagePaidMessagePriceChanged &object);
void to_json(JsonValueScope &jv, const td_api::messageContactRegistered &object);
void to_json(JsonValueScope &jv, const td_api::messageUsersShared &object);
@ -5408,20 +5458,20 @@ void to_json(JsonValueScope &jv, const td_api::reportChatResultTextRequired &obj
void to_json(JsonValueScope &jv, const td_api::reportChatResultMessagesRequired &object);
void to_json(JsonValueScope &jv, const td_api::ReportChatSponsoredMessageResult &object);
void to_json(JsonValueScope &jv, const td_api::reportChatSponsoredMessageResultOk &object);
void to_json(JsonValueScope &jv, const td_api::reportChatSponsoredMessageResultFailed &object);
void to_json(JsonValueScope &jv, const td_api::reportChatSponsoredMessageResultOptionRequired &object);
void to_json(JsonValueScope &jv, const td_api::reportChatSponsoredMessageResultAdsHidden &object);
void to_json(JsonValueScope &jv, const td_api::reportChatSponsoredMessageResultPremiumRequired &object);
void to_json(JsonValueScope &jv, const td_api::reportOption &object);
void to_json(JsonValueScope &jv, const td_api::ReportSponsoredResult &object);
void to_json(JsonValueScope &jv, const td_api::reportSponsoredResultOk &object);
void to_json(JsonValueScope &jv, const td_api::reportSponsoredResultFailed &object);
void to_json(JsonValueScope &jv, const td_api::reportSponsoredResultOptionRequired &object);
void to_json(JsonValueScope &jv, const td_api::reportSponsoredResultAdsHidden &object);
void to_json(JsonValueScope &jv, const td_api::reportSponsoredResultPremiumRequired &object);
void to_json(JsonValueScope &jv, const td_api::ReportStoryResult &object);
void to_json(JsonValueScope &jv, const td_api::reportStoryResultOk &object);
@ -5578,6 +5628,10 @@ void to_json(JsonValueScope &jv, const td_api::speechRecognitionResultText &obje
void to_json(JsonValueScope &jv, const td_api::speechRecognitionResultError &object);
void to_json(JsonValueScope &jv, const td_api::sponsoredChat &object);
void to_json(JsonValueScope &jv, const td_api::sponsoredChats &object);
void to_json(JsonValueScope &jv, const td_api::sponsoredMessage &object);
void to_json(JsonValueScope &jv, const td_api::sponsoredMessages &object);
@ -5674,6 +5728,10 @@ void to_json(JsonValueScope &jv, const td_api::starTransactionTypePaidMessageRec
void to_json(JsonValueScope &jv, const td_api::starTransactionTypePremiumPurchase &object);
void to_json(JsonValueScope &jv, const td_api::starTransactionTypeBusinessBotTransferSend &object);
void to_json(JsonValueScope &jv, const td_api::starTransactionTypeBusinessBotTransferReceive &object);
void to_json(JsonValueScope &jv, const td_api::starTransactionTypeUnsupported &object);
void to_json(JsonValueScope &jv, const td_api::starTransactions &object);
@ -6190,6 +6248,8 @@ void to_json(JsonValueScope &jv, const td_api::updateLanguagePackStrings &object
void to_json(JsonValueScope &jv, const td_api::updateConnectionState &object);
void to_json(JsonValueScope &jv, const td_api::updateFreezeState &object);
void to_json(JsonValueScope &jv, const td_api::updateTermsOfService &object);
void to_json(JsonValueScope &jv, const td_api::updateUnconfirmedSession &object);

View File

@ -750,6 +750,8 @@ class botAppSettings final : public Object {
void store(TlStorerToString &s, const char *field_name) const final;
};
class businessBotRights;
class botBusinessConnection final : public Object {
std::int32_t get_id() const final {
return ID;
@ -757,16 +759,16 @@ class botBusinessConnection final : public Object {
public:
int32 flags_;
bool can_reply_;
bool disabled_;
string connection_id_;
int64 user_id_;
int32 dc_id_;
int32 date_;
object_ptr<businessBotRights> rights_;
botBusinessConnection();
static const std::int32_t ID = -1989921868;
static const std::int32_t ID = -1892371723;
static object_ptr<botBusinessConnection> fetch(TlBufferParser &p);
@ -1541,6 +1543,44 @@ class businessBotRecipients final : public Object {
void store(TlStorerToString &s, const char *field_name) const final;
};
class businessBotRights final : public Object {
std::int32_t get_id() const final {
return ID;
}
public:
int32 flags_;
bool reply_;
bool read_messages_;
bool delete_sent_messages_;
bool delete_received_messages_;
bool edit_name_;
bool edit_bio_;
bool edit_profile_photo_;
bool edit_username_;
bool view_gifts_;
bool sell_gifts_;
bool change_gift_settings_;
bool transfer_and_upgrade_gifts_;
bool transfer_stars_;
bool manage_stories_;
enum Flags : std::int32_t { REPLY_MASK = 1, READ_MESSAGES_MASK = 2, DELETE_SENT_MESSAGES_MASK = 4, DELETE_RECEIVED_MESSAGES_MASK = 8, EDIT_NAME_MASK = 16, EDIT_BIO_MASK = 32, EDIT_PROFILE_PHOTO_MASK = 64, EDIT_USERNAME_MASK = 128, VIEW_GIFTS_MASK = 256, SELL_GIFTS_MASK = 512, CHANGE_GIFT_SETTINGS_MASK = 1024, TRANSFER_AND_UPGRADE_GIFTS_MASK = 2048, TRANSFER_STARS_MASK = 4096, MANAGE_STORIES_MASK = 8192 };
businessBotRights();
businessBotRights(int32 flags_, bool reply_, bool read_messages_, bool delete_sent_messages_, bool delete_received_messages_, bool edit_name_, bool edit_bio_, bool edit_profile_photo_, bool edit_username_, bool view_gifts_, bool sell_gifts_, bool change_gift_settings_, bool transfer_and_upgrade_gifts_, bool transfer_stars_, bool manage_stories_);
static const std::int32_t ID = -1604170505;
static object_ptr<businessBotRights> fetch(TlBufferParser &p);
void store(TlStorerCalcLength &s) const final;
void store(TlStorerUnsafe &s) const final;
void store(TlStorerToString &s, const char *field_name) const final;
};
class MessageEntity;
class businessChatLink final : public Object {
@ -3971,6 +4011,8 @@ class config final : public Object {
class businessBotRecipients;
class businessBotRights;
class connectedBot final : public Object {
std::int32_t get_id() const final {
return ID;
@ -3978,13 +4020,13 @@ class connectedBot final : public Object {
public:
int32 flags_;
bool can_reply_;
int64 bot_id_;
object_ptr<businessBotRecipients> recipients_;
object_ptr<businessBotRights> rights_;
connectedBot();
static const std::int32_t ID = -1123645951;
static const std::int32_t ID = -849058964;
static object_ptr<connectedBot> fetch(TlBufferParser &p);
@ -4377,6 +4419,34 @@ class dialogPeerFolder final : public DialogPeer {
void store(TlStorerToString &s, const char *field_name) const final;
};
class disallowedGiftsSettings final : public Object {
std::int32_t get_id() const final {
return ID;
}
public:
int32 flags_;
bool disallow_unlimited_stargifts_;
bool disallow_limited_stargifts_;
bool disallow_unique_stargifts_;
bool disallow_premium_gifts_;
enum Flags : std::int32_t { DISALLOW_UNLIMITED_STARGIFTS_MASK = 1, DISALLOW_LIMITED_STARGIFTS_MASK = 2, DISALLOW_UNIQUE_STARGIFTS_MASK = 4, DISALLOW_PREMIUM_GIFTS_MASK = 8 };
disallowedGiftsSettings();
disallowedGiftsSettings(int32 flags_, bool disallow_unlimited_stargifts_, bool disallow_limited_stargifts_, bool disallow_unique_stargifts_, bool disallow_premium_gifts_);
static const std::int32_t ID = 1911715524;
static object_ptr<disallowedGiftsSettings> fetch(TlBufferParser &p);
void store(TlStorerCalcLength &s) const final;
void store(TlStorerUnsafe &s) const final;
void store(TlStorerToString &s, const char *field_name) const final;
};
class DocumentAttribute;
class PhotoSize;
@ -5766,6 +5836,8 @@ class geoPointAddress final : public Object {
void store(TlStorerToString &s, const char *field_name) const final;
};
class disallowedGiftsSettings;
class globalPrivacySettings final : public Object {
std::int32_t get_id() const final {
return ID;
@ -5778,14 +5850,16 @@ class globalPrivacySettings final : public Object {
bool keep_archived_folders_;
bool hide_read_marks_;
bool new_noncontact_peers_require_premium_;
bool display_gifts_button_;
int64 noncontact_peers_paid_stars_;
enum Flags : std::int32_t { ARCHIVE_AND_MUTE_NEW_NONCONTACT_PEERS_MASK = 1, KEEP_ARCHIVED_UNMUTED_MASK = 2, KEEP_ARCHIVED_FOLDERS_MASK = 4, HIDE_READ_MARKS_MASK = 8, NEW_NONCONTACT_PEERS_REQUIRE_PREMIUM_MASK = 16, NONCONTACT_PEERS_PAID_STARS_MASK = 32 };
object_ptr<disallowedGiftsSettings> disallowed_gifts_;
enum Flags : std::int32_t { ARCHIVE_AND_MUTE_NEW_NONCONTACT_PEERS_MASK = 1, KEEP_ARCHIVED_UNMUTED_MASK = 2, KEEP_ARCHIVED_FOLDERS_MASK = 4, HIDE_READ_MARKS_MASK = 8, NEW_NONCONTACT_PEERS_REQUIRE_PREMIUM_MASK = 16, DISPLAY_GIFTS_BUTTON_MASK = 128, NONCONTACT_PEERS_PAID_STARS_MASK = 32, DISALLOWED_GIFTS_MASK = 64 };
globalPrivacySettings();
globalPrivacySettings(int32 flags_, bool archive_and_mute_new_noncontact_peers_, bool keep_archived_unmuted_, bool keep_archived_folders_, bool hide_read_marks_, bool new_noncontact_peers_require_premium_, int64 noncontact_peers_paid_stars_);
globalPrivacySettings(int32 flags_, bool archive_and_mute_new_noncontact_peers_, bool keep_archived_unmuted_, bool keep_archived_folders_, bool hide_read_marks_, bool new_noncontact_peers_require_premium_, bool display_gifts_button_, int64 noncontact_peers_paid_stars_, object_ptr<disallowedGiftsSettings> &&disallowed_gifts_);
static const std::int32_t ID = -908533988;
static const std::int32_t ID = -29248689;
static object_ptr<globalPrivacySettings> fetch(TlBufferParser &p);
@ -7961,6 +8035,26 @@ class inputInvoicePremiumGiftStars final : public InputInvoice {
void store(TlStorerToString &s, const char *field_name) const final;
};
class inputInvoiceBusinessBotTransferStars final : public InputInvoice {
std::int32_t get_id() const final {
return ID;
}
public:
object_ptr<InputUser> bot_;
int64 stars_;
inputInvoiceBusinessBotTransferStars(object_ptr<InputUser> &&bot_, int64 stars_);
static const std::int32_t ID = -191267262;
void store(TlStorerCalcLength &s) const final;
void store(TlStorerUnsafe &s) const final;
void store(TlStorerToString &s, const char *field_name) const final;
};
class DocumentAttribute;
class InputDocument;
@ -10182,6 +10276,31 @@ class inputStorePaymentStarsGiveaway final : public InputStorePaymentPurpose {
void store(TlStorerToString &s, const char *field_name) const final;
};
class inputStorePaymentAuthCode final : public InputStorePaymentPurpose {
std::int32_t get_id() const final {
return ID;
}
public:
int32 flags_;
bool restore_;
string phone_number_;
string phone_code_hash_;
string currency_;
int64 amount_;
enum Flags : std::int32_t { RESTORE_MASK = 1 };
inputStorePaymentAuthCode(int32 flags_, bool restore_, string const &phone_number_, string const &phone_code_hash_, string const &currency_, int64 amount_);
static const std::int32_t ID = -1682807955;
void store(TlStorerCalcLength &s) const final;
void store(TlStorerUnsafe &s) const final;
void store(TlStorerToString &s, const char *field_name) const final;
};
class InputTheme: public Object {
public:
};
@ -12807,6 +12926,41 @@ class messageActionStarGiftUnique final : public MessageAction {
void store(TlStorerToString &s, const char *field_name) const final;
};
class messageActionPaidMessagesRefunded final : public MessageAction {
std::int32_t get_id() const final {
return ID;
}
public:
int32 count_;
int64 stars_;
static const std::int32_t ID = -1407246387;
static object_ptr<MessageAction> fetch(TlBufferParser &p);
explicit messageActionPaidMessagesRefunded(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class messageActionPaidMessagesPrice final : public MessageAction {
std::int32_t get_id() const final {
return ID;
}
public:
int64 stars_;
static const std::int32_t ID = -1126755303;
static object_ptr<MessageAction> fetch(TlBufferParser &p);
explicit messageActionPaidMessagesPrice(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class InputUser;
class MessageEntity: public Object {
@ -16121,29 +16275,6 @@ class phoneCallDiscardReasonBusy final : public PhoneCallDiscardReason {
void store(TlStorerToString &s, const char *field_name) const final;
};
class phoneCallDiscardReasonAllowGroupCall final : public PhoneCallDiscardReason {
std::int32_t get_id() const final {
return ID;
}
public:
bytes encrypted_key_;
explicit phoneCallDiscardReasonAllowGroupCall(bytes &&encrypted_key_);
static const std::int32_t ID = -1344096199;
static object_ptr<PhoneCallDiscardReason> fetch(TlBufferParser &p);
explicit phoneCallDiscardReasonAllowGroupCall(TlBufferParser &p);
void store(TlStorerCalcLength &s) const final;
void store(TlStorerUnsafe &s) const final;
void store(TlStorerToString &s, const char *field_name) const final;
};
class phoneCallProtocol final : public Object {
std::int32_t get_id() const final {
return ID;
@ -19791,6 +19922,30 @@ class sponsoredMessageReportOption final : public Object {
void store(TlStorerToString &s, const char *field_name) const final;
};
class Peer;
class sponsoredPeer final : public Object {
std::int32_t get_id() const final {
return ID;
}
public:
int32 flags_;
bytes random_id_;
object_ptr<Peer> peer_;
string sponsor_info_;
string additional_info_;
enum Flags : std::int32_t { SPONSOR_INFO_MASK = 1, ADDITIONAL_INFO_MASK = 2 };
sponsoredPeer();
static const std::int32_t ID = -963180333;
static object_ptr<sponsoredPeer> fetch(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class Document;
class Peer;
@ -20202,6 +20357,7 @@ class starsTransaction final : public Object {
bool gift_;
bool reaction_;
bool stargift_upgrade_;
bool business_transfer_;
string id_;
object_ptr<starsAmount> stars_;
int32 date_;
@ -21399,6 +21555,8 @@ class WallPaper;
class WebPage;
class auth_SentCode;
class boost;
class botBusinessConnection;
@ -24119,6 +24277,23 @@ class updatePaidReactionPrivacy final : public Update {
void store(TlStorerToString &s, const char *field_name) const final;
};
class updateSentPhoneCode final : public Update {
std::int32_t get_id() const final {
return ID;
}
public:
object_ptr<auth_SentCode> sent_code_;
static const std::int32_t ID = 1347068303;
static object_ptr<Update> fetch(TlBufferParser &p);
explicit updateSentPhoneCode(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class Chat;
class MessageEntity;
@ -24491,6 +24666,8 @@ class businessWorkHours;
class chatAdminRights;
class disallowedGiftsSettings;
class peerNotifySettings;
class peerSettings;
@ -24523,6 +24700,7 @@ class userFull final : public Object {
bool sponsored_enabled_;
bool can_view_revenue_;
bool bot_can_manage_emoji_status_;
bool display_gifts_button_;
int64 id_;
string about_;
object_ptr<peerSettings> settings_;
@ -24553,11 +24731,12 @@ class userFull final : public Object {
object_ptr<starRefProgram> starref_program_;
object_ptr<botVerification> bot_verification_;
int64 send_paid_messages_stars_;
object_ptr<disallowedGiftsSettings> disallowed_gifts_;
enum Flags : std::int32_t { ABOUT_MASK = 2, PINNED_MSG_ID_MASK = 64, FOLDER_ID_MASK = 2048, TTL_PERIOD_MASK = 16384, THEME_EMOTICON_MASK = 32768, PRIVATE_FORWARD_NAME_MASK = 65536, PERSONAL_CHANNEL_ID_MASK = 64, PERSONAL_CHANNEL_MESSAGE_MASK = 64, STARGIFTS_COUNT_MASK = 256, SEND_PAID_MESSAGES_STARS_MASK = 16384 };
userFull();
static const std::int32_t ID = -769438048;
static const std::int32_t ID = -1712881595;
static object_ptr<userFull> fetch(TlBufferParser &p);
@ -26223,6 +26402,24 @@ class auth_sentCodeSuccess final : public auth_SentCode {
void store(TlStorerToString &s, const char *field_name) const final;
};
class auth_sentCodePaymentRequired final : public auth_SentCode {
std::int32_t get_id() const final {
return ID;
}
public:
string store_product_;
string phone_code_hash_;
static const std::int32_t ID = -674301568;
static object_ptr<auth_SentCode> fetch(TlBufferParser &p);
explicit auth_sentCodePaymentRequired(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class auth_SentCodeType: public Object {
public:
@ -27004,6 +27201,51 @@ class Chat;
class User;
class sponsoredPeer;
class contacts_SponsoredPeers: public Object {
public:
static object_ptr<contacts_SponsoredPeers> fetch(TlBufferParser &p);
};
class contacts_sponsoredPeersEmpty final : public contacts_SponsoredPeers {
std::int32_t get_id() const final {
return ID;
}
public:
static const std::int32_t ID = -365775695;
static object_ptr<contacts_SponsoredPeers> fetch(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class contacts_sponsoredPeers final : public contacts_SponsoredPeers {
std::int32_t get_id() const final {
return ID;
}
public:
array<object_ptr<sponsoredPeer>> peers_;
array<object_ptr<Chat>> chats_;
array<object_ptr<User>> users_;
static const std::int32_t ID = -352114556;
static object_ptr<contacts_SponsoredPeers> fetch(TlBufferParser &p);
explicit contacts_sponsoredPeers(TlBufferParser &p);
void store(TlStorerToString &s, const char *field_name) const final;
};
class Chat;
class User;
class topPeerCategoryPeers;
class contacts_TopPeers: public Object {
@ -34350,6 +34592,8 @@ class InputUser;
class Updates;
class businessBotRights;
class inputBusinessBotRecipients;
class account_updateConnectedBot final : public Function {
@ -34359,16 +34603,16 @@ class account_updateConnectedBot final : public Function {
public:
int32 flags_;
bool can_reply_;
bool deleted_;
object_ptr<businessBotRights> rights_;
object_ptr<InputUser> bot_;
object_ptr<inputBusinessBotRecipients> recipients_;
enum Flags : std::int32_t { CAN_REPLY_MASK = 1, DELETED_MASK = 2 };
enum Flags : std::int32_t { DELETED_MASK = 2, RIGHTS_MASK = 1 };
mutable int32 var0;
account_updateConnectedBot(int32 flags_, bool can_reply_, bool deleted_, object_ptr<InputUser> &&bot_, object_ptr<inputBusinessBotRecipients> &&recipients_);
account_updateConnectedBot(int32 flags_, bool deleted_, object_ptr<businessBotRights> &&rights_, object_ptr<InputUser> &&bot_, object_ptr<inputBusinessBotRecipients> &&recipients_);
static const std::int32_t ID = 1138250269;
static const std::int32_t ID = 1721797758;
using ReturnType = object_ptr<Updates>;
@ -38711,6 +38955,31 @@ class contacts_getSaved final : public Function {
static ReturnType fetch_result(TlBufferParser &p);
};
class contacts_SponsoredPeers;
class contacts_getSponsoredPeers final : public Function {
std::int32_t get_id() const final {
return ID;
}
public:
string q_;
explicit contacts_getSponsoredPeers(string const &q_);
static const std::int32_t ID = -1228356717;
using ReturnType = object_ptr<contacts_SponsoredPeers>;
void store(TlStorerCalcLength &s) const final;
void store(TlStorerUnsafe &s) const final;
void store(TlStorerToString &s, const char *field_name) const final;
static ReturnType fetch_result(TlBufferParser &p);
};
class contactStatus;
class contacts_getStatuses final : public Function {
@ -40186,8 +40455,6 @@ class messages_clearRecentStickers final : public Function {
static ReturnType fetch_result(TlBufferParser &p);
};
class InputPeer;
class messages_clickSponsoredMessage final : public Function {
std::int32_t get_id() const final {
return ID;
@ -40197,14 +40464,13 @@ class messages_clickSponsoredMessage final : public Function {
int32 flags_;
bool media_;
bool fullscreen_;
object_ptr<InputPeer> peer_;
bytes random_id_;
enum Flags : std::int32_t { MEDIA_MASK = 1, FULLSCREEN_MASK = 2 };
mutable int32 var0;
messages_clickSponsoredMessage(int32 flags_, bool media_, bool fullscreen_, object_ptr<InputPeer> &&peer_, bytes &&random_id_);
messages_clickSponsoredMessage(int32 flags_, bool media_, bool fullscreen_, bytes &&random_id_);
static const std::int32_t ID = 252261477;
static const std::int32_t ID = -2110454402;
using ReturnType = bool;
@ -44288,8 +44554,6 @@ class messages_reportSpam final : public Function {
static ReturnType fetch_result(TlBufferParser &p);
};
class InputPeer;
class channels_SponsoredMessageReportResult;
class messages_reportSponsoredMessage final : public Function {
@ -44298,13 +44562,12 @@ class messages_reportSponsoredMessage final : public Function {
}
public:
object_ptr<InputPeer> peer_;
bytes random_id_;
bytes option_;
messages_reportSponsoredMessage(object_ptr<InputPeer> &&peer_, bytes &&random_id_, bytes &&option_);
messages_reportSponsoredMessage(bytes &&random_id_, bytes &&option_);
static const std::int32_t ID = 452189112;
static const std::int32_t ID = 315355332;
using ReturnType = object_ptr<channels_SponsoredMessageReportResult>;
@ -46582,20 +46845,17 @@ class messages_uploadMedia final : public Function {
static ReturnType fetch_result(TlBufferParser &p);
};
class InputPeer;
class messages_viewSponsoredMessage final : public Function {
std::int32_t get_id() const final {
return ID;
}
public:
object_ptr<InputPeer> peer_;
bytes random_id_;
messages_viewSponsoredMessage(object_ptr<InputPeer> &&peer_, bytes &&random_id_);
explicit messages_viewSponsoredMessage(bytes &&random_id_);
static const std::int32_t ID = 1731909873;
static const std::int32_t ID = 647902787;
using ReturnType = bool;
@ -46723,7 +46983,7 @@ class payments_botCancelStarsSubscription final : public Function {
class InputStorePaymentPurpose;
class payments_canPurchasePremium final : public Function {
class payments_canPurchaseStore final : public Function {
std::int32_t get_id() const final {
return ID;
}
@ -46731,9 +46991,9 @@ class payments_canPurchasePremium final : public Function {
public:
object_ptr<InputStorePaymentPurpose> purpose_;
explicit payments_canPurchasePremium(object_ptr<InputStorePaymentPurpose> &&purpose_);
explicit payments_canPurchaseStore(object_ptr<InputStorePaymentPurpose> &&purpose_);
static const std::int32_t ID = -1614700874;
static const std::int32_t ID = 1339842215;
using ReturnType = bool;

View File

@ -0,0 +1,66 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025
//
// Distributed under the 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 BusinessBotRights {
public:
BusinessBotRights() = default;
explicit BusinessBotRights(const telegram_api::object_ptr<telegram_api::businessBotRights> &bot_rights);
explicit BusinessBotRights(const td_api::object_ptr<td_api::businessBotRights> &bot_rights);
static BusinessBotRights legacy(bool can_reply);
td_api::object_ptr<td_api::businessBotRights> get_business_bot_rights_object() const;
telegram_api::object_ptr<telegram_api::businessBotRights> get_input_business_bot_rights() const;
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
private:
bool can_reply_ = false;
bool can_read_messages_ = false;
bool can_delete_sent_messages_ = false;
bool can_delete_received_messages_ = false;
bool can_edit_name_ = false;
bool can_edit_bio_ = false;
bool can_edit_profile_photo_ = false;
bool can_edit_username_ = false;
bool can_view_gifts_ = false;
bool can_sell_gifts_ = false;
bool can_change_gift_settings_ = false;
bool can_transfer_and_upgrade_gifts_ = false;
bool can_transfer_stars_ = false;
bool can_manage_stories_ = false;
friend bool operator==(const BusinessBotRights &lhs, const BusinessBotRights &rhs);
friend StringBuilder &operator<<(StringBuilder &string_builder, const BusinessBotRights &bot_rights);
};
bool operator==(const BusinessBotRights &lhs, const BusinessBotRights &rhs);
inline bool operator!=(const BusinessBotRights &lhs, const BusinessBotRights &rhs) {
return !(lhs == rhs);
}
StringBuilder &operator<<(StringBuilder &string_builder, const BusinessBotRights &bot_rights);
} // namespace td

View File

@ -6,6 +6,7 @@
//
#pragma once
#include "td/telegram/BusinessBotRights.h"
#include "td/telegram/BusinessRecipients.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
@ -40,8 +41,8 @@ class BusinessConnectedBot {
return recipients_;
}
bool get_can_reply() const {
return can_reply_;
const BusinessBotRights &get_rights() const {
return rights_;
}
template <class StorerT>
@ -53,7 +54,7 @@ class BusinessConnectedBot {
private:
UserId user_id_;
BusinessRecipients recipients_;
bool can_reply_ = false;
BusinessBotRights rights_;
friend bool operator==(const BusinessConnectedBot &lhs, const BusinessConnectedBot &rhs);

View File

@ -13,8 +13,11 @@
#include "td/telegram/MessageId.h"
#include "td/telegram/MessageInputReplyTo.h"
#include "td/telegram/net/DcId.h"
#include "td/telegram/StarGiftSettings.h"
#include "td/telegram/StoryId.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
@ -41,8 +44,12 @@ class BusinessConnectionManager final : public Actor {
BusinessConnectionManager &operator=(BusinessConnectionManager &&) = delete;
~BusinessConnectionManager() final;
Status check_business_connection(const BusinessConnectionId &connection_id) const;
Status check_business_connection(const BusinessConnectionId &connection_id, DialogId dialog_id) const;
UserId get_business_connection_user_id(const BusinessConnectionId &connection_id) const;
DcId get_business_connection_dc_id(const BusinessConnectionId &connection_id) const;
void on_update_bot_business_connect(telegram_api::object_ptr<telegram_api::botBusinessConnection> &&connection);
@ -103,9 +110,35 @@ class BusinessConnectionManager final : public Actor {
td_api::object_ptr<td_api::ReplyMarkup> &&reply_markup,
Promise<td_api::object_ptr<td_api::businessMessage>> &&promise);
void read_business_message(BusinessConnectionId business_connection_id, DialogId dialog_id, MessageId message_id,
Promise<Unit> &&promise);
void delete_business_messages(BusinessConnectionId business_connection_id, const vector<MessageId> &message_ids,
Promise<Unit> &&promise);
void delete_business_story(BusinessConnectionId business_connection_id, StoryId story_id, Promise<Unit> &&promise);
void set_business_name(BusinessConnectionId business_connection_id, const string &first_name, const string &last_name,
Promise<Unit> &&promise);
void set_business_about(BusinessConnectionId business_connection_id, const string &about, Promise<Unit> &&promise);
void set_business_username(BusinessConnectionId business_connection_id, const string &username,
Promise<Unit> &&promise);
void set_business_gift_settings(BusinessConnectionId business_connection_id, StarGiftSettings settings,
Promise<Unit> &&promise);
void get_business_star_status(BusinessConnectionId business_connection_id,
Promise<td_api::object_ptr<td_api::starAmount>> &&promise);
void transfer_business_stars(BusinessConnectionId business_connection_id, int64 star_count, Promise<Unit> &&promise);
void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const;
private:
static constexpr size_t MAX_NAME_LENGTH = 64; // server side limit for first/last name
struct BusinessConnection;
struct PendingMessage;
class SendBusinessMessageQuery;
@ -140,6 +173,8 @@ class BusinessConnectionManager final : public Actor {
Status check_business_message_id(MessageId message_id) const;
Status check_business_story_id(StoryId story_id) const;
void on_get_business_connection(const BusinessConnectionId &connection_id,
Result<telegram_api::object_ptr<telegram_api::Updates>> r_updates);

View File

@ -46,9 +46,9 @@ struct CallProtocol {
explicit CallProtocol(const telegram_api::phoneCallProtocol &protocol);
tl_object_ptr<telegram_api::phoneCallProtocol> get_input_phone_call_protocol() const;
telegram_api::object_ptr<telegram_api::phoneCallProtocol> get_input_phone_call_protocol() const;
tl_object_ptr<td_api::callProtocol> get_call_protocol_object() const;
td_api::object_ptr<td_api::callProtocol> get_call_protocol_object() const;
};
struct CallConnection {

View File

@ -14,7 +14,7 @@
namespace td {
struct CallDiscardReason {
enum class Type : int32 { Empty, Missed, Disconnected, HungUp, Declined, AllowGroupCall };
enum class Type : int32 { Empty, Missed, Disconnected, HungUp, Declined };
Type type_ = Type::Empty;
string encrypted_key_;
};

View File

@ -77,7 +77,7 @@ class ConfigManager final : public NetQueryCallback {
private:
struct AppConfig {
static constexpr int32 CURRENT_VERSION = 70;
static constexpr int32 CURRENT_VERSION = 71;
int32 version_ = 0;
int32 hash_ = 0;
telegram_api::object_ptr<telegram_api::JSONValue> config_;

View File

@ -376,11 +376,11 @@ class DialogParticipantStatus {
DialogParticipantStatus apply_restrictions(RestrictedRights default_restrictions, bool is_booster, bool is_bot) const;
tl_object_ptr<td_api::ChatMemberStatus> get_chat_member_status_object() const;
td_api::object_ptr<td_api::ChatMemberStatus> get_chat_member_status_object() const;
tl_object_ptr<telegram_api::chatAdminRights> get_chat_admin_rights() const;
telegram_api::object_ptr<telegram_api::chatAdminRights> get_chat_admin_rights() const;
tl_object_ptr<telegram_api::chatBannedRights> get_chat_banned_rights() const;
telegram_api::object_ptr<telegram_api::chatBannedRights> get_chat_banned_rights() const;
// unrestricts user if restriction time expired. Should be called before all privileges checks
void update_restrictions() const;

View File

@ -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/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
namespace td {
class DisallowedGiftsSettings {
bool disallow_unlimited_stargifts_ = false;
bool disallow_limited_stargifts_ = false;
bool disallow_unique_stargifts_ = false;
bool disallow_premium_gifts_ = false;
friend bool operator==(const DisallowedGiftsSettings &lhs, const DisallowedGiftsSettings &rhs);
friend StringBuilder &operator<<(StringBuilder &string_builder, const DisallowedGiftsSettings &settings);
public:
DisallowedGiftsSettings() = default;
explicit DisallowedGiftsSettings(telegram_api::object_ptr<telegram_api::disallowedGiftsSettings> &&settings);
explicit DisallowedGiftsSettings(const td_api::object_ptr<td_api::acceptedGiftTypes> &types);
td_api::object_ptr<td_api::acceptedGiftTypes> get_accepted_gift_types_object() const;
telegram_api::object_ptr<telegram_api::disallowedGiftsSettings> get_input_disallowed_gifts_settings() const;
bool is_default() const {
return !disallow_unlimited_stargifts_ && !disallow_limited_stargifts_ && !disallow_unique_stargifts_ &&
!disallow_premium_gifts_;
}
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
};
bool operator==(const DisallowedGiftsSettings &lhs, const DisallowedGiftsSettings &rhs);
inline bool operator!=(const DisallowedGiftsSettings &lhs, const DisallowedGiftsSettings &rhs) {
return !(lhs == rhs);
}
StringBuilder &operator<<(StringBuilder &string_builder, const DisallowedGiftsSettings &settings);
} // namespace td

View File

@ -48,7 +48,7 @@ class DocumentsManager {
tl_object_ptr<telegram_api::WebDocument> web_document;
PhotoSize thumbnail;
vector<tl_object_ptr<telegram_api::DocumentAttribute>> attributes;
vector<telegram_api::object_ptr<telegram_api::DocumentAttribute>> attributes;
RemoteDocument(tl_object_ptr<telegram_api::document> &&server_document)
: document(std::move(server_document))
@ -60,7 +60,7 @@ class DocumentsManager {
}
RemoteDocument(tl_object_ptr<telegram_api::WebDocument> &&web_document, PhotoSize thumbnail,
vector<tl_object_ptr<telegram_api::DocumentAttribute>> &&attributes)
vector<telegram_api::object_ptr<telegram_api::DocumentAttribute>> &&attributes)
: document(nullptr)
, secret_file(nullptr)
, secret_document(nullptr)
@ -71,7 +71,7 @@ class DocumentsManager {
RemoteDocument(unique_ptr<EncryptedFile> &&secret_file,
tl_object_ptr<secret_api::decryptedMessageMediaDocument> &&secret_document,
vector<tl_object_ptr<telegram_api::DocumentAttribute>> &&attributes)
vector<telegram_api::object_ptr<telegram_api::DocumentAttribute>> &&attributes)
: document(nullptr)
, secret_file(std::move(secret_file))
, secret_document(std::move(secret_document))

View File

@ -679,6 +679,10 @@ class Global final : public ActorContext {
// flood wait
return true;
}
if (error.code() == 406 && error.message() == "FROZEN_METHOD_INVALID") {
// the account is frozen
return true;
}
return close_flag();
}

View File

@ -6,6 +6,7 @@
//
#pragma once
#include "td/telegram/StarGiftSettings.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
@ -17,7 +18,7 @@ namespace td {
class Td;
class GlobalPrivacySettings {
enum class SetType : int32 { None, Archive, ReadDate, NewChat };
enum class SetType : int32 { None, Archive, ReadDate, NewChat, Gift };
SetType set_type_ = SetType::None;
bool archive_and_mute_new_noncontact_peers_ = false;
bool keep_archived_unmuted_ = false;
@ -25,6 +26,7 @@ class GlobalPrivacySettings {
bool hide_read_marks_ = false;
bool new_noncontact_peers_require_premium_ = false;
int64 noncontact_peers_paid_star_count_ = 0;
StarGiftSettings gift_settings_;
void apply_changes(const GlobalPrivacySettings &set_settings);
@ -37,6 +39,8 @@ class GlobalPrivacySettings {
explicit GlobalPrivacySettings(td_api::object_ptr<td_api::newChatPrivacySettings> &&settings);
explicit GlobalPrivacySettings(td_api::object_ptr<td_api::giftSettings> &&settings);
telegram_api::object_ptr<telegram_api::globalPrivacySettings> get_input_global_privacy_settings() const;
td_api::object_ptr<td_api::archiveChatListSettings> get_archive_chat_list_settings_object() const;

View File

@ -270,10 +270,10 @@ unique_ptr<MessageContent> get_action_message_content(Td *td, tl_object_ptr<tele
td_api::object_ptr<td_api::MessageContent> get_message_content_object(const MessageContent *content, Td *td,
DialogId dialog_id, MessageId message_id,
bool is_outgoing, int32 message_date,
bool is_content_secret, bool skip_bot_commands,
int32 max_media_timestamp, bool invert_media,
bool disable_web_page_preview);
bool is_outgoing, DialogId sender_dialog_id,
int32 message_date, bool is_content_secret,
bool skip_bot_commands, int32 max_media_timestamp,
bool invert_media, bool disable_web_page_preview);
td_api::object_ptr<td_api::upgradeGiftResult> get_message_content_upgrade_gift_result_object(
const MessageContent *content, Td *td, DialogId dialog_id, MessageId message_id);

View File

@ -86,7 +86,9 @@ enum class MessageContentType : int32 {
GiftStars,
PrizeStars,
StarGift,
StarGiftUnique
StarGiftUnique,
PaidMessagesRefunded,
PaidMessagesPrice
};
// increase MessageUnsupported::CURRENT_VERSION each time a new message content type is added

View File

@ -10,6 +10,7 @@
#include "td/telegram/MessageFullId.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/Promise.h"
@ -54,6 +55,9 @@ void check_premium_gift_code(Td *td, const string &code,
void apply_premium_gift_code(Td *td, const string &code, Promise<Unit> &&promise);
void gift_premium_with_stars(Td *td, UserId user_id, int64 star_count, int32 month_count,
td_api::object_ptr<td_api::formattedText> &&text, Promise<Unit> &&promise);
void launch_prepaid_premium_giveaway(Td *td, int64 giveaway_id,
td_api::object_ptr<td_api::giveawayParameters> &&parameters, int32 user_count,
int64 star_count, Promise<Unit> &&promise);

View File

@ -275,6 +275,14 @@ class Requests {
void on_request(uint64 id, const td_api::reportChatSponsoredMessage &request);
void on_request(uint64 id, td_api::getSearchSponsoredChats &request);
void on_request(uint64 id, const td_api::viewSponsoredChat &request);
void on_request(uint64 id, const td_api::openSponsoredChat &request);
void on_request(uint64 id, const td_api::reportSponsoredChat &request);
void on_request(uint64 id, const td_api::getMessageLink &request);
void on_request(uint64 id, const td_api::getMessageEmbeddingCode &request);
@ -567,6 +575,28 @@ class Requests {
void on_request(uint64 id, td_api::setBusinessMessageIsPinned &request);
void on_request(uint64 id, td_api::readBusinessMessage &request);
void on_request(uint64 id, td_api::deleteBusinessMessages &request);
void on_request(uint64 id, td_api::editBusinessStory &request);
void on_request(uint64 id, td_api::deleteBusinessStory &request);
void on_request(uint64 id, td_api::setBusinessAccountName &request);
void on_request(uint64 id, td_api::setBusinessAccountBio &request);
void on_request(uint64 id, td_api::setBusinessAccountProfilePhoto &request);
void on_request(uint64 id, td_api::setBusinessAccountUsername &request);
void on_request(uint64 id, td_api::setBusinessAccountGiftSettings &request);
void on_request(uint64 id, td_api::getBusinessAccountStarAmount &request);
void on_request(uint64 id, td_api::transferBusinessAccountStars &request);
void on_request(uint64 id, const td_api::loadQuickReplyShortcuts &request);
void on_request(uint64 id, const td_api::setQuickReplyShortcutName &request);
@ -1485,11 +1515,13 @@ class Requests {
void on_request(uint64 id, const td_api::deleteSavedCredentials &request);
void on_request(uint64 id, td_api::setGiftSettings &request);
void on_request(uint64 id, const td_api::getAvailableGifts &request);
void on_request(uint64 id, td_api::sendGift &request);
void on_request(uint64 id, const td_api::sellGift &request);
void on_request(uint64 id, td_api::sellGift &request);
void on_request(uint64 id, const td_api::toggleGiftIsSaved &request);
@ -1499,9 +1531,9 @@ class Requests {
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, td_api::upgradeGift &request);
void on_request(uint64 id, const td_api::transferGift &request);
void on_request(uint64 id, td_api::transferGift &request);
void on_request(uint64 id, td_api::getReceivedGifts &request);
@ -1591,6 +1623,8 @@ class Requests {
void on_request(uint64 id, td_api::applyPremiumGiftCode &request);
void on_request(uint64 id, td_api::giftPremiumWithStars &request);
void on_request(uint64 id, td_api::launchPrepaidGiveaway &request);
void on_request(uint64 id, const td_api::getGiveawayInfo &request);

View File

@ -19,18 +19,18 @@ class FileView;
struct SecretInputMedia {
telegram_api::object_ptr<telegram_api::InputEncryptedFile> input_file_;
tl_object_ptr<secret_api::DecryptedMessageMedia> decrypted_media_;
secret_api::object_ptr<secret_api::DecryptedMessageMedia> decrypted_media_;
SecretInputMedia() = default;
SecretInputMedia(telegram_api::object_ptr<telegram_api::InputEncryptedFile> input_file,
tl_object_ptr<secret_api::DecryptedMessageMedia> decrypted_media)
secret_api::object_ptr<secret_api::DecryptedMessageMedia> decrypted_media)
: input_file_(std::move(input_file)), decrypted_media_(std::move(decrypted_media)) {
}
SecretInputMedia(telegram_api::object_ptr<telegram_api::InputEncryptedFile> input_file, BufferSlice &&thumbnail,
Dimensions thumbnail_dimensions, const string &mime_type, const FileView &file_view,
vector<tl_object_ptr<secret_api::DocumentAttribute>> &&attributes, const string &caption,
vector<secret_api::object_ptr<secret_api::DocumentAttribute>> &&attributes, const string &caption,
int32 layer);
bool empty() const {

View File

@ -41,20 +41,35 @@ class SponsoredMessageManager final : public Actor {
bool from_fullscreen, Promise<Unit> &&promise);
void report_sponsored_message(DialogId dialog_id, MessageId sponsored_message_id, const string &option_id,
Promise<td_api::object_ptr<td_api::ReportChatSponsoredMessageResult>> &&promise);
Promise<td_api::object_ptr<td_api::ReportSponsoredResult>> &&promise);
void get_search_sponsored_dialogs(const string &query, Promise<td_api::object_ptr<td_api::sponsoredChats>> &&promise);
void view_sponsored_dialog(int64 local_id, Promise<Unit> &&promise);
void open_sponsored_dialog(int64 local_id, Promise<Unit> &&promise);
void report_sponsored_dialog(int64 local_id, const string &option_id,
Promise<td_api::object_ptr<td_api::ReportSponsoredResult>> &&promise);
private:
struct SponsoredContentInfo;
struct SponsoredMessage;
struct SponsoredMessageInfo;
struct DialogSponsoredMessages;
struct SponsoredDialog;
struct SponsoredDialogs;
void tear_down() final;
static void on_delete_cached_sponsored_messages_timeout_callback(void *sponsored_message_manager_ptr,
int64 dialog_id_int);
static void on_delete_cached_sponsored_dialogs_timeout_callback(void *sponsored_message_manager_ptr, int64 local_id);
void delete_cached_sponsored_messages(DialogId dialog_id);
void delete_cached_sponsored_dialogs(int64 local_id);
td_api::object_ptr<td_api::messageSponsor> get_message_sponsor_object(
const SponsoredMessage &sponsored_message) const;
@ -64,15 +79,31 @@ class SponsoredMessageManager final : public Actor {
td_api::object_ptr<td_api::sponsoredMessages> get_sponsored_messages_object(
DialogId dialog_id, const DialogSponsoredMessages &sponsored_messages) const;
td_api::object_ptr<td_api::sponsoredChat> get_sponsored_chat_object(const SponsoredDialog &sponsored_dialog) const;
td_api::object_ptr<td_api::sponsoredChats> get_sponsored_chats_object(
const SponsoredDialogs &sponsored_dialogs) const;
void on_get_dialog_sponsored_messages(
DialogId dialog_id, Result<telegram_api::object_ptr<telegram_api::messages_SponsoredMessages>> &&result);
void on_get_search_sponsored_dialogs(
const string &query, Result<telegram_api::object_ptr<telegram_api::contacts_SponsoredPeers>> &&result);
FlatHashMap<DialogId, unique_ptr<DialogSponsoredMessages>, DialogIdHash> dialog_sponsored_messages_;
FlatHashMap<string, unique_ptr<SponsoredDialogs>> search_sponsored_dialogs_;
FlatHashMap<int64, string> local_id_to_search_query_;
FlatHashMap<int64, unique_ptr<SponsoredContentInfo>> dialog_infos_;
MessageId current_sponsored_message_id_ = MessageId::max();
int64 current_local_id_ = 0;
MultiTimeout delete_cached_sponsored_messages_timeout_{"DeleteCachedSponsoredMessagesTimeout"};
MultiTimeout delete_cached_sponsored_dialogs_timeout_{"DeleteCachedSponsoredDialogsTimeout"};
Td *td_;
ActorShared<> parent_;
};

View File

@ -6,6 +6,7 @@
//
#pragma once
#include "td/telegram/BusinessConnectionId.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/MessageFullId.h"
#include "td/telegram/StarGiftId.h"
@ -44,7 +45,7 @@ class StarGiftManager final : public Actor {
void send_gift(int64 gift_id, DialogId dialog_id, td_api::object_ptr<td_api::formattedText> text, bool is_private,
bool pay_for_upgrade, Promise<Unit> &&promise);
void convert_gift(StarGiftId star_gift_id, Promise<Unit> &&promise);
void convert_gift(BusinessConnectionId business_connection_id, StarGiftId star_gift_id, Promise<Unit> &&promise);
void save_gift(StarGiftId star_gift_id, bool is_saved, Promise<Unit> &&promise);
@ -54,14 +55,16 @@ class StarGiftManager final : public Actor {
void get_gift_upgrade_preview(int64 gift_id, Promise<td_api::object_ptr<td_api::giftUpgradePreview>> &&promise);
void upgrade_gift(StarGiftId star_gift_id, bool keep_original_details, int64 star_count,
Promise<td_api::object_ptr<td_api::upgradeGiftResult>> &&promise);
void upgrade_gift(BusinessConnectionId business_connection_id, StarGiftId star_gift_id, bool keep_original_details,
int64 star_count, Promise<td_api::object_ptr<td_api::upgradeGiftResult>> &&promise);
void transfer_gift(StarGiftId star_gift_id, DialogId receiver_dialog_id, int64 star_count, Promise<Unit> &&promise);
void transfer_gift(BusinessConnectionId business_connection_id, StarGiftId star_gift_id, DialogId receiver_dialog_id,
int64 star_count, Promise<Unit> &&promise);
void get_saved_star_gifts(DialogId dialog_id, bool exclude_unsaved, bool exclude_saved, bool exclude_unlimited,
bool exclude_limited, bool exclude_unique, bool sort_by_value, const string &offset,
int32 limit, Promise<td_api::object_ptr<td_api::receivedGifts>> &&promise);
void get_saved_star_gifts(BusinessConnectionId business_connection_id, DialogId dialog_id, bool exclude_unsaved,
bool exclude_saved, bool exclude_unlimited, bool exclude_limited, bool exclude_unique,
bool sort_by_value, const string &offset, int32 limit,
Promise<td_api::object_ptr<td_api::receivedGifts>> &&promise);
void get_saved_star_gift(StarGiftId star_gift_id, Promise<td_api::object_ptr<td_api::receivedGift>> &&promise);

View File

@ -0,0 +1,63 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025
//
// Distributed under the 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/DisallowedGiftsSettings.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 StarGiftSettings {
bool display_gifts_button_ = false;
DisallowedGiftsSettings disallowed_gifts_;
friend bool operator==(const StarGiftSettings &lhs, const StarGiftSettings &rhs);
friend StringBuilder &operator<<(StringBuilder &string_builder, const StarGiftSettings &settings);
public:
StarGiftSettings() = default;
StarGiftSettings(bool display_gifts_button,
telegram_api::object_ptr<telegram_api::disallowedGiftsSettings> &&settings);
explicit StarGiftSettings(const td_api::object_ptr<td_api::giftSettings> &settings);
td_api::object_ptr<td_api::giftSettings> get_gift_settings_object() const;
bool get_display_gifts_button() const {
return display_gifts_button_;
}
const DisallowedGiftsSettings &get_disallowed_gifts() const {
return disallowed_gifts_;
}
bool is_default() const {
return !display_gifts_button_ && disallowed_gifts_.is_default();
}
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
};
bool operator==(const StarGiftSettings &lhs, const StarGiftSettings &rhs);
inline bool operator!=(const StarGiftSettings &lhs, const StarGiftSettings &rhs) {
return !(lhs == rhs);
}
StringBuilder &operator<<(StringBuilder &string_builder, const StarGiftSettings &settings);
} // namespace td

View File

@ -169,8 +169,8 @@ class StickersManager final : public Actor {
Status on_animated_emoji_message_clicked(string &&emoji, MessageFullId message_full_id, string data);
void create_sticker(FileId file_id, FileId premium_animation_file_id, string minithumbnail, PhotoSize thumbnail,
Dimensions dimensions, tl_object_ptr<telegram_api::documentAttributeSticker> sticker,
tl_object_ptr<telegram_api::documentAttributeCustomEmoji> custom_emoji,
Dimensions dimensions, telegram_api::object_ptr<telegram_api::documentAttributeSticker> sticker,
telegram_api::object_ptr<telegram_api::documentAttributeCustomEmoji> custom_emoji,
StickerFormat sticker_format, MultiPromiseActor *load_data_multipromise_ptr);
bool has_secret_input_media(FileId sticker_file_id) const;

View File

@ -108,6 +108,14 @@ class StoryManager final : public Actor {
int64 log_event_id_ = 0;
};
struct BeingEditedBusinessStory {
unique_ptr<StoryContent> content_;
vector<MediaArea> areas_;
FormattedText caption_;
UserPrivacySettingRules privacy_rules_;
Promise<td_api::object_ptr<td_api::story>> promise_;
};
struct PendingStory {
DialogId dialog_id_;
StoryId story_id_;
@ -228,6 +236,13 @@ class StoryManager final : public Actor {
td_api::object_ptr<td_api::inputStoryAreas> &&input_areas,
td_api::object_ptr<td_api::formattedText> &&input_caption, Promise<Unit> &&promise);
void edit_business_story(DialogId owner_dialog_id, StoryId story_id,
td_api::object_ptr<td_api::InputStoryContent> &&input_story_content,
td_api::object_ptr<td_api::inputStoryAreas> &&input_areas,
td_api::object_ptr<td_api::formattedText> &&input_caption,
td_api::object_ptr<td_api::StoryPrivacySettings> &&settings,
Promise<td_api::object_ptr<td_api::story>> &&promise);
void edit_story_cover(DialogId owner_dialog_id, StoryId story_id, double main_frame_timestamp,
Promise<Unit> &&promise);
@ -378,6 +393,7 @@ class StoryManager final : public Actor {
class SendStoryQuery;
class EditStoryQuery;
class EditBusinessStoryQuery;
class DeleteStoryOnServerLogEvent;
class ReadStoriesOnServerLogEvent;
@ -577,6 +593,9 @@ class StoryManager final : public Actor {
void do_edit_story(unique_ptr<PendingStory> &&pending_story,
telegram_api::object_ptr<telegram_api::InputFile> input_file);
void on_edit_business_story(unique_ptr<PendingStory> &&pending_story,
telegram_api::object_ptr<telegram_api::Updates> updates);
void on_toggle_story_is_pinned(StoryFullId story_full_id, bool is_pinned, Promise<Unit> &&promise);
void on_update_dialog_max_story_ids(DialogId owner_dialog_id, StoryId max_story_id, StoryId max_read_story_id);
@ -688,6 +707,8 @@ class StoryManager final : public Actor {
FlatHashMap<StoryFullId, unique_ptr<BeingEditedStory>, StoryFullIdHash> being_edited_stories_;
FlatHashMap<uint32, unique_ptr<BeingEditedBusinessStory>> being_edited_business_stories_;
FlatHashMap<StoryFullId, int64, StoryFullIdHash> edit_generations_;
FlatHashMap<DialogId, PendingStoryViews, DialogIdHash> pending_story_views_;

View File

@ -117,8 +117,13 @@ class UpdatesManager final : public Actor {
static vector<InputGroupCallId> get_update_new_group_call_ids(const telegram_api::Updates *updates_ptr);
void process_updates_users_and_chats(telegram_api::Updates *updates_ptr);
static string extract_join_group_call_presentation_params(telegram_api::Updates *updates_ptr);
static telegram_api::object_ptr<telegram_api::StoryItem> extract_story(telegram_api::Updates *updates_ptr,
DialogId owner_dialog_id);
static vector<DialogId> get_update_notify_settings_dialog_ids(const telegram_api::Updates *updates_ptr);
static vector<DialogId> get_chat_dialog_ids(const telegram_api::Updates *updates_ptr);
@ -699,6 +704,8 @@ class UpdatesManager final : public Actor {
// unsupported updates
void on_update(tl_object_ptr<telegram_api::updateNewStoryReaction> update, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateSentPhoneCode> update, Promise<Unit> &&promise);
};
} // namespace td

View File

@ -12,6 +12,7 @@
#include "td/telegram/BotCommand.h"
#include "td/telegram/BotMenuButton.h"
#include "td/telegram/BotVerifierSettings.h"
#include "td/telegram/BusinessConnectionId.h"
#include "td/telegram/ChannelId.h"
#include "td/telegram/Contact.h"
#include "td/telegram/CustomEmojiId.h"
@ -29,6 +30,7 @@
#include "td/telegram/ReferralProgramInfo.h"
#include "td/telegram/RestrictionReason.h"
#include "td/telegram/SecretChatId.h"
#include "td/telegram/StarGiftSettings.h"
#include "td/telegram/StoryId.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
@ -120,7 +122,9 @@ class UserManager final : public Actor {
void on_binlog_secret_chat_event(BinlogEvent &&event);
void on_update_user_name(UserId user_id, string &&first_name, string &&last_name, Usernames &&usernames);
void on_update_user_name(UserId user_id, string &&first_name, string &&last_name);
void on_update_user_usernames(UserId user_id, Usernames &&usernames);
void on_update_user_phone_number(UserId user_id, string &&phone_number);
@ -149,6 +153,8 @@ class UserManager final : public Actor {
void on_update_my_gift_count(int32 added_gift_count);
void on_update_my_user_gift_settings(StarGiftSettings &&gift_settings, Promise<Unit> &&promise);
void on_update_my_user_location(DialogLocation &&location);
void on_update_my_user_work_hours(BusinessWorkHours &&work_hours);
@ -189,6 +195,8 @@ class UserManager final : public Actor {
void on_ignored_restriction_reasons_changed();
void on_update_freeze_state(int32 freeze_since_date, int32 freeze_until_date, string freeze_appeal_url);
void invalidate_user_full(UserId user_id);
bool have_user(UserId user_id) const;
@ -334,6 +342,10 @@ class UserManager final : public Actor {
void set_bot_profile_photo(UserId bot_user_id, const td_api::object_ptr<td_api::InputChatPhoto> &input_photo,
Promise<Unit> &&promise);
void set_business_profile_photo(BusinessConnectionId business_connection_id,
const td_api::object_ptr<td_api::InputChatPhoto> &input_photo, bool is_fallback,
Promise<Unit> &&promise);
void set_profile_photo(const td_api::object_ptr<td_api::InputChatPhoto> &input_photo, bool is_fallback,
Promise<Unit> &&promise);
@ -637,6 +649,7 @@ class UserManager final : public Actor {
int32 gift_count = 0;
int32 common_chat_count = 0;
Birthdate birthdate;
StarGiftSettings gift_settings;
ChannelId personal_channel_id;
@ -1055,6 +1068,8 @@ class UserManager final : public Actor {
td_api::object_ptr<td_api::secretChat> get_secret_chat_object_const(SecretChatId secret_chat_id,
const SecretChat *secret_chat) const;
td_api::object_ptr<td_api::updateFreezeState> get_update_freeze_state_object() const;
Td *td_;
ActorShared<> parent_;
UserId my_id_;
@ -1152,6 +1167,10 @@ class UserManager final : public Actor {
WaitFreeHashSet<UserId, UserIdHash> restricted_user_ids_;
int32 freeze_since_date_ = 0;
int32 freeze_until_date_ = 0;
string freeze_appeal_url_;
struct ContactBirthdates {
vector<std::pair<UserId, Birthdate>> users_;
double next_sync_time_ = 0.0;

View File

@ -10,7 +10,7 @@
namespace td {
constexpr int32 MTPROTO_LAYER = 200;
constexpr int32 MTPROTO_LAYER = 201;
enum class Version : int32 {
Initial, // 0

View File

@ -10,18 +10,17 @@
#include "td/e2e/Container.h"
#include "td/e2e/e2e_api.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/SharedSlice.h"
#include "td/utils/Slice.h"
#include "td/utils/Span.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/Status.h"
#include "td/utils/StringBuilder.h"
#include "td/utils/Time.h"
#include "td/utils/UInt.h"
#include "td/utils/VectorQueue.h"
#include <map>
#include <set>
#include <unordered_map>
#include <utility>
namespace tde2e_core {
@ -43,6 +42,9 @@ struct CallVerificationChain {
CallVerificationState get_verification_state() const;
CallVerificationWords get_verification_words() const;
void set_user_id(td::int64 user_id) {
user_id_ = user_id;
}
void allow_delay() {
delay_allowed_ = true;
}
@ -66,6 +68,17 @@ struct CallVerificationChain {
std::map<td::int64, std::string> committed_;
std::map<td::int64, std::string> revealed_;
td::int64 user_id_{};
td::Timestamp commit_at_{};
td::Timestamp reveal_at_{};
td::Timestamp done_at_{};
struct UserState {
td::Timestamp receive_commit_at_{};
td::Timestamp receive_reveal_at_{};
};
std::map<td::int64, UserState> users_;
bool delay_allowed_{false};
bool may_skip_signatures_validation_{false};
std::map<td::int32, std::vector<std::pair<std::string, e2e::object_ptr<e2e::e2e_chain_GroupBroadcast>>>>
@ -74,7 +87,7 @@ struct CallVerificationChain {
class CallEncryption {
public:
explicit CallEncryption(td::int64 user_id, PrivateKey private_key);
CallEncryption(td::int64 user_id, PrivateKey private_key);
td::Status add_shared_key(td::int32 epoch, td::SecureString key, GroupStateRef group_state);
void forget_shared_key(td::int32 epoch);
@ -83,7 +96,7 @@ class CallEncryption {
private:
static constexpr double FORGET_EPOCH_DELAY = 10;
static constexpr int MAX_ACTIVE_EPOCHS = 15;
static constexpr td::int32 MAX_ACTIVE_EPOCHS = 15;
td::int64 user_id_{};
PrivateKey private_key_;
@ -194,7 +207,7 @@ struct Call {
TRY_STATUS(call_verification_.receive_inbound_message(local_verification_message));
return get_verification_state();
}
friend td::StringBuilder &operator<<(td::StringBuilder &builder, const Call &call);
friend td::StringBuilder &operator<<(td::StringBuilder &sb, const Call &call);
private:
td::Status status_{td::Status::OK()};

View File

@ -324,8 +324,7 @@ struct EncryptedStorage {
static td::Result<EncryptedStorage> create(td::Slice last_block, PrivateKey pk) {
auto public_key = pk.to_public_key();
auto secret_for_key = MessageEncryption::hmac_sha512(pk.to_secure_string(), "EncryptedStorage::secret_for_key");
auto secret_for_value =
MessageEncryption::hmac_sha512(pk.to_secure_string(), "EncryptedStorage::secret_for_value");
auto secret_for_value = MessageEncryption::hmac_sha512(pk.to_secure_string(), "EncryptedStorage::secret_for_value");
ClientBlockchain blockchain;
if (last_block.empty()) {
TRY_RESULT_ASSIGN(blockchain, ClientBlockchain::create_empty());

View File

@ -19,7 +19,8 @@ class MessageEncryption {
static td::Result<td::SecureString> decrypt_data(td::Slice encrypted_data, td::Slice secret);
static td::SecureString hmac_sha512(td::Slice key, td::Slice message);
static td::SecureString kdf(td::Slice secret, td::Slice password, int iterations);
static td::Result<td::SecureString> encrypt_header(td::Slice decrypted_header, td::Slice encrypted_message, td::Slice secret);
static td::Result<td::SecureString> encrypt_header(td::Slice decrypted_header, td::Slice encrypted_message,
td::Slice secret);
static td::Result<td::SecureString> decrypt_header(td::Slice encrypted_header, td::Slice encrypted_message,
td::Slice secret);

View File

@ -174,7 +174,6 @@ Result<PrivateKeyId> login_finish_for_bob(LoginId bob_login_id, UserId alice_use
Result<Ok> login_destroy(LoginId login_id);
Result<Ok> login_destroy_all();
// Personal info
// TODO: UserId
@ -296,7 +295,8 @@ struct CallState {
};
Result<Bytes> call_create_zero_block(PrivateKeyId private_key_id, const CallState &initial_state);
Result<Bytes> call_create_self_add_block(PrivateKeyId private_key_id, Slice previous_block, const CallParticipant &self);
Result<Bytes> call_create_self_add_block(PrivateKeyId private_key_id, Slice previous_block,
const CallParticipant &self);
Result<CallId> call_create(UserId user_id, PrivateKeyId private_key_id, Slice last_block);
Result<std::string> call_describe(CallId call);

View File

@ -1,3 +1,9 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2025
//
// Distributed under the 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 <string>
@ -16,62 +22,59 @@ struct TestVector {
inline std::vector<TestVector> get_test_vectors() {
return {
{
"empty_message",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"",
{"empty_message", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a", "",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"9e2476ad849d22a44d9135c5c3c5e8b52d4f88473ae8745f3a9cec4d54780caf",
"de3539a5e10b20a3a0cffc24dbbd76b3a7e0eeab402cb38396d64785a3ab7c25"
},
{
"simple_message",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"48656c6c6f2c20576f726c6421",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"de3539a5e10b20a3a0cffc24dbbd76b3a7e0eeab402cb38396d64785a3ab7c25"},
{"simple_message", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"48656c6c6f2c20576f726c6421", "a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"872b141f6d1e3554ead471dffd0fee5c04a0b04260eafcca9187158ce84c4487e9429df876706753913de61029402478",
"013037e02dc8dbf13598d96eb333a69a930efe043bac7dce0d6edfd1abc6bd2f"
},
{
"long_message",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878",
"013037e02dc8dbf13598d96eb333a69a930efe043bac7dce0d6edfd1abc6bd2f"},
{"long_message", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787"
"878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878"
"787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787"
"8787878787878787878787878787878787878787878787878787878787878787878",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"0fd497802c755b9c6fb9d58d38b9fb5fbd7dc9ccf78af3eb003a22d46bfa38894135d976bbec0f3cadc2b61a4d8648120dada26b2c3153def20fb9e370def31c802e202846946b5cb1bc2c01a7b46605292d6043ffb8f4040aaf18914e1c93fe9e683f088e23ee5e1551f00068a23fa3ebb8d6b9dcbf7a9072b12323b1a64247ba9bc7d277b08cfcc37387a0d24afca170dc027d8f0212eb62bccd9555de98936047c9bfc6a03aa539073f458795bd94b9b43003fe2299805f90c1d30ca631c8054242687e41e890bf4d744b529d7e96ea48a5bcec700993b5e980173049cf9df6f93d62ccc06d933fd6d7063890fa2d",
"697558ba60e789622ee90dffc55f1f1148cfea568c573b257fcf2083cf8aad0a"
},
{
"random_message",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"e61d2b05302c49faa9fac6a893957a846a2b30801dc171cf62ffec92297b10bfc4a82445839ecb4c5800ffb37c5356d4b95fc565ddb2e7f3e21f2936a952373c",
"0fd497802c755b9c6fb9d58d38b9fb5fbd7dc9ccf78af3eb003a22d46bfa38894135d976bbec0f3cadc2b61a4d8648120dada26b2c3153d"
"ef20fb9e370def31c802e202846946b5cb1bc2c01a7b46605292d6043ffb8f4040aaf18914e1c93fe9e683f088e23ee5e1551f00068a23f"
"a3ebb8d6b9dcbf7a9072b12323b1a64247ba9bc7d277b08cfcc37387a0d24afca170dc027d8f0212eb62bccd9555de98936047c9bfc6a03"
"aa539073f458795bd94b9b43003fe2299805f90c1d30ca631c8054242687e41e890bf4d744b529d7e96ea48a5bcec700993b5e980173049"
"cf9df6f93d62ccc06d933fd6d7063890fa2d",
"697558ba60e789622ee90dffc55f1f1148cfea568c573b257fcf2083cf8aad0a"},
{"random_message", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"e61d2b05302c49faa9fac6a893957a846a2b30801dc171cf62ffec92297b10bfc4a82445839ecb4c5800ffb37c5356d4b95fc565ddb2e7f"
"3e21f2936a952373c",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"515f0223f27302ca5e952ec978ec66bcdf04e7f72ae3a8e011e21457b355891d12e158c9b2dfb921520a0e5f531e6a20e95d42635b084a0b38a6e658f4a4181f85ea83756d316cea538cc34592491eef3e3530c34c63a693e3372cbdd0076628",
"b5bdfe6a3400c5d299d94756af4c18bbb8cca4a2635beeba3d89bbaa0025d9d3"
},
{
"very_long_message",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"de6e0dbde23e04b6be3d4c46868a1171c6b879227b19e370765823390501b195783c356af2156e828e511473d5698c9bd1cb4a70b7e209bbb02f8dda044af02ab6869478b211e3a17d72fbe6289c1b2e6132cb141e89cf72cf70defd67a23fbfe8e718a09a9c6a345565ebdc73e1f59927744801eb4e6f0b30d2705ea181e02a4030252330ac73bc4a4d51d2ccafb2f3f62abe3e81163be325ac823571c8dfae739f70bff39164e3cec7f53b88f97735dc25ac0c0630b1b41a131a979ba5164ab92e103716e9096e2fb5a6434b31d2c3673fca7e54dcdcce3807bfd43ee7bc3422868094305a9847ce7666bf57e49fb3c2009cb30eb3ba955942b923ec2c2a4e0341d86b524b198974bdce9cf863ab3526e9e03e53399dad20fc218554567c440536a31e05573f4cb930ba6a",
"515f0223f27302ca5e952ec978ec66bcdf04e7f72ae3a8e011e21457b355891d12e158c9b2dfb921520a0e5f531e6a20e95d42635b084a0"
"b38a6e658f4a4181f85ea83756d316cea538cc34592491eef3e3530c34c63a693e3372cbdd0076628",
"b5bdfe6a3400c5d299d94756af4c18bbb8cca4a2635beeba3d89bbaa0025d9d3"},
{"very_long_message", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"de6e0dbde23e04b6be3d4c46868a1171c6b879227b19e370765823390501b195783c356af2156e828e511473d5698c9bd1cb4a70b7e209b"
"bb02f8dda044af02ab6869478b211e3a17d72fbe6289c1b2e6132cb141e89cf72cf70defd67a23fbfe8e718a09a9c6a345565ebdc73e1f5"
"9927744801eb4e6f0b30d2705ea181e02a4030252330ac73bc4a4d51d2ccafb2f3f62abe3e81163be325ac823571c8dfae739f70bff3916"
"4e3cec7f53b88f97735dc25ac0c0630b1b41a131a979ba5164ab92e103716e9096e2fb5a6434b31d2c3673fca7e54dcdcce3807bfd43ee7"
"bc3422868094305a9847ce7666bf57e49fb3c2009cb30eb3ba955942b923ec2c2a4e0341d86b524b198974bdce9cf863ab3526e9e03e533"
"99dad20fc218554567c440536a31e05573f4cb930ba6a",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"e296a98cd96154b27d4b94cc520a8f028c61bd5ea69d22f0c3c13658c4bd5db0bd6661d0d17fac791c5cc06b3a54a853916bd7bf8a00644acc53cca43b6f51c66bc6a6cb98cf8d9f23dcd639089d1d9d3dfbc8829a1a81638317bbd3edb070c1dae181d97605eb42a6111b8696a16cc3e42639e38e93f872111fd67e934740f73a57df0e6edc6726c9aff99682bfcb7ddd99a3bef30da70d3c21e590fd02defc23be9f7f243e45a56b13562b8ecea09a14ac5af3a0500cb52f73f1bffea4a6624644da0bc4d112e5ee684b13a2ae8dbf401a5a8e581295a9dc876eaeb8ae4d732fb78d50a92c302d15c0a2308e43fc6e147ec162b28a534d6c95a2020fa141f3ce7f7dd25ff000d35f732a145abf31b3ff4d0da015d39da3b0fc70e692b567a9507be59e8c91a63fe809c495d76e70ec857cc24978771fc9314251e2bc4b1b24e0448514f97a6d438255cba8c1854019",
"8dab56b50ce6a4315b6e0b4eb32c39dfe817cb462ee9e070e2a60bb843c16107"
},
{
"message_with_special_chars",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"e296a98cd96154b27d4b94cc520a8f028c61bd5ea69d22f0c3c13658c4bd5db0bd6661d0d17fac791c5cc06b3a54a853916bd7bf8a00644"
"acc53cca43b6f51c66bc6a6cb98cf8d9f23dcd639089d1d9d3dfbc8829a1a81638317bbd3edb070c1dae181d97605eb42a6111b8696a16c"
"c3e42639e38e93f872111fd67e934740f73a57df0e6edc6726c9aff99682bfcb7ddd99a3bef30da70d3c21e590fd02defc23be9f7f243e4"
"5a56b13562b8ecea09a14ac5af3a0500cb52f73f1bffea4a6624644da0bc4d112e5ee684b13a2ae8dbf401a5a8e581295a9dc876eaeb8ae"
"4d732fb78d50a92c302d15c0a2308e43fc6e147ec162b28a534d6c95a2020fa141f3ce7f7dd25ff000d35f732a145abf31b3ff4d0da015d"
"39da3b0fc70e692b567a9507be59e8c91a63fe809c495d76e70ec857cc24978771fc9314251e2bc4b1b24e0448514f97a6d438255cba8c1"
"854019",
"8dab56b50ce6a4315b6e0b4eb32c39dfe817cb462ee9e070e2a60bb843c16107"},
{"message_with_special_chars", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"2014d1125081316a334896cbe5aed251d9fba6f3422afbc7e7bc9019e10e184241d18f71ef86603b5ce03e1c351e3dfff8adfb8f3498300a712ec134b367c533",
"6f5a5de410db3606ff94fa14d0e084a6ba5a51241a2abf45ac593e4748c477ce"
},
{
"message_with_unicode",
"5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"48656c6c6f2c20e4b896e7958c21",
"a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"2014d1125081316a334896cbe5aed251d9fba6f3422afbc7e7bc9019e10e184241d18f71ef86603b5ce03e1c351e3dfff8adfb8f3498300"
"a712ec134b367c533",
"6f5a5de410db3606ff94fa14d0e084a6ba5a51241a2abf45ac593e4748c477ce"},
{"message_with_unicode", "5a08a19b447df98136a4502e01b286011b2d148084a7ca17e3a93616d279eb2a",
"48656c6c6f2c20e4b896e7958c21", "a36c57ad5e8d6a30e80e010ab903b60da0206db1b4fd981cd61e059bbd8c0d4f",
"7ae70cb905f23109477b4d758d3907238ff4c37e2f351f086268ba3e85cef0257af58a70d8838c7b9c044f30382c2ccf",
"7dfb2d2e76df39b2fafdf01de009088a7e4d045b8630941986111ef2010d7c4a"
},
"7dfb2d2e76df39b2fafdf01de009088a7e4d045b8630941986111ef2010d7c4a"},
};
}