fix: don't select filtered messages

This commit is contained in:
AlexeyZavar 2024-04-19 01:45:11 +03:00
parent b6c966f18b
commit 3f79ccbcaf
2 changed files with 13 additions and 1 deletions

View file

@ -90,7 +90,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
// AyuGram includes
#include "ayu/ui/context_menu/context_menu.h"
#include "styles/style_ayu_icons.h"
#include "ayu/utils/telegram_helpers.h"
namespace {
@ -4157,6 +4157,10 @@ bool HistoryInner::goodForSelection(
not_null<SelectedItems*> toItems,
not_null<HistoryItem*> item,
int &totalCount) const {
if (isMessageHidden(item)) {
return false;
}
if (!item->isRegular() || item->isService()) {
return false;
} else if (toItems->find(item) == toItems->end()) {

View file

@ -74,6 +74,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtWidgets/QApplication>
#include <QtCore/QMimeData>
// AyuGram includes
#include "ayu/utils/telegram_helpers.h"
namespace HistoryView {
namespace {
@ -1187,6 +1191,10 @@ bool ListWidget::isGoodForSelection(
bool ListWidget::addToSelection(
SelectedMap &applyTo,
not_null<HistoryItem*> item) const {
if (isMessageHidden(item)) {
return false;
}
const auto itemId = item->fullId();
auto [iterator, ok] = applyTo.try_emplace(
itemId,