Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package telegram-desktop for
openSUSE:Factory checked in at 2026-05-08 16:46:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/telegram-desktop (Old)
and /work/SRC/openSUSE:Factory/.telegram-desktop.new.1966 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "telegram-desktop"
Fri May 8 16:46:09 2026 rev:153 rq:1351508 version:6.8.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/telegram-desktop/telegram-desktop.changes
2026-04-25 21:38:52.645459025 +0200
+++
/work/SRC/openSUSE:Factory/.telegram-desktop.new.1966/telegram-desktop.changes
2026-05-08 16:46:24.747779354 +0200
@@ -1,0 +2,8 @@
+Thu May 7 20:38:58 UTC 2026 - Илья Индиго <[email protected]>
+
+- Updated td to git20260425.
+ * No changes provides.
+- Updated telegram-desktop to 6.8.0
+ * https://github.com/telegramdesktop/tdesktop/releases/tag/v6.8.0
+
+-------------------------------------------------------------------
Old:
----
td-git20260414.tar.xz
tdesktop-6.7.8-full.tar.gz
New:
----
td-git20260425.tar.xz
tdesktop-6.8.0-full.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ telegram-desktop.spec ++++++
--- /var/tmp/diff_new_pack.tdvVDN/_old 2026-05-08 16:46:26.891868640 +0200
+++ /var/tmp/diff_new_pack.tdvVDN/_new 2026-05-08 16:46:26.895868805 +0200
@@ -23,9 +23,9 @@
%define ada_ver 3.4.4
%define h264_ver 2.6.0
%define owt_ver git20260123
-%define td_ver git20260414
+%define td_ver git20260425
Name: telegram-desktop
-Version: 6.7.8
+Version: 6.8.0
Release: 0
Summary: Messaging application with a focus on speed and security
License: GPL-3.0-only
++++++ td-git20260414.tar.xz -> td-git20260425.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/generate/scheme/td_api.tl
new/td-git20260425/td/generate/scheme/td_api.tl
--- old/td-git20260414/td/generate/scheme/td_api.tl 2026-04-16
00:40:10.763772677 +0200
+++ new/td-git20260425/td/generate/scheme/td_api.tl 2026-05-07
22:36:23.183438363 +0200
@@ -399,7 +399,7 @@
//@description Describes one answer option of a poll
-//@id Unique identifier of the option in the poll
+//@id Unique identifier of the option in the poll; may be empty if yet
unassigned
//@text Option text; 1-100 characters; may contain only custom emoji entities
//@media Option media. Currently, can be only of the types messageAnimation,
messageLocation, messagePhoto, messageSticker, messageVenue, or messageVideo
without caption
//@voter_count Number of voters for this option, available only for closed or
voted polls, or if the current user is the creator of the poll
@@ -6184,7 +6184,7 @@
//@description Describes active stories posted by a chat
//@chat_id Identifier of the chat that posted the stories
//@list Identifier of the story list in which the stories are shown; may be
null if the stories aren't shown in a story list
-//@order A parameter used to determine order of the stories in the story list;
0 if the stories doesn't need to be shown in the story list. Stories must be
sorted by the pair (order, story_poster_chat_id) in descending order
+//@order A parameter used to determine order of the stories in the story list;
0 if the stories don't need to be shown in the story list. Stories must be
sorted by the pair (order, story_poster_chat_id) in descending order
//@can_be_archived True, if the stories are shown in the main story list and
can be archived; otherwise, the stories can be hidden from the main story list
//-only by calling removeTopChat with topChatCategoryUsers and the chat_id.
Stories of the current user can't be archived nor hidden using removeTopChat
//@max_read_story_id Identifier of the last read active story
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/td-git20260414/td/telegram/BusinessConnectionManager.cpp
new/td-git20260425/td/telegram/BusinessConnectionManager.cpp
--- old/td-git20260414/td/telegram/BusinessConnectionManager.cpp
2026-04-16 00:40:10.771772353 +0200
+++ new/td-git20260425/td/telegram/BusinessConnectionManager.cpp
2026-05-07 22:36:23.192438129 +0200
@@ -1170,8 +1170,12 @@
if (!clean_input_string(reply_to_message->poll_option_id_)) {
reply_to_message->poll_option_id_.clear();
}
- return MessageInputReplyTo{message_id, DialogId(), MessageQuote(td_,
std::move(reply_to_message->quote_)),
- max(0, reply_to_message->checklist_task_id_),
reply_to_message->poll_option_id_};
+ return MessageInputReplyTo{message_id,
+ DialogId(),
+ MessageQuote(td_,
std::move(reply_to_message->quote_)),
+ max(0, reply_to_message->checklist_task_id_),
+ reply_to_message->poll_option_id_,
+ "business inputMessageReplyToMessage"};
}
case td_api::inputMessageReplyToExternalMessage::ID:
return {};
@@ -1823,9 +1827,8 @@
return promise.set_error(400, "Unsupported input message content type");
}
- bool is_premium = td_->option_manager_->get_option_boolean("is_premium");
TRY_RESULT_PROMISE(promise, content,
- get_input_message_content(DialogId(),
std::move(input_message_content), td_, is_premium));
+ get_input_message_content(DialogId(),
std::move(input_message_content), td_, true));
if (!content.ttl.is_empty()) {
return promise.set_error(400, "Can't enable self-destruction for media");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/ChatManager.cpp
new/td-git20260425/td/telegram/ChatManager.cpp
--- old/td-git20260414/td/telegram/ChatManager.cpp 2026-04-16
00:40:10.773772272 +0200
+++ new/td-git20260425/td/telegram/ChatManager.cpp 2026-05-07
22:36:23.193438103 +0200
@@ -5537,8 +5537,7 @@
vector<UserId> bot_user_ids;
for (const auto &participant : chat_full->participants) {
if (participant.status_.is_administrator() &&
participant.dialog_id_.get_type() == DialogType::User) {
- administrators.emplace_back(participant.dialog_id_.get_user_id(),
participant.status_.get_rank(),
- participant.status_.is_creator(),
participant.status_.can_be_edited());
+ administrators.emplace_back(participant.dialog_id_.get_user_id(),
participant.status_);
}
if (participant.dialog_id_.get_type() == DialogType::User) {
auto user_id = participant.dialog_id_.get_user_id();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/ChatManager.h
new/td-git20260425/td/telegram/ChatManager.h
--- old/td-git20260414/td/telegram/ChatManager.h 2026-04-16
00:40:10.773772272 +0200
+++ new/td-git20260425/td/telegram/ChatManager.h 2026-05-07
22:36:23.193438103 +0200
@@ -449,7 +449,7 @@
false,
ChannelType::Unknown};
- static constexpr uint32 CACHE_VERSION = 4;
+ static constexpr uint32 CACHE_VERSION = 5;
uint32 cache_version = 0;
bool is_active = false;
@@ -557,7 +557,7 @@
ChannelId monoforum_channel_id;
- static constexpr uint32 CACHE_VERSION = 10;
+ static constexpr uint32 CACHE_VERSION = 11;
uint32 cache_version = 0;
bool has_linked_channel = false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/DialogAdministrator.cpp
new/td-git20260425/td/telegram/DialogAdministrator.cpp
--- old/td-git20260414/td/telegram/DialogAdministrator.cpp 2026-04-16
00:40:10.774772231 +0200
+++ new/td-git20260425/td/telegram/DialogAdministrator.cpp 2026-05-07
22:36:23.195438051 +0200
@@ -6,10 +6,19 @@
//
#include "td/telegram/DialogAdministrator.h"
+#include "td/telegram/DialogParticipant.h"
#include "td/telegram/UserManager.h"
namespace td {
+DialogAdministrator::DialogAdministrator(UserId user_id, const
DialogParticipantStatus &status)
+ : user_id_(user_id)
+ , rank_(status.get_rank())
+ , is_creator_(status.is_creator())
+ , can_be_edited_(status.can_be_edited()) {
+ CHECK(status.is_administrator());
+}
+
td_api::object_ptr<td_api::chatAdministrator>
DialogAdministrator::get_chat_administrator_object(
const UserManager *user_manager) const {
CHECK(user_manager != nullptr);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/DialogAdministrator.h
new/td-git20260425/td/telegram/DialogAdministrator.h
--- old/td-git20260414/td/telegram/DialogAdministrator.h 2026-04-16
00:40:10.774772231 +0200
+++ new/td-git20260425/td/telegram/DialogAdministrator.h 2026-05-07
22:36:23.195438051 +0200
@@ -15,6 +15,7 @@
namespace td {
+class DialogParticipantStatus;
class UserManager;
class DialogAdministrator {
@@ -32,6 +33,8 @@
: user_id_(user_id), rank_(rank), is_creator_(is_creator),
can_be_edited_(can_be_edited) {
}
+ DialogAdministrator(UserId user_id, const DialogParticipantStatus &status);
+
td_api::object_ptr<td_api::chatAdministrator>
get_chat_administrator_object(const UserManager *user_manager) const;
UserId get_user_id() const {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/DialogParticipant.cpp
new/td-git20260425/td/telegram/DialogParticipant.cpp
--- old/td-git20260414/td/telegram/DialogParticipant.cpp 2026-04-16
00:40:10.776772150 +0200
+++ new/td-git20260425/td/telegram/DialogParticipant.cpp 2026-05-07
22:36:23.196438025 +0200
@@ -381,8 +381,8 @@
}
DialogParticipantStatus DialogParticipantStatus::GroupAdministrator(bool
is_creator, string &&rank) {
- return Administrator(AdministratorRights(false, true, true, false, false,
true, true, true, true, false, false, true,
- false, false, false, false, false,
ChannelType::Unknown),
+ return Administrator(AdministratorRights(false, true, true, false, false,
true, true, true, true, false, is_creator,
+ true, false, false, false, false,
true, ChannelType::Unknown),
std::move(rank), is_creator);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/DialogParticipant.h
new/td-git20260425/td/telegram/DialogParticipant.h
--- old/td-git20260414/td/telegram/DialogParticipant.h 2026-04-16
00:40:10.776772150 +0200
+++ new/td-git20260425/td/telegram/DialogParticipant.h 2026-05-07
22:36:23.196438025 +0200
@@ -64,6 +64,7 @@
AdministratorRights(const
td_api::object_ptr<td_api::chatAdministratorRights> &administrator_rights,
ChannelType channel_type);
+ // increase Chat cache version when a new right is added
AdministratorRights(bool is_anonymous, bool can_manage_dialog, 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,
@@ -211,6 +212,7 @@
RestrictedRights(const td_api::object_ptr<td_api::chatPermissions> &rights,
ChannelType channel_type);
+ // increase Chat cache version when a new right is added
RestrictedRights(bool can_send_messages, bool can_send_audios, bool
can_send_documents, bool can_send_photos,
bool can_send_videos, bool can_send_video_notes, bool
can_send_voice_notes, bool can_send_stickers,
bool can_send_animations, bool can_send_games, bool
can_use_inline_bots,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessageContent.cpp
new/td-git20260425/td/telegram/MessageContent.cpp
--- old/td-git20260414/td/telegram/MessageContent.cpp 2026-04-16
00:40:10.782771906 +0200
+++ new/td-git20260425/td/telegram/MessageContent.cpp 2026-05-07
22:36:23.202437869 +0200
@@ -1755,8 +1755,8 @@
string data;
MessagePollAppendAnswer() = default;
- MessagePollAppendAnswer(MessageId poll_message_id, FormattedText &&text,
string &&data)
- : poll_message_id(poll_message_id), text(std::move(text)),
data(std::move(data)) {
+ MessagePollAppendAnswer(MessageId poll_message_id, FormattedText &&text,
const string &data)
+ : poll_message_id(poll_message_id), text(std::move(text)), data(data) {
}
MessageContentType get_type() const final {
@@ -1771,8 +1771,8 @@
string data;
MessagePollDeleteAnswer() = default;
- MessagePollDeleteAnswer(MessageId poll_message_id, FormattedText &&text,
string &&data)
- : poll_message_id(poll_message_id), text(std::move(text)),
data(std::move(data)) {
+ MessagePollDeleteAnswer(MessageId poll_message_id, FormattedText &&text,
const string &data)
+ : poll_message_id(poll_message_id), text(std::move(text)), data(data) {
}
MessageContentType get_type() const final {
@@ -10525,8 +10525,7 @@
}
vector<std::pair<ChannelId, MinChannel>> min_channels;
PollOption option(td, std::move(action->answer_), min_channels);
- return td::make_unique<MessagePollAppendAnswer>(reply_to_message_id,
std::move(option.text_),
- std::move(option.data_));
+ return td::make_unique<MessagePollAppendAnswer>(reply_to_message_id,
std::move(option.text_), option.get_data());
}
case telegram_api::messageActionPollDeleteAnswer::ID: {
auto action =
telegram_api::move_object_as<telegram_api::messageActionPollDeleteAnswer>(action_ptr);
@@ -10537,8 +10536,7 @@
}
vector<std::pair<ChannelId, MinChannel>> min_channels;
PollOption option(td, std::move(action->answer_), min_channels);
- return td::make_unique<MessagePollDeleteAnswer>(reply_to_message_id,
std::move(option.text_),
- std::move(option.data_));
+ return td::make_unique<MessagePollDeleteAnswer>(reply_to_message_id,
std::move(option.text_), option.get_data());
}
default:
UNREACHABLE();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessageInputReplyTo.cpp
new/td-git20260425/td/telegram/MessageInputReplyTo.cpp
--- old/td-git20260414/td/telegram/MessageInputReplyTo.cpp 2026-04-16
00:40:10.783771867 +0200
+++ new/td-git20260425/td/telegram/MessageInputReplyTo.cpp 2026-05-07
22:36:23.203437843 +0200
@@ -58,6 +58,7 @@
}
message_id_ = message_id;
dialog_id_ = dialog_id;
+ debug_source_ = "inputReplyToMessage";
quote_ = MessageQuote(td, reply_to);
todo_item_id_ = reply_to->todo_item_id_;
@@ -79,6 +80,7 @@
MessageInputReplyTo MessageInputReplyTo::regular(MessageId message_id) {
MessageInputReplyTo result;
result.message_id_ = message_id;
+ result.debug_source_ = "regular";
return result;
}
@@ -146,7 +148,8 @@
flags |= telegram_api::inputReplyToMessage::POLL_OPTION_MASK;
}
if (reply_to_message_id != MessageId() && !reply_to_message_id.is_server()) {
- LOG(FATAL) << *this << " in " << message_topic << " in " << for_dialog_id
<< " with flags " << with_flags;
+ LOG(FATAL) << *this << " in " << message_topic << " in " << for_dialog_id
<< " with flags " << with_flags
+ << " from " << (debug_source_ == nullptr ? "null" :
debug_source_);
}
auto result = telegram_api::make_object<telegram_api::inputReplyToMessage>(
flags, reply_to_message_id.get_server_message_id().get(), top_msg_id,
std::move(input_peer), string(), Auto(), 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessageInputReplyTo.h
new/td-git20260425/td/telegram/MessageInputReplyTo.h
--- old/td-git20260414/td/telegram/MessageInputReplyTo.h 2026-04-16
00:40:10.784771826 +0200
+++ new/td-git20260425/td/telegram/MessageInputReplyTo.h 2026-05-07
22:36:23.203437843 +0200
@@ -30,6 +30,7 @@
MessageQuote quote_;
int32 todo_item_id_ = 0;
string poll_option_id_;
+ const char *debug_source_ = "unknown";
// or
StoryFullId story_full_id_;
@@ -48,12 +49,13 @@
~MessageInputReplyTo();
MessageInputReplyTo(MessageId message_id, DialogId dialog_id, MessageQuote
quote, int32 todo_item_id,
- const string &poll_option_id)
+ const string &poll_option_id, const char *debug_source)
: message_id_(message_id)
, dialog_id_(dialog_id)
, quote_(std::move(quote))
, todo_item_id_(todo_item_id)
- , poll_option_id_(poll_option_id) {
+ , poll_option_id_(poll_option_id)
+ , debug_source_(debug_source) {
}
explicit MessageInputReplyTo(StoryFullId story_full_id) :
story_full_id_(story_full_id) {
@@ -96,7 +98,7 @@
if (story_full_id_.is_valid()) {
return MessageInputReplyTo(story_full_id_);
}
- return MessageInputReplyTo(message_id_, dialog_id_, quote_.clone(),
todo_item_id_, poll_option_id_);
+ return MessageInputReplyTo(message_id_, dialog_id_, quote_.clone(),
todo_item_id_, poll_option_id_, debug_source_);
}
void add_dependencies(Dependencies &dependencies) const;
@@ -109,9 +111,10 @@
// only for draft messages
td_api::object_ptr<td_api::InputMessageReplyTo>
get_input_message_reply_to_object(Td *td) const;
- void set_message_id(MessageId new_message_id) {
+ void set_message_id(MessageId new_message_id, const char *source) {
CHECK(message_id_.is_valid() || message_id_.is_valid_scheduled());
message_id_ = new_message_id;
+ debug_source_ = source;
}
MessageId get_same_chat_reply_to_message_id() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessageQueryManager.cpp
new/td-git20260425/td/telegram/MessageQueryManager.cpp
--- old/td-git20260414/td/telegram/MessageQueryManager.cpp 2026-04-16
00:40:10.784771826 +0200
+++ new/td-git20260425/td/telegram/MessageQueryManager.cpp 2026-05-07
22:36:23.204437816 +0200
@@ -21,6 +21,7 @@
#include "td/telegram/ForumTopicManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/HashtagHints.h"
+#include "td/telegram/InlineQueriesManager.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/logevent/LogEventHelper.h"
#include "td/telegram/MessageContent.h"
@@ -31,6 +32,7 @@
#include "td/telegram/MessageSender.h"
#include "td/telegram/MessagesInfo.h"
#include "td/telegram/MessagesManager.h"
+#include "td/telegram/RequestedDialogType.h"
#include "td/telegram/SearchPostsFlood.h"
#include "td/telegram/SecretChatsManager.h"
#include "td/telegram/ServerMessageId.h"
@@ -2077,11 +2079,60 @@
td_->create_handler<ReportMessageDeliveryQuery>()->send(message_full_id,
from_push);
}
-void MessageQueryManager::send_bot_requested_peer(MessageFullId
message_full_id, UserId user_id,
- const string &request_id,
int32 button_id,
- vector<DialogId>
shared_dialog_ids, Promise<Unit> &&promise) {
+void MessageQueryManager::share_dialogs_with_bot(const
td_api::object_ptr<td_api::KeyboardButtonSource> &source_ptr,
+ int32 button_id,
vector<DialogId> shared_dialog_ids, bool expect_user,
+ bool only_check,
Promise<Unit> &&promise) {
+ if (source_ptr == nullptr) {
+ return promise.set_error(400, "Source must be non-empty");
+ }
+ const RequestedDialogType *requested_dialog_type = nullptr;
+ MessageFullId message_full_id;
+ UserId bot_user_id;
+ string request_id;
+ switch (source_ptr->get_id()) {
+ case td_api::keyboardButtonSourceMessage::ID: {
+ const auto *source = static_cast<const
td_api::keyboardButtonSourceMessage *>(source_ptr.get());
+ message_full_id = {DialogId(source->chat_id_),
MessageId(source->message_id_)};
+ TRY_RESULT_PROMISE_ASSIGN(promise, requested_dialog_type,
+
td_->messages_manager_->get_message_requested_dialog_type(message_full_id,
button_id));
+ break;
+ }
+ case td_api::keyboardButtonSourceWebApp::ID: {
+ const auto *source = static_cast<const
td_api::keyboardButtonSourceWebApp *>(source_ptr.get());
+ bot_user_id = UserId(source->bot_user_id_);
+ request_id = source->prepared_button_id_;
+ requested_dialog_type =
td_->inline_queries_manager_->get_requested_dialog_type(bot_user_id,
request_id);
+ break;
+ }
+ default:
+ UNREACHABLE();
+ }
+ if (requested_dialog_type == nullptr) {
+ return promise.set_error(400, "Button not found");
+ }
+ TRY_STATUS_PROMISE(promise,
requested_dialog_type->check_shared_dialog_count(shared_dialog_ids.size()));
+
+ for (auto shared_dialog_id : shared_dialog_ids) {
+ if (shared_dialog_id.get_type() != DialogType::User) {
+ if (!td_->dialog_manager_->have_dialog_force(shared_dialog_id,
"share_dialogs_with_bot")) {
+ return promise.set_error(400, "Shared chat not found");
+ }
+ } else {
+ if (!expect_user) {
+ return promise.set_error(400, "Wrong chat type");
+ }
+ if
(!td_->user_manager_->have_accessible_user(shared_dialog_id.get_user_id())) {
+ return promise.set_error(400, "Shared user not found");
+ }
+ }
+ TRY_STATUS_PROMISE(promise,
requested_dialog_type->check_shared_dialog(td_, shared_dialog_id));
+ }
+ if (only_check) {
+ return promise.set_value(Unit());
+ }
+
td_->create_handler<SendBotRequestedPeerQuery>(std::move(promise))
- ->send(message_full_id, user_id, request_id, button_id,
std::move(shared_dialog_ids));
+ ->send(message_full_id, bot_user_id, request_id, button_id,
std::move(shared_dialog_ids));
}
void MessageQueryManager::reload_message_extended_media(DialogId dialog_id,
vector<MessageId> message_ids) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessageQueryManager.h
new/td-git20260425/td/telegram/MessageQueryManager.h
--- old/td-git20260414/td/telegram/MessageQueryManager.h 2026-04-16
00:40:10.784771826 +0200
+++ new/td-git20260425/td/telegram/MessageQueryManager.h 2026-05-07
22:36:23.204437816 +0200
@@ -68,8 +68,9 @@
void report_message_delivery(MessageFullId message_full_id, int32
until_date, bool from_push);
- void send_bot_requested_peer(MessageFullId message_full_id, UserId user_id,
const string &request_id, int32 button_id,
- vector<DialogId> shared_dialog_ids,
Promise<Unit> &&promise);
+ void share_dialogs_with_bot(const
td_api::object_ptr<td_api::KeyboardButtonSource> &source_ptr, int32 button_id,
+ vector<DialogId> shared_dialog_ids, bool
expect_user, bool only_check,
+ Promise<Unit> &&promise);
void reload_message_extended_media(DialogId dialog_id, vector<MessageId>
message_ids);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessagesManager.cpp
new/td-git20260425/td/telegram/MessagesManager.cpp
--- old/td-git20260414/td/telegram/MessagesManager.cpp 2026-04-16
00:40:10.787771704 +0200
+++ new/td-git20260425/td/telegram/MessagesManager.cpp 2026-05-07
22:36:23.206437765 +0200
@@ -82,7 +82,6 @@
#include "td/telegram/RepliedMessageInfo.hpp"
#include "td/telegram/ReplyMarkup.h"
#include "td/telegram/ReplyMarkup.hpp"
-#include "td/telegram/RequestedDialogType.h"
#include "td/telegram/SavedMessagesManager.h"
#include "td/telegram/SecretChatsManager.h"
#include "td/telegram/SponsoredMessageManager.h"
@@ -4754,7 +4753,7 @@
return false;
}
CHECK(m != nullptr);
- if (m->forward_info != nullptr || m->had_forward_info ||
m->content->get_type() != MessageContentType::Poll) {
+ if (is_message_forward(m) || m->content->get_type() !=
MessageContentType::Poll) {
return false;
}
return get_message_content_poll_has_unread_votes(td_, m->content.get());
@@ -5120,7 +5119,7 @@
Message *m = get_message(d, message_full_id.get_message_id());
CHECK(m != nullptr);
CHECK(!td_->auth_manager_->is_bot());
- if (m->forward_info != nullptr || m->had_forward_info ||
m->content->get_type() != MessageContentType::Poll) {
+ if (is_message_forward(m) || m->content->get_type() !=
MessageContentType::Poll) {
return;
}
if (!has_unread_votes) {
@@ -5397,8 +5396,8 @@
void MessagesManager::cancel_dialog_action(DialogId dialog_id, const Message
*m) {
CHECK(m != nullptr);
- if (td_->auth_manager_->is_bot() || m->forward_info != nullptr ||
m->had_forward_info ||
- m->via_bot_user_id.is_valid() || m->hide_via_bot || m->is_channel_post
|| m->message_id.is_scheduled()) {
+ if (td_->auth_manager_->is_bot() || is_message_forward(m) ||
m->via_bot_user_id.is_valid() || m->hide_via_bot ||
+ m->is_channel_post || m->message_id.is_scheduled()) {
return;
}
@@ -5737,7 +5736,7 @@
update_used_hashtags(dialog_id, m);
if (!had_message && !td_->auth_manager_->is_bot()) {
- if ((m->reactions != nullptr && !m->reactions->unread_reactions_.empty())
|| d->unread_reaction_count > 0) {
+ if (has_unread_message_reactions(dialog_id, m) || d->unread_reaction_count
> 0) {
// if new message with unread reactions was added or the chat has unread
reactions,
// then number of unread reactions could have been changed, so reload
the number of unread reactions
repair_dialog_unread_reaction_count(d, Promise<Unit>(),
"on_message_edited");
@@ -7910,7 +7909,7 @@
bool MessagesManager::can_add_message_poll_option(DialogId dialog_id, const
Message *m) const {
if (td_->auth_manager_->is_bot() || m == nullptr ||
!m->message_id.is_server() ||
- m->content->get_type() != MessageContentType::Poll || m->forward_info !=
nullptr || m->had_forward_info ||
+ m->content->get_type() != MessageContentType::Poll ||
is_message_forward(m) ||
!td_->dialog_manager_->have_input_peer(dialog_id, false,
AccessRights::Read)) {
return false;
}
@@ -7926,10 +7925,7 @@
if (m == nullptr) {
return false;
}
- if (!m->message_id.is_server() || m->content->get_type() !=
MessageContentType::ToDoList) {
- return false;
- }
- if (m->forward_info != nullptr || m->had_forward_info) {
+ if (!m->message_id.is_server() || m->content->get_type() !=
MessageContentType::ToDoList || is_message_forward(m)) {
return false;
}
if (!m->is_outgoing && dialog_id != td_->dialog_manager_->get_my_dialog_id()
&&
@@ -7957,10 +7953,7 @@
if (m == nullptr) {
return false;
}
- if (!m->message_id.is_server() || m->content->get_type() !=
MessageContentType::ToDoList) {
- return false;
- }
- if (m->forward_info != nullptr || m->had_forward_info) {
+ if (!m->message_id.is_server() || m->content->get_type() !=
MessageContentType::ToDoList || is_message_forward(m)) {
return false;
}
if (!m->is_outgoing && dialog_id != td_->dialog_manager_->get_my_dialog_id()
&&
@@ -15141,10 +15134,10 @@
auto can_be_replied_in_another_chat =
can_reply_to_message_in_another_dialog(dialog_id, message_id, can_be_forwarded);
auto can_get_media_timestamp_links = can_get_media_timestamp_link(dialog_id,
m).is_ok();
auto can_get_link = can_get_media_timestamp_links && dialog_type ==
DialogType::Channel;
- get_message_content_poll_option_properties(
- td_, m->content.get(), option_id, dialog_id, message_id, can_be_replied,
can_be_replied_in_another_chat,
- can_get_link, m->forward_info != nullptr || m->had_forward_info,
- m->is_outgoing || dialog_id == td_->dialog_manager_->get_my_dialog_id(),
std::move(promise));
+ get_message_content_poll_option_properties(td_, m->content.get(), option_id,
dialog_id, message_id, can_be_replied,
+ can_be_replied_in_another_chat,
can_get_link, is_message_forward(m),
+ m->is_outgoing || dialog_id ==
td_->dialog_manager_->get_my_dialog_id(),
+ std::move(promise));
}
bool MessagesManager::is_message_edited_recently(MessageFullId
message_full_id, int32 seconds) {
@@ -20177,8 +20170,8 @@
const Message *m) const {
auto live_location_date = m->is_failed_to_send ? 0 : m->date;
return get_message_content_object(m->content.get(), td_, dialog_id,
m->message_id, m->is_outgoing,
- m->forward_info != nullptr ||
m->had_forward_info, get_message_sender(m),
- live_location_date, m->is_content_secret,
need_skip_bot_commands(dialog_id, m),
+ is_message_forward(m),
get_message_sender(m), live_location_date,
+ m->is_content_secret,
need_skip_bot_commands(dialog_id, m),
get_message_max_media_timestamp(m),
m->invert_media, m->disable_web_page_preview);
}
@@ -20783,8 +20776,12 @@
(d->notification_info != nullptr &&
message_id <=
d->notification_info->max_push_notification_message_id_)) {
// allow to reply to yet unreceived server message in the same chat
- return MessageInputReplyTo{message_id, DialogId(), MessageQuote{td_,
std::move(reply_to_message->quote_)},
- checklist_task_id,
reply_to_message->poll_option_id_};
+ return MessageInputReplyTo{message_id,
+ DialogId(),
+ MessageQuote{td_,
std::move(reply_to_message->quote_)},
+ checklist_task_id,
+ reply_to_message->poll_option_id_,
+ "create_message_input_reply_to 4"};
}
if (!for_draft && implicit_reply_to_message_id.is_valid()) {
return MessageInputReplyTo::regular(implicit_reply_to_message_id);
@@ -20822,8 +20819,12 @@
if (!reply_to_message->poll_option_id_.empty() && m->content->get_type()
!= MessageContentType::Poll) {
reply_to_message->poll_option_id_.clear();
}
- return MessageInputReplyTo{m->message_id, DialogId(), MessageQuote{td_,
std::move(reply_to_message->quote_)},
- checklist_task_id,
reply_to_message->poll_option_id_};
+ return MessageInputReplyTo{m->message_id,
+ DialogId(),
+ MessageQuote{td_,
std::move(reply_to_message->quote_)},
+ checklist_task_id,
+ reply_to_message->poll_option_id_,
+ "create_message_input_reply_to 5"};
}
case td_api::inputMessageReplyToExternalMessage::ID: {
auto reply_to_message =
td_api::move_object_as<td_api::inputMessageReplyToExternalMessage>(reply_to);
@@ -20850,8 +20851,12 @@
(m != nullptr && m->content->get_type() !=
MessageContentType::Poll)) {
reply_to_message->poll_option_id_.clear();
}
- return MessageInputReplyTo{m->message_id, reply_dialog_id,
MessageQuote{td_, std::move(reply_to_message->quote_)},
- checklist_task_id,
reply_to_message->poll_option_id_};
+ return MessageInputReplyTo{m->message_id,
+ reply_dialog_id,
+ MessageQuote{td_,
std::move(reply_to_message->quote_)},
+ checklist_task_id,
+ reply_to_message->poll_option_id_,
+ "create_message_input_reply_to 6"};
}
default:
UNREACHABLE();
@@ -20921,7 +20926,7 @@
}
void MessagesManager::cancel_upload_file(FileUploadId file_upload_id, const
char *source) {
- // send the request later so they doesn't interfere with other actions
+ // send the request later so they don't interfere with other actions
// for example merge, supposed to happen soon, can auto-cancel the upload
LOG(INFO) << "Cancel upload of " << file_upload_id << " from " << source;
send_closure_later(G()->file_manager(), &FileManager::cancel_upload,
file_upload_id);
@@ -22732,17 +22737,7 @@
if (m == nullptr) {
return false;
}
- if (m->message_id.is_yet_unsent()) {
- return false;
- }
- if (m->message_id.is_local()) {
- return false;
- }
- if (m->forward_info != nullptr || m->had_forward_info) {
- return false;
- }
-
- if (m->had_reply_markup) {
+ if (m->message_id.is_yet_unsent() || m->message_id.is_local() ||
is_message_forward(m) || m->had_reply_markup) {
return false;
}
if (m->reply_markup != nullptr && m->reply_markup->type !=
ReplyMarkup::Type::InlineKeyboard) {
@@ -22958,6 +22953,10 @@
return true;
}
+bool MessagesManager::is_message_forward(const Message *m) {
+ return m != nullptr && (m->forward_info != nullptr || m->had_forward_info);
+}
+
int32 MessagesManager::get_message_schedule_date(const Message *m) {
CHECK(m != nullptr);
if (!m->message_id.is_scheduled()) {
@@ -24424,7 +24423,7 @@
if (it != forwarded_message_id_to_new_message_id.end()) {
// keep replies in forwarded messages
input_reply_to =
forwarded_message->replied_message_info.get_message_input_reply_to();
- input_reply_to.set_message_id(it->second);
+ input_reply_to.set_message_id(it->second, "forward_messages");
}
}
if (add_offer) {
@@ -24907,68 +24906,17 @@
->send(dialog_id, random_id);
}
-void MessagesManager::share_dialogs_with_bot(const
td_api::object_ptr<td_api::KeyboardButtonSource> &source_ptr,
- int32 button_id, vector<DialogId>
shared_dialog_ids, bool expect_user,
- bool only_check, Promise<Unit>
&&promise) {
- if (source_ptr == nullptr) {
- return promise.set_error(400, "Source must be non-empty");
- }
- const RequestedDialogType *requested_dialog_type = nullptr;
- MessageFullId message_full_id;
- UserId bot_user_id;
- string request_id;
- switch (source_ptr->get_id()) {
- case td_api::keyboardButtonSourceMessage::ID: {
- const auto *source = static_cast<const
td_api::keyboardButtonSourceMessage *>(source_ptr.get());
- message_full_id = {DialogId(source->chat_id_),
MessageId(source->message_id_)};
- const Message *m = get_message_force(message_full_id,
"share_dialog_with_bot");
- if (m == nullptr) {
- return promise.set_error(400, "Message not found");
- }
- if (m->reply_markup == nullptr) {
- return promise.set_error(400, "Message has no buttons");
- }
- CHECK(m->message_id.is_server());
- requested_dialog_type =
m->reply_markup->get_requested_dialog_type(button_id);
- break;
- }
- case td_api::keyboardButtonSourceWebApp::ID: {
- const auto *source = static_cast<const
td_api::keyboardButtonSourceWebApp *>(source_ptr.get());
- bot_user_id = UserId(source->bot_user_id_);
- request_id = source->prepared_button_id_;
- requested_dialog_type =
td_->inline_queries_manager_->get_requested_dialog_type(bot_user_id,
request_id);
- break;
- }
- default:
- UNREACHABLE();
- }
- if (requested_dialog_type == nullptr) {
- return promise.set_error(400, "Button not found");
- }
- TRY_STATUS_PROMISE(promise,
requested_dialog_type->check_shared_dialog_count(shared_dialog_ids.size()));
-
- for (auto shared_dialog_id : shared_dialog_ids) {
- if (shared_dialog_id.get_type() != DialogType::User) {
- if (!have_dialog_force(shared_dialog_id, "share_dialogs_with_bot")) {
- return promise.set_error(400, "Shared chat not found");
- }
- } else {
- if (!expect_user) {
- return promise.set_error(400, "Wrong chat type");
- }
- if
(!td_->user_manager_->have_accessible_user(shared_dialog_id.get_user_id())) {
- return promise.set_error(400, "Shared user not found");
- }
- }
- TRY_STATUS_PROMISE(promise,
requested_dialog_type->check_shared_dialog(td_, shared_dialog_id));
+Result<const RequestedDialogType *>
MessagesManager::get_message_requested_dialog_type(MessageFullId
message_full_id,
+
int32 button_id) {
+ const Message *m = get_message_force(message_full_id,
"get_message_requested_dialog_type");
+ if (m == nullptr) {
+ return Status::Error(400, "Message not found");
}
-
- if (only_check) {
- return promise.set_value(Unit());
+ if (m->reply_markup == nullptr) {
+ return Status::Error(400, "Message has no buttons");
}
-
- td_->message_query_manager_->send_bot_requested_peer(message_full_id,
bot_user_id, request_id, button_id,
-
std::move(shared_dialog_ids), std::move(promise));
+ CHECK(m->message_id.is_server());
+ return m->reply_markup->get_requested_dialog_type(button_id);
}
void MessagesManager::process_suggested_post(MessageFullId message_full_id,
bool is_rejected, int32 schedule_date,
@@ -27274,7 +27222,7 @@
old_message_full_id)
<< old_message_full_id << ' ' << new_message_id << ' ' <<
replied_m->replied_message_info << ' '
<< *input_reply_to;
- update_message_reply_to_message_id(reply_d, replied_m, new_message_id,
true);
+ update_message_reply_to_message_id(reply_d, replied_m, new_message_id,
true, source);
} else {
set_message_reply(reply_d, replied_m, MessageInputReplyTo(), true);
}
@@ -29323,8 +29271,8 @@
return;
}
CHECK(m->message_id.is_yet_unsent());
- if (m->forward_info != nullptr || m->had_forward_info || m->is_copy ||
m->message_id.is_scheduled() ||
- m->sender_dialog_id.is_valid() || m->content->get_type() ==
MessageContentType::PaidMedia ||
+ if (is_message_forward(m) || m->is_copy || m->message_id.is_scheduled() ||
m->sender_dialog_id.is_valid() ||
+ m->content->get_type() == MessageContentType::PaidMedia ||
td_->dialog_manager_->is_broadcast_channel(dialog_id)) {
return;
}
@@ -32194,8 +32142,7 @@
return false;
}
if (old_message->message_id.is_yet_unsent() &&
- (old_message->forward_info != nullptr || old_message->had_forward_info ||
- old_message->real_forward_from_dialog_id.is_valid())) {
+ (is_message_forward(old_message) ||
old_message->real_forward_from_dialog_id.is_valid())) {
// original message may be edited
return false;
}
@@ -35091,8 +35038,7 @@
void MessagesManager::update_sent_message_contents(DialogId dialog_id, const
Message *m) {
CHECK(m != nullptr);
if (td_->auth_manager_->is_bot() || (!m->is_outgoing && dialog_id !=
td_->dialog_manager_->get_my_dialog_id()) ||
- dialog_id.get_type() == DialogType::SecretChat ||
m->message_id.is_local() || m->forward_info != nullptr ||
- m->had_forward_info) {
+ dialog_id.get_type() == DialogType::SecretChat ||
m->message_id.is_local() || is_message_forward(m)) {
return;
}
@@ -35103,7 +35049,7 @@
CHECK(m != nullptr);
if (td_->auth_manager_->is_bot() || (!m->is_outgoing && dialog_id !=
td_->dialog_manager_->get_my_dialog_id()) ||
m->via_bot_user_id.is_valid() || m->via_business_bot_user_id.is_valid()
|| m->hide_via_bot ||
- m->forward_info != nullptr || m->had_forward_info) {
+ is_message_forward(m)) {
return;
}
@@ -35119,7 +35065,7 @@
return;
}
- bool is_forward = m->forward_info != nullptr || m->had_forward_info;
+ bool is_forward = is_message_forward(m);
if (m->via_bot_user_id.is_valid() && !is_forward) {
// forwarded game messages can't be distinguished from sent via bot game
messages, so increase rating anyway
on_dialog_used(TopDialogCategory::BotInline, DialogId(m->via_bot_user_id),
m->date);
@@ -35262,7 +35208,7 @@
}
void MessagesManager::update_message_reply_to_message_id(const Dialog *d,
Message *m, MessageId reply_to_message_id,
- bool
is_message_in_dialog) {
+ bool
is_message_in_dialog, const char *source) {
LOG(INFO) << "Update identifier of replied message of " <<
MessageFullId{d->dialog_id, m->message_id} << " from "
<< m->replied_message_info << " to " << reply_to_message_id;
if (is_message_in_dialog) {
@@ -35270,7 +35216,7 @@
}
m->replied_message_info.set_message_id(reply_to_message_id);
if (!m->message_id.is_any_server()) {
- m->input_reply_to.set_message_id(reply_to_message_id);
+ m->input_reply_to.set_message_id(reply_to_message_id, source);
}
if (is_message_in_dialog) {
register_message_reply(d->dialog_id, m);
@@ -35294,7 +35240,7 @@
auto message_id = get_message_id_by_random_id(d, m->reply_to_random_id,
"restore_message_reply_to_message_id");
if ((message_id.is_valid() || message_id.is_valid_scheduled()) &&
!message_id.is_local()) {
- update_message_reply_to_message_id(d, m, message_id, false);
+ update_message_reply_to_message_id(d, m, message_id, false,
"restore_message_reply_to_message_id");
} else {
auto implicit_reply_to_message_id = get_message_topic(d->dialog_id,
m).get_implicit_reply_to_message_id(td_);
CHECK(implicit_reply_to_message_id == MessageId() ||
implicit_reply_to_message_id.is_server());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/MessagesManager.h
new/td-git20260425/td/telegram/MessagesManager.h
--- old/td-git20260414/td/telegram/MessagesManager.h 2026-04-16
00:40:10.787771704 +0200
+++ new/td-git20260425/td/telegram/MessagesManager.h 2026-05-07
22:36:23.206437765 +0200
@@ -123,6 +123,7 @@
class MessageForwardInfo;
struct MessageReactions;
class MissingInvitees;
+class RequestedDialogType;
class SuggestedPost;
class Td;
class Usernames;
@@ -478,9 +479,7 @@
void set_dialog_message_ttl(DialogId dialog_id, int32 ttl, Promise<Unit>
&&promise);
- void share_dialogs_with_bot(const
td_api::object_ptr<td_api::KeyboardButtonSource> &source_ptr, int32 button_id,
- vector<DialogId> shared_dialog_ids, bool
expect_user, bool only_check,
- Promise<Unit> &&promise);
+ Result<const RequestedDialogType *>
get_message_requested_dialog_type(MessageFullId message_full_id, int32
button_id);
void process_suggested_post(MessageFullId message_full_id, bool is_rejected,
int32 schedule_date,
const string &comment, Promise<Unit> &&promise);
@@ -1925,7 +1924,7 @@
void set_message_reply(const Dialog *d, Message *m, MessageInputReplyTo
input_reply_to, bool is_message_in_dialog);
void update_message_reply_to_message_id(const Dialog *d, Message *m,
MessageId reply_to_message_id,
- bool is_message_in_dialog);
+ bool is_message_in_dialog, const
char *source);
void restore_message_reply_to_message_id(Dialog *d, Message *m);
@@ -3136,6 +3135,8 @@
bool is_deleted_secret_chat(const Dialog *d) const;
+ static bool is_message_forward(const Message *m);
+
static int32 get_message_schedule_date(const Message *m);
static int32 get_message_schedule_repeat_period(const Message *m);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/PollManager.cpp
new/td-git20260425/td/telegram/PollManager.cpp
--- old/td-git20260414/td/telegram/PollManager.cpp 2026-04-16
00:40:10.789771623 +0200
+++ new/td-git20260425/td/telegram/PollManager.cpp 2026-05-07
22:36:23.208437712 +0200
@@ -702,6 +702,7 @@
// hide the voter counts
for (auto &poll_option : poll_options) {
poll_option->voter_count_ = 0;
+ poll_option->recent_voter_ids_.clear();
}
} else {
// calculate vote percentage and fix total_voter_count
@@ -803,14 +804,10 @@
has_open_answers = false;
}
keep_only_custom_emoji(question);
- for (auto &option : options) {
- keep_only_custom_emoji(option);
- }
auto poll = make_unique<Poll>();
poll->question_ = std::move(question);
- int pos = 0;
for (auto &option_text : options) {
- poll->options_.emplace_back(std::move(option_text), nullptr, pos++);
+ poll->options_.emplace_back(std::move(option_text), nullptr);
}
poll->is_anonymous_ = is_anonymous;
poll->allow_multiple_answers_ = allow_multiple_answers;
@@ -1023,6 +1020,9 @@
}
}
if (option == nullptr) {
+ if (option_id.empty()) {
+ return
promise.set_value(td_api::make_object<td_api::pollOptionProperties>(false,
false, false, false));
+ }
return promise.set_error(400, "Poll option not found");
}
bool can_be_deleted = can_delete_poll_option(poll, option, message_id,
is_forward, is_outgoing);
@@ -1112,7 +1112,7 @@
if (index >= poll->options_.size()) {
return promise.set_error(400, "Invalid option identifier specified");
}
- options.push_back(poll->options_[index].data_);
+ options.push_back(poll->options_[index].get_data());
affected_option_ids[index + 1]++;
}
@@ -1444,7 +1444,7 @@
std::move(result));
});
td_->create_handler<GetPollVotersQuery>(std::move(query_promise))
- ->send(poll_id, message_full_id,
BufferSlice(poll->options_[option_id].data_), voters.next_offset_,
+ ->send(poll_id, message_full_id,
BufferSlice(poll->options_[option_id].get_data()), voters.next_offset_,
max(limit, 10));
}
@@ -1497,7 +1497,7 @@
switch (peer_vote->get_id()) {
case telegram_api::messagePeerVote::ID: {
auto voter =
telegram_api::move_object_as<telegram_api::messagePeerVote>(peer_vote);
- if (voter->option_ != poll->options_[option_id].data_) {
+ if (voter->option_ != poll->options_[option_id].get_data()) {
continue;
}
@@ -1513,7 +1513,7 @@
}
case telegram_api::messagePeerVoteMultiple::ID: {
auto voter =
telegram_api::move_object_as<telegram_api::messagePeerVoteMultiple>(peer_vote);
- if (!td::contains(voter->options_, poll->options_[option_id].data_)) {
+ if (!td::contains(voter->options_,
poll->options_[option_id].get_data())) {
continue;
}
@@ -1944,14 +1944,14 @@
vector<string> correct_option_datas;
for (auto correct_option_id : poll->correct_option_ids_) {
CHECK(0 <= correct_option_id && correct_option_id <
static_cast<int32>(poll->options_.size()));
-
correct_option_datas.push_back(poll->options_[correct_option_id].data_);
+
correct_option_datas.push_back(poll->options_[correct_option_id].get_data());
}
poll->options_ = std::move(options);
poll->option_min_channels_ = std::move(option_min_channels);
if (!correct_option_datas.empty()) { // repair correct_option_ids just
in case
poll->correct_option_ids_.clear();
for (size_t i = 0; i < poll->options_.size(); i++) {
- if (td::contains(correct_option_datas, poll->options_[i].data_)) {
+ if (td::contains(correct_option_datas,
poll->options_[i].get_data())) {
poll->correct_option_ids_.push_back(static_cast<int32>(i));
}
}
@@ -2078,7 +2078,7 @@
Slice data = poll_result->option_.as_slice();
for (size_t option_index = 0; option_index < poll->options_.size();
option_index++) {
auto &option = poll->options_[option_index];
- if (option.data_ != data) {
+ if (option.get_data() != data) {
continue;
}
if (!is_min) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/PollOption.cpp
new/td-git20260425/td/telegram/PollOption.cpp
--- old/td-git20260414/td/telegram/PollOption.cpp 2026-04-16
00:40:10.789771623 +0200
+++ new/td-git20260425/td/telegram/PollOption.cpp 2026-05-07
22:36:23.209437687 +0200
@@ -16,14 +16,9 @@
namespace td {
-PollOption::PollOption(FormattedText &&text, unique_ptr<MessageContent>
&&media, int32 pos)
+PollOption::PollOption(FormattedText &&text, unique_ptr<MessageContent>
&&media)
: text_(std::move(text)), media_(std::move(media)) {
- if (pos < 10) {
- data_ = string(1, static_cast<char>(pos + '0'));
- } else {
- data_ = string(2, static_cast<char>(pos - 10 + '0'));
- data_[0] = static_cast<char>('0' + pos / 10);
- }
+ keep_only_custom_emoji(text_);
}
PollOption::PollOption(Td *td,
telegram_api::object_ptr<telegram_api::PollAnswer> &&poll_answer_ptr,
@@ -33,7 +28,7 @@
return;
}
auto poll_answer =
telegram_api::move_object_as<telegram_api::pollAnswer>(poll_answer_ptr);
- text_ = get_formatted_text(nullptr, std::move(poll_answer->text_), true,
true, "get_poll_answers");
+ text_ = get_formatted_text(nullptr, std::move(poll_answer->text_), true,
true, "PollOption");
keep_only_custom_emoji(text_);
if (poll_answer->media_ != nullptr) {
media_ = get_message_content(td, FormattedText(),
std::move(poll_answer->media_), DialogId(), 0, false, UserId(),
@@ -55,6 +50,14 @@
}
}
+PollOption PollOption::dup_option(Td *td, DialogId dialog_id) const {
+ PollOption result;
+ result.text_ = text_;
+ remove_unallowed_entities(td, result.text_, dialog_id);
+ result.media_ = dup_message_content(td, dialog_id, media_.get(),
MessageContentDupType::Copy, MessageCopyOptions());
+ return result;
+}
+
void PollOption::append_file_ids(const Td *td, vector<FileId> &file_ids) const
{
if (media_ != nullptr) {
append(file_ids, get_message_content_file_ids(media_.get(), td));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/PollOption.h
new/td-git20260425/td/telegram/PollOption.h
--- old/td-git20260414/td/telegram/PollOption.h 2026-04-16 00:40:10.789771623
+0200
+++ new/td-git20260425/td/telegram/PollOption.h 2026-05-07 22:36:23.209437687
+0200
@@ -28,16 +28,17 @@
struct PollOption {
FormattedText text_;
unique_ptr<MessageContent> media_;
- string data_;
DialogId added_by_dialog_id_;
vector<DialogId> recent_voter_dialog_ids_;
int32 added_date_ = 0;
int32 voter_count_ = 0;
bool is_chosen_ = false;
+ friend bool operator==(const PollOption &lhs, const PollOption &rhs);
+
PollOption() = default;
- PollOption(FormattedText &&text, unique_ptr<MessageContent> &&media, int32
pos);
+ PollOption(FormattedText &&text, unique_ptr<MessageContent> &&media);
PollOption(Td *td, telegram_api::object_ptr<telegram_api::PollAnswer>
&&poll_answer_ptr,
vector<std::pair<ChannelId, MinChannel>> &min_channels);
@@ -54,6 +55,8 @@
return added_date_;
}
+ PollOption dup_option(Td *td, DialogId dialog_id) const;
+
void append_file_ids(const Td *td, vector<FileId> &file_ids) const;
td_api::object_ptr<td_api::pollOption> get_poll_option_object(Td *td) const;
@@ -71,6 +74,9 @@
template <class ParserT>
void parse(ParserT &parser);
+
+ private:
+ string data_;
};
bool operator==(const PollOption &lhs, const PollOption &rhs);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/PollOption.hpp
new/td-git20260425/td/telegram/PollOption.hpp
--- old/td-git20260414/td/telegram/PollOption.hpp 2026-04-16
00:40:10.789771623 +0200
+++ new/td-git20260425/td/telegram/PollOption.hpp 2026-05-07
22:36:23.209437687 +0200
@@ -22,6 +22,8 @@
bool has_added_date = added_date_ != 0;
bool has_recent_voter_dialog_ids = !recent_voter_dialog_ids_.empty();
bool has_media = media_ != nullptr;
+ bool has_no_voter_count = voter_count_ == 0;
+ bool has_no_data = data_.empty();
BEGIN_STORE_FLAGS();
STORE_FLAG(is_chosen_);
STORE_FLAG(has_entities);
@@ -29,11 +31,17 @@
STORE_FLAG(has_added_date);
STORE_FLAG(has_recent_voter_dialog_ids);
STORE_FLAG(has_media);
+ STORE_FLAG(has_no_voter_count);
+ STORE_FLAG(has_no_data);
END_STORE_FLAGS();
store(text_.text, storer);
- store(data_, storer);
- store(voter_count_, storer);
+ if (!has_no_data) {
+ store(data_, storer);
+ }
+ if (!has_no_voter_count) {
+ store(voter_count_, storer);
+ }
if (has_entities) {
store(text_.entities, storer);
}
@@ -59,6 +67,8 @@
bool has_added_date;
bool has_recent_voter_dialog_ids;
bool has_media;
+ bool has_no_voter_count;
+ bool has_no_data;
BEGIN_PARSE_FLAGS();
PARSE_FLAG(is_chosen_);
PARSE_FLAG(has_entities);
@@ -66,11 +76,17 @@
PARSE_FLAG(has_added_date);
PARSE_FLAG(has_recent_voter_dialog_ids);
PARSE_FLAG(has_media);
+ PARSE_FLAG(has_no_voter_count);
+ PARSE_FLAG(has_no_data);
END_PARSE_FLAGS();
parse(text_.text, parser);
- parse(data_, parser);
- parse(voter_count_, parser);
+ if (!has_no_data) {
+ parse(data_, parser);
+ }
+ if (!has_no_voter_count) {
+ parse(voter_count_, parser);
+ }
if (has_entities) {
parse(text_.entities, parser);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/RepliedMessageInfo.cpp
new/td-git20260425/td/telegram/RepliedMessageInfo.cpp
--- old/td-git20260414/td/telegram/RepliedMessageInfo.cpp 2026-04-16
00:40:10.791771542 +0200
+++ new/td-git20260425/td/telegram/RepliedMessageInfo.cpp 2026-05-07
22:36:23.210437660 +0200
@@ -367,7 +367,8 @@
MessageInputReplyTo RepliedMessageInfo::get_message_input_reply_to() const {
CHECK(!is_external());
if (message_id_.is_valid() || message_id_.is_valid_scheduled()) {
- return MessageInputReplyTo(message_id_, dialog_id_, quote_.clone(true),
todo_item_id_, poll_option_id_);
+ return MessageInputReplyTo(message_id_, dialog_id_, quote_.clone(true),
todo_item_id_, poll_option_id_,
+ "RepliedMessageInfo");
}
return {};
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/Requests.cpp
new/td-git20260425/td/telegram/Requests.cpp
--- old/td-git20260414/td/telegram/Requests.cpp 2026-04-16 00:40:10.792771502
+0200
+++ new/td-git20260425/td/telegram/Requests.cpp 2026-05-07 22:36:23.211437634
+0200
@@ -7866,16 +7866,16 @@
CHECK_IS_USER();
CREATE_OK_REQUEST_PROMISE();
auto dialog_ids =
DialogId::get_dialog_ids(UserId::get_user_ids(request.shared_user_ids_));
- td_->messages_manager_->share_dialogs_with_bot(request.source_,
request.button_id_, std::move(dialog_ids), true,
- request.only_check_,
std::move(promise));
+ td_->message_query_manager_->share_dialogs_with_bot(request.source_,
request.button_id_, std::move(dialog_ids), true,
+ request.only_check_,
std::move(promise));
}
void Requests::on_request(uint64 id, const td_api::shareChatWithBot &request) {
CHECK_IS_USER();
CREATE_OK_REQUEST_PROMISE();
- td_->messages_manager_->share_dialogs_with_bot(request.source_,
request.button_id_,
-
{DialogId(request.shared_chat_id_)}, false, request.only_check_,
- std::move(promise));
+ td_->message_query_manager_->share_dialogs_with_bot(request.source_,
request.button_id_,
+
{DialogId(request.shared_chat_id_)}, false, request.only_check_,
+ std::move(promise));
}
void Requests::on_request(uint64 id, td_api::getInlineQueryResults &request) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/SavedMessagesManager.cpp
new/td-git20260425/td/telegram/SavedMessagesManager.cpp
--- old/td-git20260414/td/telegram/SavedMessagesManager.cpp 2026-04-16
00:40:10.792771502 +0200
+++ new/td-git20260425/td/telegram/SavedMessagesManager.cpp 2026-05-07
22:36:23.212437608 +0200
@@ -1307,7 +1307,7 @@
return;
}
if (topic->dialog_id_ != dialog_id) {
- LOG(ERROR) << "Save Messages must not have unread reactions";
+ LOG(ERROR) << "Saves Messages must not have unread reactions";
return;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/StickersManager.cpp
new/td-git20260425/td/telegram/StickersManager.cpp
--- old/td-git20260414/td/telegram/StickersManager.cpp 2026-04-16
00:40:10.796771340 +0200
+++ new/td-git20260425/td/telegram/StickersManager.cpp 2026-05-07
22:36:23.215437530 +0200
@@ -789,7 +789,7 @@
}
void on_error(Status status) final {
- td_->stickers_manager_->on_get_sticker_set_name(sticker_set_id_, nullptr);
+ td_->stickers_manager_->on_get_sticker_set_name(sticker_set_id_,
std::move(status));
}
};
@@ -4000,13 +4000,19 @@
}
}
-void StickersManager::on_get_sticker_set_name(StickerSetId sticker_set_id,
-
telegram_api::object_ptr<telegram_api::messages_StickerSet> &&set_ptr) {
+void StickersManager::on_get_sticker_set_name(
+ StickerSetId sticker_set_id,
Result<telegram_api::object_ptr<telegram_api::messages_StickerSet>>
&&r_set_ptr) {
auto it = sticker_set_name_load_queries_.find(sticker_set_id);
CHECK(it != sticker_set_name_load_queries_.end());
auto promises = std::move(it->second);
sticker_set_name_load_queries_.erase(it);
- if (set_ptr == nullptr || set_ptr->get_id() !=
telegram_api::messages_stickerSet::ID) {
+ if (r_set_ptr.is_error()) {
+ return fail_promises(promises, r_set_ptr.move_as_error());
+ }
+ auto set_ptr = r_set_ptr.move_as_ok();
+ CHECK(set_ptr != nullptr);
+ if (set_ptr->get_id() != telegram_api::messages_stickerSet::ID) {
+ LOG(ERROR) << "Expected " << sticker_set_id << ", but receive " <<
to_string(set_ptr);
return fail_promises(promises, Status::Error(500, "Failed to get sticker
set name"));
}
auto set =
telegram_api::move_object_as<telegram_api::messages_stickerSet>(set_ptr);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/td/telegram/StickersManager.h
new/td-git20260425/td/telegram/StickersManager.h
--- old/td-git20260414/td/telegram/StickersManager.h 2026-04-16
00:40:10.796771340 +0200
+++ new/td-git20260425/td/telegram/StickersManager.h 2026-05-07
22:36:23.215437530 +0200
@@ -246,7 +246,7 @@
const char *source);
void on_get_sticker_set_name(StickerSetId sticker_set_id,
-
telegram_api::object_ptr<telegram_api::messages_StickerSet> &&set_ptr);
+
Result<telegram_api::object_ptr<telegram_api::messages_StickerSet>>
&&r_set_ptr);
void on_get_special_sticker_set(const SpecialStickerSetType &type,
StickerSetId sticker_set_id);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/td-git20260414/test/mtproto.cpp
new/td-git20260425/test/mtproto.cpp
--- old/td-git20260414/test/mtproto.cpp 2026-04-16 00:40:10.819868922 +0200
+++ new/td-git20260425/test/mtproto.cpp 2026-05-07 22:36:23.236202301 +0200
@@ -147,38 +147,37 @@
{
auto guard = sched.get_main_guard();
- auto run = [&](auto &func, bool is_test) {
- auto promise =
- td::PromiseCreator::lambda([&, num =
cnt](td::Result<td::SimpleConfigResult> r_simple_config_result) {
- if (r_simple_config_result.is_ok()) {
- auto simple_config_result = r_simple_config_result.move_as_ok();
- auto date = simple_config_result.r_http_date.is_ok()
- ?
td::to_string(simple_config_result.r_http_date.ok())
- : (PSTRING() <<
simple_config_result.r_http_date.error());
- auto config = simple_config_result.r_config.is_ok()
- ? to_string(simple_config_result.r_config.ok())
- : (PSTRING() <<
simple_config_result.r_config.error());
- LOG(ERROR) << num << " " << date << " " << config;
- } else {
- LOG(ERROR) << num << " " << r_simple_config_result.error();
- }
- if (--cnt == 0) {
- td::Scheduler::instance()->finish();
- }
- });
+ auto run = [&](auto &func, td::Slice name) {
+ auto is_test = td::ends_with(name, "test");
+ auto promise = td::PromiseCreator::lambda([&,
name](td::Result<td::SimpleConfigResult> r_simple_config_result) {
+ if (r_simple_config_result.is_ok()) {
+ auto simple_config_result = r_simple_config_result.move_as_ok();
+ auto date = simple_config_result.r_http_date.is_ok()
+ ?
td::to_string(simple_config_result.r_http_date.ok())
+ : (PSTRING() <<
simple_config_result.r_http_date.error());
+ auto config = simple_config_result.r_config.is_ok() ?
to_string(simple_config_result.r_config.ok())
+ : (PSTRING() <<
simple_config_result.r_config.error());
+ LOG(ERROR) << name << ' ' << date << ' ' << config;
+ } else {
+ LOG(ERROR) << name << ' ' << r_simple_config_result.error();
+ }
+ if (--cnt == 0) {
+ td::Scheduler::instance()->finish();
+ }
+ });
cnt++;
func(std::move(promise), false, td::Slice(), is_test, -1).release();
};
- run(td::get_simple_config_azure, false);
- run(td::get_simple_config_google_dns, false);
- run(td::get_simple_config_mozilla_dns, false);
- run(td::get_simple_config_azure, true);
- run(td::get_simple_config_google_dns, true);
- run(td::get_simple_config_mozilla_dns, true);
- run(td::get_simple_config_firebase_remote_config, false);
- run(td::get_simple_config_firebase_realtime, false);
- run(td::get_simple_config_firebase_firestore, false);
+ run(td::get_simple_config_azure, "azure");
+ run(td::get_simple_config_google_dns, "Google DNS");
+ run(td::get_simple_config_mozilla_dns, "Mozilla DNS");
+ run(td::get_simple_config_azure, "azure test");
+ run(td::get_simple_config_google_dns, "Google DNS test");
+ run(td::get_simple_config_mozilla_dns, "Mozilla DNS test");
+ run(td::get_simple_config_firebase_remote_config, "remote config");
+ run(td::get_simple_config_firebase_realtime, "realtime");
+ run(td::get_simple_config_firebase_firestore, "firestore");
}
cnt--;
if (cnt != 0) {
++++++ tdesktop-6.7.8-full.tar.gz -> tdesktop-6.8.0-full.tar.gz ++++++
/work/SRC/openSUSE:Factory/telegram-desktop/tdesktop-6.7.8-full.tar.gz
/work/SRC/openSUSE:Factory/.telegram-desktop.new.1966/tdesktop-6.8.0-full.tar.gz
differ: char 5, line 1