Lazy backlog fetching for removed buffers.
[quassel.git] / src / uisupport / abstractbuffercontainer.cpp
index ed898e9..9861d14 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-09 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -20,6 +20,7 @@
 
 #include "abstractbuffercontainer.h"
 #include "client.h"
+#include "clientbacklogmanager.h"
 #include "networkmodel.h"
 
 AbstractBufferContainer::AbstractBufferContainer(QWidget *parent)
@@ -71,6 +72,7 @@ void AbstractBufferContainer::currentChanged(const QModelIndex &current, const Q
   if(newBufferId != oldBufferId) {
     setCurrentBuffer(newBufferId);
     emit currentChanged(newBufferId);
+    emit currentChanged(current);
   }
 }
 
@@ -91,7 +93,7 @@ void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) {
 
   _currentBuffer = bufferId;
   showChatView(bufferId);
-  Client::networkModel()->setBufferActivity(bufferId, Buffer::NoActivity);
-  // Client::setBufferLastSeenMsg(bufferId, _chatViews[bufferId]->lastMsgId());
+  Client::networkModel()->clearBufferActivity(bufferId);
+  Client::backlogManager()->checkForBacklog(bufferId);
   setFocus();
 }