X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fnetworkconnection.h;h=d9474557f5c06c633b4296c6368740696136e210;hp=1002cd6ffddabbf3964e1dbe4d04c69e84705aeb;hb=f7379184b7c0ae4e53d7470809f84e2ad3239ec1;hpb=d19d557880990d174873926c9ca943a1140bec81 diff --git a/src/core/networkconnection.h b/src/core/networkconnection.h index 1002cd6f..d9474557 100644 --- a/src/core/networkconnection.h +++ b/src/core/networkconnection.h @@ -26,7 +26,7 @@ #include #include -#ifndef QT_NO_OPENSSL +#ifdef HAVE_SSL # include # include #else @@ -39,8 +39,6 @@ #include "network.h" #include "signalproxy.h" -class Network; - class IrcServerHandler; class UserInputHandler; class CtcpHandler; @@ -91,11 +89,12 @@ public: public slots: // void setServerOptions(); void connectToIrc(bool reconnecting = false); - void disconnectFromIrc(bool requested = true); + void disconnectFromIrc(bool requested = true, const QString &reason = QString()); 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 ¶ms); + void putCmd(const QString &cmd, const QList ¶ms, const QByteArray &prefix = QByteArray()); void setChannelJoined(const QString &channel); void setChannelParted(const QString &channel); @@ -109,7 +108,7 @@ signals: void recvRawServerMsg(QString); void displayStatusMsg(QString); //void displayMsg(Message msg); - void displayMsg(Message::Type, BufferInfo::Type, QString target, QString text, QString sender = "", quint8 flags = Message::None); + void displayMsg(Message::Type, BufferInfo::Type, QString target, QString text, QString sender = "", Message::Flags flags = Message::None); void connected(NetworkId networkId); ///< Emitted after receipt of 001 to indicate that we can now send data to the IRC server void disconnected(NetworkId networkId); void connectionStateChanged(Network::ConnectionState); @@ -130,6 +129,7 @@ private slots: void socketError(QAbstractSocket::SocketError); void socketConnected(); void socketInitialized(); + void socketCloseTimeout(); void socketDisconnected(); void socketStateChanged(QAbstractSocket::SocketState); void setConnectionState(Network::ConnectionState); @@ -138,11 +138,12 @@ private slots: 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 &errors); #endif @@ -150,7 +151,7 @@ private slots: void fillBucketAndProcessQueue(); private: -#ifndef QT_NO_OPENSSL +#ifdef HAVE_SSL QSslSocket socket; #else QTcpSocket socket; @@ -169,11 +170,21 @@ private: QHash _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; QHash _autoWhoInProgress; @@ -190,8 +201,6 @@ private: void writeToSocket(QByteArray s); - - class ParseError : public Exception { public: ParseError(QString cmd, QString prefix, QStringList params);