Introducing global away
[quassel.git] / src / core / coresession.cpp
index e327f63..1c38a87 100644 (file)
@@ -515,6 +515,7 @@ void CoreSession::clientsDisconnected() {
 
     if(!net->isConnected())
       continue;
+
     identity = net->identityPtr();
     if(!identity)
       continue;
@@ -530,3 +531,18 @@ void CoreSession::clientsDisconnected() {
     }
   }
 }
+
+
+void CoreSession::globalAway(const QString &msg) {
+  QHash<NetworkId, CoreNetwork *>::iterator netIter = _networks.begin();
+  CoreNetwork *net = 0;
+  while(netIter != _networks.end()) {
+    net = *netIter;
+    netIter++;
+
+    if(!net->isConnected())
+      continue;
+
+    net->userInputHandler()->issueAway(msg, false /* no force away */);
+  }
+}