Added chats filters list to each exception row in edit chats filter box.

This commit is contained in:
23rd 2024-11-23 10:27:28 +03:00
parent 23e22650f9
commit 3e49b45418

View file

@ -7,7 +7,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "boxes/filters/edit_filter_chats_list.h"
#include "data/data_chat_filters.h"
#include "data/data_premium_limits.h"
#include "data/data_session.h"
#include "history/history.h"
#include "window/window_session_controller.h"
#include "lang/lang_keys.h"
@ -125,7 +127,15 @@ Flag TypeRow::flag() const {
}
ExceptionRow::ExceptionRow(not_null<History*> history) : Row(history) {
if (peer()->isSelf()) {
auto filters = QStringList();
for (const auto &filter : history->owner().chatsFilters().list()) {
if (filter.contains(history) && filter.id()) {
filters << filter.title();
}
}
if (!filters.isEmpty()) {
setCustomStatus(filters.join(", "));
} else if (peer()->isSelf()) {
setCustomStatus(tr::lng_saved_forward_here(tr::now));
}
}