mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Always process item destroy in topics.
This commit is contained in:
@@ -456,16 +456,16 @@ bool RepliesList::applyItemDestroyed(
|
||||
bool RepliesList::applyUpdate(const MessageUpdate &update) {
|
||||
using Flag = MessageUpdate::Flag;
|
||||
|
||||
if (update.item->history() != _history
|
||||
|| !update.item->isRegular()
|
||||
|| !update.item->inThread(_rootId)) {
|
||||
if (update.item->history() != _history || !update.item->isRegular()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto id = update.item->id;
|
||||
const auto inThread = update.item->inThread(_rootId);
|
||||
const auto added = (update.flags & Flag::ReplyToTopAdded);
|
||||
const auto i = ranges::lower_bound(_list, id, std::greater<>());
|
||||
if (update.flags & Flag::Destroyed) {
|
||||
if (!added) {
|
||||
if (!added && inThread) {
|
||||
changeUnreadCountByPost(id, -1);
|
||||
}
|
||||
if (i == end(_list) || *i != id) {
|
||||
@@ -480,6 +480,8 @@ bool RepliesList::applyUpdate(const MessageUpdate &update) {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (!inThread) {
|
||||
return false;
|
||||
}
|
||||
if (added) {
|
||||
changeUnreadCountByPost(id, 1);
|
||||
|
||||
Reference in New Issue
Block a user