Skip to content

Commit a4c4ea1

Browse files
committed
Always process item destroy in topics.
1 parent 56e675e commit a4c4ea1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Telegram/SourceFiles/data/data_replies_list.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,16 @@ bool RepliesList::applyItemDestroyed(
456456
bool RepliesList::applyUpdate(const MessageUpdate &update) {
457457
using Flag = MessageUpdate::Flag;
458458

459-
if (update.item->history() != _history
460-
|| !update.item->isRegular()
461-
|| !update.item->inThread(_rootId)) {
459+
if (update.item->history() != _history || !update.item->isRegular()) {
462460
return false;
463461
}
462+
464463
const auto id = update.item->id;
464+
const auto inThread = update.item->inThread(_rootId);
465465
const auto added = (update.flags & Flag::ReplyToTopAdded);
466466
const auto i = ranges::lower_bound(_list, id, std::greater<>());
467467
if (update.flags & Flag::Destroyed) {
468-
if (!added) {
468+
if (!added && inThread) {
469469
changeUnreadCountByPost(id, -1);
470470
}
471471
if (i == end(_list) || *i != id) {
@@ -480,6 +480,8 @@ bool RepliesList::applyUpdate(const MessageUpdate &update) {
480480
}
481481
}
482482
return true;
483+
} else if (!inThread) {
484+
return false;
483485
}
484486
if (added) {
485487
changeUnreadCountByPost(id, 1);

0 commit comments

Comments
 (0)