}
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 {
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());
}
}
// FIXME switch to BufferId
-void NetworkConnection::userInput(QString buf, QString msg) {
+void NetworkConnection::userInput(BufferInfo buf, QString msg) {
userInputHandler()->handleUserInput(buf, msg);
}