Update layer 119.

GitOrigin-RevId: 5a357984b79e16c155b209ab4cfc146a137519c9
This commit is contained in:
levlam 2020-09-16 15:42:39 +03:00
parent 33f315cfbb
commit 2b5b6386fc
4 changed files with 34 additions and 14 deletions

View File

@ -1149,11 +1149,11 @@ help.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.Count
messageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;
messages.messageViews#2c3f2ae2 views:Vector<MessageViews> users:Vector<User> = messages.MessageViews;
messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
messages.discussionMessage#d25fad90 message:Message read_max_id:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
messages.discussionMessage#6d64690e flags:# messages:Vector<Message> max_id:flags.0?int read_max_id:flags.1?int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;
messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
@ -1467,7 +1467,7 @@ channels.joinChannel#24b524c5 channel:InputChannel = Updates;
channels.leaveChannel#f836aa95 channel:InputChannel = Updates;
channels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates;
channels.deleteChannel#c0111fe3 channel:InputChannel = Updates;
channels.exportMessageLink#ceb77163 channel:InputChannel id:int grouped:Bool = ExportedMessageLink;
channels.exportMessageLink#e63fadeb flags:# grouped:flags.0?true thread:flags.1?true channel:InputChannel id:int = ExportedMessageLink;
channels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;
channels.getAdminedPublicChannels#f8b036af flags:# by_location:flags.0?true check_limit:flags.1?true = messages.Chats;
channels.editBanned#72796912 channel:InputChannel user_id:InputUser banned_rights:ChatBannedRights = Updates;

Binary file not shown.

View File

@ -399,7 +399,8 @@ class GetDialogUnreadMarksQuery : public Td::ResultHandler {
class GetDiscussionMessageQuery : public Td::ResultHandler {
public:
struct Result {
FullMessageId full_message_id;
vector<FullMessageId> full_message_ids;
MessageId max_message_id;
MessageId max_read_message_id;
};
@ -432,9 +433,19 @@ class GetDiscussionMessageQuery : public Td::ResultHandler {
td->contacts_manager_->on_get_users(std::move(ptr->users_), "GetDiscussionMessageQuery");
td->contacts_manager_->on_get_chats(std::move(ptr->chats_), "GetDiscussionMessageQuery");
Result result;
result.full_message_id = td->messages_manager_->on_get_message(std::move(ptr->message_), false, true, false, false,
false, "GetDiscussionMessageQuery");
result.max_read_message_id = MessageId(ServerMessageId(ptr->read_max_id_));
for (auto &message : ptr->messages_) {
auto full_message_id = td->messages_manager_->on_get_message(std::move(message), false, true, false, false, false,
"GetDiscussionMessageQuery");
if (full_message_id.get_message_id().is_valid()) {
result.full_message_ids.push_back(full_message_id);
}
}
if ((ptr->flags_ & telegram_api::messages_discussionMessage::MAX_ID_MASK) != 0) {
result.max_message_id = MessageId(ServerMessageId(ptr->max_id_));
}
if ((ptr->flags_ & telegram_api::messages_discussionMessage::READ_MAX_ID_MASK) != 0) {
result.max_read_message_id = MessageId(ServerMessageId(ptr->read_max_id_));
}
promise_.set_value(std::move(result));
}
@ -640,8 +651,13 @@ class ExportChannelMessageLinkQuery : public Td::ResultHandler {
ignore_result_ = ignore_result;
auto input_channel = td->contacts_manager_->get_input_channel(channel_id);
CHECK(input_channel != nullptr);
send_query(G()->net_query_creator().create(telegram_api::channels_exportMessageLink(
std::move(input_channel), message_id.get_server_message_id().get(), for_group)));
int32 flags = 0;
if (for_group) {
flags |= telegram_api::channels_exportMessageLink::GROUPED_MASK;
}
send_query(G()->net_query_creator().create(
telegram_api::channels_exportMessageLink(flags, false /*ignored*/, false /*ignored*/, std::move(input_channel),
message_id.get_server_message_id().get())));
}
void on_result(uint64 id, BufferSlice packet) override {
@ -1344,6 +1360,7 @@ class GetMessagesViewsQuery : public Td::ResultHandler {
return on_error(id, Status::Error(500, "Wrong number of message views returned"));
}
td->contacts_manager_->on_get_users(std::move(result->users_), "GetMessagesViewsQuery");
td->contacts_manager_->on_get_chats(std::move(result->chats_), "GetMessagesViewsQuery");
for (size_t i = 0; i < message_ids_.size(); i++) {
FullMessageId full_message_id{dialog_id_, message_ids_[i]};
@ -15543,7 +15560,8 @@ FullMessageId MessagesManager::get_discussion_message(DialogId dialog_id, Messag
return promise.set_error(result.move_as_error());
}
send_closure(actor_id, &MessagesManager::on_get_discussion_message, dialog_id, message_id,
result.ok().full_message_id, result.ok().max_read_message_id, std::move(promise));
std::move(result.ok_ref().full_message_ids), result.ok().max_message_id,
result.ok().max_read_message_id, std::move(promise));
});
td_->create_handler<GetDiscussionMessageQuery>(std::move(query_promise))->send(dialog_id, message_id);
@ -15551,7 +15569,8 @@ FullMessageId MessagesManager::get_discussion_message(DialogId dialog_id, Messag
return FullMessageId();
}
void MessagesManager::on_get_discussion_message(DialogId dialog_id, MessageId message_id, FullMessageId full_message_id,
void MessagesManager::on_get_discussion_message(DialogId dialog_id, MessageId message_id,
vector<FullMessageId> full_message_ids, MessageId max_message_id,
MessageId max_read_message_id, Promise<Unit> &&promise) {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
@ -15571,9 +15590,10 @@ void MessagesManager::on_get_discussion_message(DialogId dialog_id, MessageId me
return promise.set_value(Unit());
}
if (!full_message_id.get_message_id().is_valid()) {
if (full_message_ids.empty()) {
return promise.set_value(Unit());
}
auto full_message_id = full_message_ids.back();
if (full_message_id.get_dialog_id() != DialogId(m->reply_info.channel_id)) {
return promise.set_error(Status::Error(500, "Expected message in a different chat"));
}

View File

@ -556,8 +556,8 @@ class MessagesManager : public Actor {
FullMessageId get_discussion_message(DialogId dialog_id, MessageId message_id, bool force, Promise<Unit> &&promise);
void on_get_discussion_message(DialogId dialog_id, MessageId message_id, FullMessageId full_message_id,
MessageId max_read_message_id, Promise<Unit> &&promise);
void on_get_discussion_message(DialogId dialog_id, MessageId message_id, vector<FullMessageId> full_message_ids,
MessageId max_message_id, MessageId max_read_message_id, Promise<Unit> &&promise);
MessageId get_dialog_pinned_message(DialogId dialog_id, Promise<Unit> &&promise);