#include <QStringList>
#include <QTimer>
-#ifndef QT_NO_OPENSSL
+#ifdef HAVE_SSL
# include <QSslSocket>
# include <QSslError>
#else
#include "network.h"
#include "signalproxy.h"
-class Network;
-
class IrcServerHandler;
class UserInputHandler;
class CtcpHandler;
inline QString channelKey(const QString &channel) const { return _channelKeys.value(channel.toLower(), QString()); }
inline QStringList persistentChannels() const { return _channelKeys.keys(); }
- inline bool isAutoWhoInProgress(const QString &channel) const { return _autoWhoInProgress.contains(channel); }
+ inline bool isAutoWhoInProgress(const QString &channel) const { return _autoWhoInProgress.value(channel.toLower(), 0); }
public slots:
// void setServerOptions();
void userInput(BufferInfo bufferInfo, QString msg);
void putRawLine(QByteArray input);
- void putCmd(const QString &cmd, const QVariantList ¶ms, const QByteArray &prefix = QByteArray());
+ int lastParamOverrun(const QString &cmd, const QList<QByteArray> ¶ms);
+ void putCmd(const QString &cmd, const QList<QByteArray> ¶ms, const QByteArray &prefix = QByteArray());
void setChannelJoined(const QString &channel);
void setChannelParted(const QString &channel);
void socketError(QAbstractSocket::SocketError);
void socketConnected();
void socketInitialized();
+ void socketCloseTimeout();
void socketDisconnected();
void socketStateChanged(QAbstractSocket::SocketState);
void setConnectionState(Network::ConnectionState);
void sendPerform();
void autoReconnectSettingsChanged();
void doAutoReconnect();
+ void sendPing();
void sendAutoWho();
void startAutoWhoCycle();
void nickChanged(const QString &newNick, const QString &oldNick); // this signal is inteded to rename query buffers in the storage backend
-#ifndef QT_NO_OPENSSL
+#ifdef HAVE_SSL
void socketEncrypted();
void sslErrors(const QList<QSslError> &errors);
#endif
void fillBucketAndProcessQueue();
private:
-#ifndef QT_NO_OPENSSL
+#ifdef HAVE_SSL
QSslSocket socket;
#else
QTcpSocket socket;
QHash<QString, QString> _channelKeys; // stores persistent channels and their passwords, if any
QTimer _autoReconnectTimer;
+
int _autoReconnectCount;
+ QTimer _socketCloseTimer;
+
+ /* this flag triggers quitRequested() once the socket is closed
+ * it is needed to determine whether or not the connection needs to be
+ *in the automatic session restore. */
+ bool _quitRequested;
+
bool _previousConnectionAttemptFailed;
int _lastUsedServerlistIndex;
+ QTimer _pingTimer;
+
bool _autoWhoEnabled;
QStringList _autoWhoQueue;
- QSet<QString> _autoWhoInProgress;
+ QHash<QString, int> _autoWhoInProgress;
int _autoWhoInterval;
int _autoWhoNickLimit;
int _autoWhoDelay;
void writeToSocket(QByteArray s);
-
-
class ParseError : public Exception {
public:
ParseError(QString cmd, QString prefix, QStringList params);