Skip to content

Commit

Permalink
Room::readMarkerMoved: pass 'from' and 'to' ids with the signal
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal committed Jul 31, 2018
1 parent 0ec67c2 commit dc3acd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Room::Private
*/
void dropDuplicateEvents(RoomEvents& events) const;

void setLastReadEvent(User* u, const QString& eventId);
void setLastReadEvent(User* u, QString eventId);
void updateUnreadCount(rev_iter_t from, rev_iter_t to);
void promoteReadMarker(User* u, rev_iter_t newMarker,
bool force = false);
Expand Down Expand Up @@ -374,18 +374,18 @@ void Room::setJoinState(JoinState state)
emit joinStateChanged(oldState, state);
}

void Room::Private::setLastReadEvent(User* u, const QString& eventId)
void Room::Private::setLastReadEvent(User* u, QString eventId)
{
auto& storedId = lastReadEventIds[u];
if (storedId == eventId)
return;
storedId = eventId;
swap(storedId, eventId);
emit q->lastReadEventChanged(u);
if (isLocalUser(u))
{
if (eventId != serverReadMarker)
connection->callApi<PostReadMarkersJob>(id, eventId);
emit q->readMarkerMoved();
if (storedId != serverReadMarker)
connection->callApi<PostReadMarkersJob>(id, storedId);
emit q->readMarkerMoved(eventId, storedId);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/room.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ namespace QMatrixClient
void firstDisplayedEventChanged();
void lastDisplayedEventChanged();
void lastReadEventChanged(User* user);
void readMarkerMoved();
void readMarkerMoved(QString fromEventId, QString toEventId);
void unreadMessagesChanged(Room* room);

void accountDataChanged(QString type);
Expand Down

0 comments on commit dc3acd3

Please sign in to comment.