X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorebuffersyncer.h;h=c490419a95bd7363fd241cdb43dd4e817eb32b5e;hp=05ddd6adb9b3b4219d3f0414c3dd2ea5d98126d2;hb=fd16e241d2fd1f33f4625b3255956f025a67273b;hpb=695758015a80eb8c158a9ac4c0f1c0b547e70df3 diff --git a/src/core/corebuffersyncer.h b/src/core/corebuffersyncer.h index 05ddd6ad..c490419a 100644 --- a/src/core/corebuffersyncer.h +++ b/src/core/corebuffersyncer.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -40,6 +40,15 @@ public slots: virtual inline void requestRemoveBuffer(BufferId buffer) { removeBuffer(buffer); } virtual void removeBuffer(BufferId bufferId); + void addBufferActivity(Message message) { + auto oldActivity = activity(message.bufferId()); + if (!oldActivity.testFlag(message.type())) { + setBufferActivity(message.bufferId(), (int) (oldActivity | message.type())); + } + } + + void setBufferActivity(BufferId buffer, const int &activity) override; + virtual inline void requestRenameBuffer(BufferId buffer, QString newName) { renameBuffer(buffer, newName); } virtual void renameBuffer(BufferId buffer, QString newName); @@ -48,7 +57,10 @@ public slots: virtual void requestPurgeBufferIds(); - virtual inline void requestMarkBufferAsRead(BufferId buffer) { markBufferAsRead(buffer); } + virtual inline void requestMarkBufferAsRead(BufferId buffer) { + setLastSeenMsg(buffer, (int) Message::Types()); + markBufferAsRead(buffer); + } void storeDirtyIds(); @@ -61,6 +73,7 @@ private: QSet dirtyLastSeenBuffers; QSet dirtyMarkerLineBuffers; + QSet dirtyActivities; void purgeBufferIds(); };