connect(network, SIGNAL(autoReconnectIntervalSet(quint32)), this, SLOT(autoReconnectSettingsChanged()));
connect(network, SIGNAL(autoReconnectRetriesSet(quint16)), this, SLOT(autoReconnectSettingsChanged()));
-#ifndef QT_NO_OPENSSL
+#ifdef HAVE_SSL
connect(&socket, SIGNAL(encrypted()), this, SLOT(socketEncrypted()));
connect(&socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
#endif
QVariantList serverList = network()->serverList();
Identity *identity = coreSession()->identity(network()->identity());
if(!serverList.count()) {
- quWarning() << "Server list empty, ignoring connect request!";
+ qWarning() << "Server list empty, ignoring connect request!";
return;
}
if(!identity) {
- quWarning() << "Invalid identity configures, ignoring connect request!";
+ qWarning() << "Invalid identity configures, ignoring connect request!";
return;
}
// use a random server?
void NetworkConnection::socketError(QAbstractSocket::SocketError) {
_previousConnectionAttemptFailed = true;
- quWarning() << qPrintable(tr("Could not connect to %1 (%2)").arg(network()->networkName(), socket.errorString()));
+ qWarning() << qPrintable(tr("Could not connect to %1 (%2)").arg(network()->networkName(), socket.errorString()));
emit connectionError(socket.errorString());
emit displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Connection failure: %1").arg(socket.errorString()));
network()->emitConnectionError(socket.errorString());
//exit(1);
}
-#ifndef QT_NO_OPENSSL
+#ifdef HAVE_SSL
void NetworkConnection::sslErrors(const QList<QSslError> &sslErrors) {
Q_UNUSED(sslErrors)
socketInitialized();
}
-#endif // QT_NO_OPENSSL
+#endif // HAVE_SSL
void NetworkConnection::socketConnected() {
-#ifdef QT_NO_OPENSSL
+#ifndef HAVE_SSL
socketInitialized();
return;
#else
//emit connected(networkId()); initialize first!
Identity *identity = coreSession()->identity(network()->identity());
if(!identity) {
- quError() << "Identity invalid!";
+ qCritical() << "Identity invalid!";
disconnectFromIrc();
return;
}
void NetworkConnection::doAutoReconnect() {
if(connectionState() != Network::Disconnected && connectionState() != Network::Reconnecting) {
- quWarning() << "NetworkConnection::doAutoReconnect(): Cannot reconnect while not being disconnected!";
+ qWarning() << "NetworkConnection::doAutoReconnect(): Cannot reconnect while not being disconnected!";
return;
}
if(_autoReconnectCount > 0) _autoReconnectCount--;
if(cmd == "PRIVMSG" && params.count() > 1) {
int overrun = lastParamOverrun(cmd, params);
if(overrun) {
- QList<QByteArray> paramCopy1;
- QList<QByteArray> paramCopy2;
- for(int i = 0; i < params.count() - 1; i++) {
- paramCopy1 << params[i];
- paramCopy2 << params[i];
- }
+ QList<QByteArray> paramCopy1 = params;
+ paramCopy1.removeLast();
+ QList<QByteArray> paramCopy2 = paramCopy1;
QByteArray lastPart = params.last();
QByteArray splitter(" .,-");
for(int i = 0; i < splitter.size(); i++) {
splitPos = qMax(splitPos, lastPart.lastIndexOf(splitter[i], maxSplitPos));
}
-
- if(splitPos == -1) {
+ if(splitPos <= 0) {
splitPos = maxSplitPos;
}