Performlist is back and working!
[quassel.git] / src / core / networkconnection.cpp
index 4cca93f..a8b8e15 100644 (file)
@@ -174,16 +174,9 @@ void NetworkConnection::networkInitialized() {
 }
 
 void NetworkConnection::sendPerform() {
-  // TODO: reimplement perform List!
-  //// send performlist
-  //QStringList performList = networkSettings["Perform"].toString().split( "\n" );
-  //int count = performList.count();
-  //for(int a = 0; a < count; a++) {
-  //  if(!performList[a].isEmpty() ) {
-  //    userInput(network, "", performList[a]);
-  //  }
-  //}
-
+  foreach(QString line, network()->perform()) {
+    if(!line.isEmpty()) userInput(Core::bufferInfo(coreSession()->user(), network()->networkId(), BufferInfo::StatusBuffer), line);
+  }
 }
 
 QVariant NetworkConnection::state() const {
@@ -206,7 +199,7 @@ void NetworkConnection::socketHasData() {
 void NetworkConnection::socketError(QAbstractSocket::SocketError) {
   qDebug() << qPrintable(tr("Could not connect to %1 (%2)").arg(network()->networkName(), socket.errorString()));
   emit connectionError(socket.errorString());
-  emit displayMsg(Message::Error, "", tr("Connection failure: %1").arg(socket.errorString()));
+  emit displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Connection failure: %1").arg(socket.errorString()));
   network()->emitConnectionError(socket.errorString());
 }
 
@@ -250,7 +243,7 @@ void NetworkConnection::socketDisconnected() {
 }
 
 // FIXME switch to BufferId
-void NetworkConnection::userInput(QString buf, QString msg) {
+void NetworkConnection::userInput(BufferInfo buf, QString msg) {
   userInputHandler()->handleUserInput(buf, msg);
 }