From 0ecfd3897cc3264c21f80a121b4b6774ac2d67f7 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 22 Jan 2018 11:49:09 +0900 Subject: Room: emit addedMessages() before possible read marker auto-promotion Read marker auto-promotion may be bound to a dataChanged() signal in the client model, while a routine connection for addedMessages() is endInsertRows(). Emitting endInsertRows() after dataChanged() over the same rows has unpredictable consequences for representation of data in those rows - hence the fix. --- room.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/room.cpp b/room.cpp index d27bd5a3..ab7f7a8f 100644 --- a/room.cpp +++ b/room.cpp @@ -1141,8 +1141,8 @@ void Room::Private::addNewMessageEvents(RoomEvents&& events) processRedaction(move(r)); if (insertedSize > 0) { - checkUnreadMessages(timeline.cend() - insertedSize); emit q->addedMessages(); + checkUnreadMessages(timeline.cend() - insertedSize); } Q_ASSERT(timeline.size() == timelineSize + insertedSize); -- cgit v1.2.3