aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-31 09:01:31 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-31 09:01:31 +0900
commitdc3acd336e30a17d6b5d0cbe6cde2838737c9030 (patch)
tree2b72c57374958c7dba0c8263d2fff980878dbd18 /lib
parent0ec67c2f6ba0e122fb7274cec1aaa1ee398b9bfd (diff)
downloadlibquotient-dc3acd336e30a17d6b5d0cbe6cde2838737c9030.tar.gz
libquotient-dc3acd336e30a17d6b5d0cbe6cde2838737c9030.zip
Room::readMarkerMoved: pass 'from' and 'to' ids with the signal
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp12
-rw-r--r--lib/room.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index af6ef8c4..bfa6df68 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -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);
@@ -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);
}
}
diff --git a/lib/room.h b/lib/room.h
index e665f321..599b7fbf 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -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);