/***************************************************************************
- * Copyright (C) 2005-2014 by the Quassel Project *
+ * Copyright (C) 2005-2015 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
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(socketOpen(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)));
}
}
else if (s.endsWith("\n"))
s.chop(1);
NetworkDataEvent *event = new NetworkDataEvent(EventManager::NetworkIncoming, this, s);
-#if QT_VERSION >= 0x040700
event->setTimestamp(QDateTime::currentDateTimeUtc());
-#else
- event->setTimestamp(QDateTime::currentDateTime().toUTC());
-#endif
emit newEvent(event);
}
}
void CoreNetwork::socketInitialized()
{
- Server server = usedServer();
-#ifdef HAVE_SSL
- if (server.useSsl && !socket.isEncrypted())
- return;
-#endif
-#if QT_VERSION >= 0x040600
- socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
-#endif
CoreIdentity *identity = identityPtr();
if (!identity) {
qCritical() << "Identity invalid!";
return;
}
+ emit socketOpen(identity, localAddress(), localPort(), peerAddress(), peerPort());
+
+ Server server = usedServer();
+#ifdef HAVE_SSL
+ if (server.useSsl && !socket.isEncrypted())
+ return;
+#endif
+ socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
+
emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
// TokenBucket to avoid sending too much at once