diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 56494bc4d3..8527b05bf6 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -1274,13 +1274,8 @@ not_null History::addNewItem(not_null 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 History::addNewItem(not_null adding, bool n } } + setLastMessage(adding); + if (newMsg) { + newItemAdded(adding); + } + return adding; }