Implement RPC call to gracefully disconnect a client
[quassel.git] / src / client / client.cpp
index 343ad85..e89f907 100644 (file)
@@ -160,6 +160,9 @@ void Client::init()
     p->attachSignal(this, SIGNAL(requestPasswordChange(PeerPtr,QString,QString,QString)), SIGNAL(changePassword(PeerPtr,QString,QString,QString)));
     p->attachSlot(SIGNAL(passwordChanged(PeerPtr,bool)), this, SLOT(corePasswordChanged(PeerPtr,bool)));
 
+    p->attachSignal(this, SIGNAL(requestKickClient(int)), SIGNAL(kickClient(int)));
+    p->attachSlot(SIGNAL(disconnectFromCore()), this, SLOT(disconnectFromCore()));
+
     //connect(mainUi(), SIGNAL(connectToCore(const QVariantMap &)), this, SLOT(connectToCore(const QVariantMap &)));
     connect(mainUi(), SIGNAL(disconnectFromCore()), this, SLOT(disconnectFromCore()));
     connect(this, SIGNAL(connected()), mainUi(), SLOT(connectedToCore()));
@@ -685,6 +688,12 @@ void Client::changePassword(const QString &oldPassword, const QString &newPasswo
 }
 
 
+void Client::kickClient(int peerId)
+{
+    emit instance()->requestKickClient(peerId);
+}
+
+
 void Client::corePasswordChanged(PeerPtr, bool success)
 {
     if (success)