Implement client UI integration, add feature flag (0x400)
[quassel.git] / src / client / client.cpp
index 5319a9a..8875b70 100644 (file)
@@ -390,6 +390,7 @@ void Client::setSyncedToCore()
     connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), this, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
     connect(bufferSyncer(), SIGNAL(buffersPermanentlyMerged(BufferId, BufferId)), _messageModel, SLOT(buffersPermanentlyMerged(BufferId, BufferId)));
     connect(bufferSyncer(), SIGNAL(bufferMarkedAsRead(BufferId)), SIGNAL(bufferMarkedAsRead(BufferId)));
+    connect(bufferSyncer(), SIGNAL(bufferActivityChange(BufferId, const Message::Types)), _networkModel, SLOT(bufferActivityChanged(BufferId, const Message::Types)));
     connect(networkModel(), SIGNAL(requestSetLastSeenMsg(BufferId, MsgId)), bufferSyncer(), SLOT(requestSetLastSeenMsg(BufferId, const MsgId &)));
 
     SignalProxy *p = signalProxy();
@@ -428,27 +429,33 @@ void Client::setSyncedToCore()
     }
 
     // trigger backlog request once all active bufferviews are initialized
-    connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+    connect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
 
     _connected = true;
     emit connected();
     emit coreConnectionStateChanged(true);
 }
 
-
-void Client::requestInitialBacklog()
+void Client::finishConnectionInitialization()
 {
     // usually it _should_ take longer until the bufferViews are initialized, so that's what
     // triggers this slot. But we have to make sure that we know all buffers yet.
     // so we check the BufferSyncer and in case it wasn't initialized we wait for that instead
     if (!bufferSyncer()->isInitialized()) {
-        disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
-        connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+        disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+        connect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
         return;
     }
-    disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
-    disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(requestInitialBacklog()));
+    disconnect(bufferViewOverlay(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+    disconnect(bufferSyncer(), SIGNAL(initDone()), this, SLOT(finishConnectionInitialization()));
+
+    requestInitialBacklog();
+    bufferSyncer()->markActivitiesChanged();
+}
 
+
+void Client::requestInitialBacklog()
+{
     _backlogManager->requestInitialBacklog();
 }