fixing buffered backlog replay for reconnects
authorMarcus Eggenberger <egs@quassel-irc.org>
Thu, 4 Sep 2008 15:51:42 +0000 (17:51 +0200)
committerMarcus Eggenberger <egs@quassel-irc.org>
Thu, 4 Sep 2008 15:51:42 +0000 (17:51 +0200)
src/client/client.cpp
src/client/clientbacklogmanager.cpp
src/client/clientbacklogmanager.h

index ce734cc..a53d07d 100644 (file)
@@ -294,6 +294,7 @@ void Client::disconnectFromCore() {
   emit disconnected();
   emit coreConnectionStateChanged(false);
 
+  backlogManager()->reset();
   messageProcessor()->reset();
 
   // Clear internal data. Hopefully nothing relies on it at this point.
index 29af54c..b485726 100644 (file)
@@ -77,3 +77,9 @@ void ClientBacklogManager::requestInitialBacklog() {
   FixedBacklogRequester backlogRequester(this);
   backlogRequester.requestBacklog();
 }
+
+void ClientBacklogManager::reset() {
+  _buffer = true;
+  _messageBuffer.clear();
+  _buffersWaiting.clear();
+}
index 2f0fcf3..ae6b147 100644 (file)
@@ -37,6 +37,8 @@ public slots:
   virtual QVariantList requestBacklog(BufferId bufferId, int lastMsgs = -1, int offset = -1);
   void requestInitialBacklog();
 
+  void reset();
+
 private:
   bool _buffer;
   QList<Message> _messageBuffer;