connect(&socket, SIGNAL(encrypted()), this, SLOT(socketInitialized()));
connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
#endif
+ connect(this, SIGNAL(newEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *)));
+
+ if(Quassel::isOptionSet("oidentd")) {
+ connect(this, SIGNAL(socketInitialized(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(addSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)), Qt::BlockingQueuedConnection);
+ connect(this, SIGNAL(socketDisconnected(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)), Core::instance()->oidentdConfigGenerator(), SLOT(removeSocket(const CoreIdentity*,QHostAddress,quint16,QHostAddress,quint16)));
+ }
}
CoreNetwork::~CoreNetwork() {
if(target.isEmpty())
return 0;
+ if(!Cipher::neededFeaturesAvailable())
+ return 0;
+
QByteArray key = cipherKey(target);
if(key.isEmpty())
return 0;
#else
event->setTimestamp(QDateTime::currentDateTime().toUTC());
#endif
- coreSession()->eventManager()->sendEvent(event);
+ emit newEvent(event);
}
}
return;
}
+ emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
+
// TokenBucket to avoid sending too much at once
_messageDelay = 2200; // this seems to be a safe value (2.2 seconds delay)
_burstSize = 5;
setConnected(false);
emit disconnected(networkId());
+ emit socketDisconnected(identityPtr(), localAddress(), localPort(), peerAddress(), peerPort());
if(_quitRequested) {
_quitRequested = false;
setConnectionState(Network::Disconnected);