mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Support cloud view_as_messages forum setting.
This commit is contained in:
@@ -4545,6 +4545,25 @@ void Session::applyStatsDcId(
|
||||
}
|
||||
}
|
||||
|
||||
void Session::saveViewAsMessages(
|
||||
not_null<Forum*> forum,
|
||||
bool viewAsMessages) {
|
||||
const auto channel = forum->channel();
|
||||
if (const auto requestId = _viewAsMessagesRequests.take(channel)) {
|
||||
_session->api().request(*requestId).cancel();
|
||||
}
|
||||
_viewAsMessagesRequests[channel] = _session->api().request(
|
||||
MTPchannels_ToggleViewForumAsMessages(
|
||||
channel->inputChannel,
|
||||
MTP_bool(viewAsMessages))
|
||||
).done([=] {
|
||||
_viewAsMessagesRequests.remove(channel);
|
||||
}).fail([=] {
|
||||
_viewAsMessagesRequests.remove(channel);
|
||||
}).send();
|
||||
channel->setViewAsMessagesFlag(viewAsMessages);
|
||||
}
|
||||
|
||||
void Session::webViewResultSent(WebViewResultSent &&sent) {
|
||||
return _webViewResultSent.fire(std::move(sent));
|
||||
}
|
||||
|
Reference in New Issue
Block a user