From 02f48a778117906a41646fa5df569630b4311f7e Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 18 Aug 2021 14:52:49 +0300 Subject: [PATCH] Don't allow selected items together with text. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index a88062abc..089fcf6ef 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -3168,6 +3168,10 @@ void HistoryInner::addToSelection( not_null item) const { const auto i = toItems->find(item); if (i == toItems->cend()) { + if (toItems->size() == 1 + && toItems->begin()->second != FullSelection) { + toItems->clear(); + } toItems->emplace(item, FullSelection); } else if (i->second != FullSelection) { i->second = FullSelection;