mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Implement complex filter delete from context menu.
This commit is contained in:
@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_chat_filters.h"
|
||||
#include "data/data_peer.h"
|
||||
#include "data/data_session.h"
|
||||
#include "history/history.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "main/main_session.h"
|
||||
#include "settings/settings_common.h"
|
||||
@@ -828,4 +829,15 @@ void ProcessFilterRemove(
|
||||
Box<PeerListBox>(std::move(controller), std::move(initBox)));
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<not_null<PeerData*>> ExtractSuggestRemoving(
|
||||
const Data::ChatFilter &filter) {
|
||||
if (!filter.chatlist()) {
|
||||
return {};
|
||||
}
|
||||
return filter.always() | ranges::views::filter([](
|
||||
not_null<History*> history) {
|
||||
return history->peer->isChannel();
|
||||
}) | ranges::views::transform(&History::peer) | ranges::to_vector;
|
||||
}
|
||||
|
||||
} // namespace Api
|
||||
|
@@ -15,6 +15,10 @@ namespace Window {
|
||||
class SessionController;
|
||||
} // namespace Window
|
||||
|
||||
namespace Data {
|
||||
class ChatFilter;
|
||||
} // namespace Data
|
||||
|
||||
namespace Api {
|
||||
|
||||
void SaveNewFilterPinned(
|
||||
@@ -38,4 +42,7 @@ void ProcessFilterRemove(
|
||||
std::vector<not_null<PeerData*>> suggest,
|
||||
Fn<void(std::vector<not_null<PeerData*>>)> done);
|
||||
|
||||
[[nodiscard]] std::vector<not_null<PeerData*>> ExtractSuggestRemoving(
|
||||
const Data::ChatFilter &filter);
|
||||
|
||||
} // namespace Api
|
||||
|
Reference in New Issue
Block a user