mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Ungroup all feed channels from context menu.
This commit is contained in:
@@ -76,6 +76,7 @@ private:
|
||||
void addInfo();
|
||||
void addSearch();
|
||||
void addNotifications();
|
||||
void addUngroup();
|
||||
|
||||
not_null<Controller*> _controller;
|
||||
not_null<Data::Feed*> _feed;
|
||||
@@ -423,6 +424,7 @@ void FeedFiller::fill() {
|
||||
if (_source == PeerMenuSource::ChatsList) {
|
||||
addSearch();
|
||||
}
|
||||
addUngroup();
|
||||
}
|
||||
|
||||
bool FeedFiller::showInfo() {
|
||||
@@ -477,6 +479,13 @@ void FeedFiller::addSearch() {
|
||||
});
|
||||
}
|
||||
|
||||
void FeedFiller::addUngroup() {
|
||||
const auto feed = _feed;
|
||||
_addAction(lang(lng_feed_ungroup_all), [=] {
|
||||
PeerMenuUngroupFeed(feed);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void PeerMenuDeleteContact(not_null<UserData*> user) {
|
||||
@@ -647,6 +656,13 @@ void PeerMenuAddMuteAction(
|
||||
Ui::AttachAsChild(muteAction, std::move(lifetime));
|
||||
}
|
||||
|
||||
void PeerMenuUngroupFeed(not_null<Data::Feed*> feed) {
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
lang(lng_feed_sure_ungroup_all),
|
||||
lang(lng_feed_ungroup_sure),
|
||||
[=] { Ui::hideLayer(); Auth().api().ungroupAllFromFeed(feed); }));
|
||||
}
|
||||
|
||||
void ToggleChannelGrouping(not_null<ChannelData*> channel, bool group) {
|
||||
const auto callback = [=] {
|
||||
Ui::Toast::Show(lang(group
|
||||
|
Reference in New Issue
Block a user