2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Ungroup all feed channels from context menu.

This commit is contained in:
John Preston
2018-02-18 17:00:14 +03:00
parent f8c2f339a0
commit 74aa1ad71e
5 changed files with 34 additions and 0 deletions

View File

@@ -203,6 +203,19 @@ void ApiWrap::toggleChannelGrouping(
_channelGroupingRequests.emplace(channel, requestId, callback);
}
void ApiWrap::ungroupAllFromFeed(not_null<Data::Feed*> feed) {
const auto flags = MTPchannels_SetFeedBroadcasts::Flag::f_channels
| MTPchannels_SetFeedBroadcasts::Flag::f_also_newly_joined;
request(MTPchannels_SetFeedBroadcasts(
MTP_flags(flags),
MTP_int(feed->id()),
MTP_vector<MTPInputChannel>(0),
MTP_bool(false)
)).done([=](const MTPUpdates &result) {
applyUpdates(result);
}).send();
}
void ApiWrap::sendMessageFail(const RPCError &error) {
if (error.type() == qstr("PEER_FLOOD")) {
Ui::show(Box<InformBox>(