Auto Identify works now. Also newly created networks will have sane defaults as well :)
[quassel.git] / src / core / networkconnection.cpp
index 4cd776a..912c2c0 100644 (file)
@@ -174,16 +174,15 @@ 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]);
-  //  }
-  //}
-
+  BufferInfo statusBuf = Core::bufferInfo(coreSession()->user(), network()->networkId(), BufferInfo::StatusBuffer);
+  // do auto identify
+  if(network()->useAutoIdentify() && !network()->autoIdentifyService().isEmpty() && !network()->autoIdentifyPassword().isEmpty()) {
+    userInputHandler()->handleMsg(statusBuf, QString("%1 IDENTIFY %2").arg(network()->autoIdentifyService(), network()->autoIdentifyPassword()));
+  }
+  // send perform list
+  foreach(QString line, network()->perform()) {
+    if(!line.isEmpty()) userInput(statusBuf, line);
+  }
 }
 
 QVariant NetworkConnection::state() const {