mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Shuffle code around a bit.
Crash reports point to addToUnreadMentions() call being corrupted. New reports could show is it responsible or setLastMessage() call.
This commit is contained in:
@@ -1274,13 +1274,8 @@ not_null<HistoryItem*> History::addNewItem(not_null<HistoryItem*> adding, bool n
|
||||
recountGrouping(groupFrom, groupTill);
|
||||
}
|
||||
|
||||
setLastMessage(adding);
|
||||
if (newMsg) {
|
||||
newItemAdded(adding);
|
||||
}
|
||||
|
||||
adding->addToUnreadMentions(AddToUnreadMentionsMethod::New);
|
||||
if (IsServerMsgId(adding->id)) {
|
||||
adding->addToUnreadMentions(AddToUnreadMentionsMethod::New);
|
||||
if (auto sharedMediaTypes = adding->sharedMediaTypes()) {
|
||||
if (newMsg) {
|
||||
Auth().storage().add(Storage::SharedMediaAddNew(
|
||||
@@ -1378,6 +1373,11 @@ not_null<HistoryItem*> History::addNewItem(not_null<HistoryItem*> adding, bool n
|
||||
}
|
||||
}
|
||||
|
||||
setLastMessage(adding);
|
||||
if (newMsg) {
|
||||
newItemAdded(adding);
|
||||
}
|
||||
|
||||
return adding;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user