+
+MsgId BufferSyncer::lastSeenMsg(BufferId buffer) const
+{
+ return _lastSeenMsg.value(buffer, MsgId());
+}
+
+
+bool BufferSyncer::setLastSeenMsg(BufferId buffer, const MsgId &msgId)
+{
+ if (!msgId.isValid())
+ return false;
+
+ const MsgId oldLastSeenMsg = lastSeenMsg(buffer);
+ if (!oldLastSeenMsg.isValid() || oldLastSeenMsg < msgId) {
+ _lastSeenMsg[buffer] = msgId;
+ SYNC(ARG(buffer), ARG(msgId))
+ emit lastSeenMsgSet(buffer, msgId);
+ return true;
+ }