aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--room.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/room.cpp b/room.cpp
index e08b45e8..b5e6a906 100644
--- a/room.cpp
+++ b/room.cpp
@@ -337,12 +337,9 @@ void Room::updateData(const SyncRoomData& data)
processStateEvents(data.state);
- if (!data.timeline.empty())
- {
- // State changes can arrive in a timeline event; so check those.
- processStateEvents(data.timeline);
- addNewMessageEvents(data.timeline);
- }
+ // State changes can arrive in a timeline event; so check those.
+ processStateEvents(data.timeline);
+ addNewMessageEvents(data.timeline);
for( Event* ephemeralEvent: data.ephemeral )
{
@@ -389,6 +386,8 @@ Connection* Room::connection() const
void Room::addNewMessageEvents(const Events& events)
{
+ if (events.empty())
+ return;
emit aboutToAddNewMessages(events);
doAddNewMessageEvents(events);
emit addedMessages();
@@ -402,6 +401,8 @@ void Room::doAddNewMessageEvents(const Events& events)
void Room::addHistoricalMessageEvents(const Events& events)
{
+ if (events.empty())
+ return;
emit aboutToAddHistoricalMessages(events);
doAddHistoricalMessageEvents(events);
emit addedMessages();