#include "corenetworkconfig.h"
#include "ircserverhandler.h"
-#include "userinputhandler.h"
+#include "coreuserinputhandler.h"
#include "ctcphandler.h"
+INIT_SYNCABLE_OBJECT(CoreNetwork)
CoreNetwork::CoreNetwork(const NetworkId &networkid, CoreSession *session)
: Network(networkid, session),
_coreSession(session),
_ircServerHandler(new IrcServerHandler(this)),
- _userInputHandler(new UserInputHandler(this)),
+ _userInputHandler(new CoreUserInputHandler(this)),
_ctcpHandler(new CtcpHandler(this)),
_autoReconnectCount(0),
_quitRequested(false),
connect(&_autoWhoTimer, SIGNAL(timeout()), this, SLOT(sendAutoWho()));
connect(&_autoWhoCycleTimer, SIGNAL(timeout()), this, SLOT(startAutoWhoCycle()));
connect(&_tokenBucketTimer, SIGNAL(timeout()), this, SLOT(fillBucketAndProcessQueue()));
- connect(this, SIGNAL(connectRequested()), this, SLOT(connectToIrc()));
connect(&socket, SIGNAL(connected()), this, SLOT(socketInitialized()));
connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
_tokenBucket = _burstSize; // init with a full bucket
_tokenBucketTimer.start(_messageDelay);
+ if(networkInfo().useSasl) {
+ putRawLine(serverEncode(QString("CAP REQ :sasl")));
+ }
if(!server.password.isEmpty()) {
putRawLine(serverEncode(QString("PASS %1").arg(server.password)));
}
setConnected(false);
emit disconnected(networkId());
if(_quitRequested) {
+ _quitRequested = false;
setConnectionState(Network::Disconnected);
Core::setNetworkConnected(userId(), networkId(), false);
} else if(_autoReconnectCount != 0) {
qWarning() << "Requesting connect while already being connected!";
return;
}
- Network::requestConnect();
+ QMetaObject::invokeMethod(const_cast<CoreNetwork *>(this), "connectToIrc", Qt::QueuedConnection);
}
void CoreNetwork::requestDisconnect() const {