fixing a bug where no backlog is requested after an aborted connect
[quassel.git] / src / client / client.cpp
index 19f0c5e..b0be2a3 100644 (file)
@@ -122,6 +122,9 @@ void Client::init() {
   connect(this, SIGNAL(connected()), mainUi, SLOT(connectedToCore()));
   connect(this, SIGNAL(disconnected()), mainUi, SLOT(disconnectedFromCore()));
 
+  // attach backlog manager
+  p->synchronize(backlogManager());
+  connect(backlogManager(), SIGNAL(messagesReceived(BufferId, int)), _messageModel, SLOT(messagesReceived(BufferId, int)));
 }
 
 /*** public static methods ***/
@@ -274,9 +277,6 @@ void Client::setSyncedToCore() {
   connect(bufferSyncer(), SIGNAL(bufferRenamed(BufferId, QString)), this, SLOT(bufferRenamed(BufferId, QString)));
   signalProxy()->synchronize(bufferSyncer());
 
-  // attach backlog manager
-  signalProxy()->synchronize(backlogManager());
-
   // create a new BufferViewManager
   _bufferViewManager = new BufferViewManager(signalProxy(), this);
 
@@ -302,6 +302,7 @@ void Client::disconnectedFromCore() {
   emit disconnected();
   emit coreConnectionStateChanged(false);
 
+  backlogManager()->reset();
   messageProcessor()->reset();
 
   // Clear internal data. Hopefully nothing relies on it at this point.