Continuing my personal crusade against Buffer.
[quassel.git] / src / client / buffer.cpp
index df78639..9108d69 100644 (file)
 
 Buffer::Buffer(BufferInfo bufferid, QObject *parent)
   : QObject(parent),
-    _bufferInfo(bufferid),
-    _isVisible(false),
-    _activityLevel(NoActivity)
+    _bufferInfo(bufferid)
 {
-
 }
 
 BufferInfo Buffer::bufferInfo() const {
@@ -42,49 +39,3 @@ BufferInfo Buffer::bufferInfo() const {
   return _bufferInfo;
 }
 
-void Buffer::setVisible(bool visible) {
-  _isVisible = visible;
-  setActivityLevel(NoActivity);
-  if(_lastRcvdMsg.msgId() > 0) setLastSeenMsg(_lastRcvdMsg.msgId());
-}
-
-void Buffer::setLastSeenMsg(const MsgId &msgId) {
-  const MsgId oldLastSeen = lastSeenMsg();
-  if(!oldLastSeen.isValid() || (msgId.isValid() && msgId > oldLastSeen)) {
-    _lastSeenMsg = msgId;
-    Client::setBufferLastSeenMsg(bufferInfo().bufferId(), msgId);
-    setActivityLevel(NoActivity);
-  }
-}
-
-void Buffer::setActivityLevel(ActivityLevel level) {
-  _activityLevel = level;
-  if(bufferInfo().bufferId() > 0) {
-    Client::networkModel()->setBufferActivity(bufferInfo(), level);
-  }
-}
-
-void Buffer::updateActivityLevel(const Message &msg) {
-  // FIXME dirty hack to allow the lastSeen stuff to continue to work
-  //       will be made much nicer once Buffer dies, I hope...
-  if(msg.msgId() > _lastRcvdMsg.msgId()) _lastRcvdMsg = msg;
-
-  if(isVisible())
-    return;
-
-  if(msg.flags() & Message::Self)      // don't update activity for our own messages
-    return;
-
-  if(lastSeenMsg().isValid() && lastSeenMsg() >= msg.msgId())
-    return;
-
-  ActivityLevel level = activityLevel() | OtherActivity;
-  if(msg.type() & (Message::Plain | Message::Notice | Message::Action))
-    level |= NewMessage;
-
-  if(msg.flags() & Message::Highlight)
-    level |= Highlight;
-
-  if(level != activityLevel())
-    setActivityLevel(level);
-}