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:
parent
37b018257e
commit
d5de064019
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue