Finally here: the long awaited auto reconnect! Your auto reconnect settings
[quassel.git] / src / core / networkconnection.h
index a7aa1fd..ace1e4e 100644 (file)
@@ -65,24 +65,24 @@ public:
   //! Decode a string using the server (network) decoding.
   QString serverDecode(const QByteArray &string) const;
 
-  //! Decode a string using a buffer-specific encoding if one is set (and use the server encoding else).
-  QString bufferDecode(const QString &bufferName, const QByteArray &string) const;
+  //! Decode a string using a channel-specific encoding if one is set (and use the standard encoding else).
+  QString channelDecode(const QString &channelName, const QByteArray &string) const;
 
-  //! Decode a string using a IrcUser specific encoding, if one exists (using the server encoding else).
+  //! Decode a string using an IrcUser-specific encoding, if one exists (using the standaed encoding else).
   QString userDecode(const QString &userNick, const QByteArray &string) const;
 
   //! Encode a string using the server (network) encoding.
   QByteArray serverEncode(const QString &string) const;
 
-  //! Encode a string using the buffer-specific encoding, if set, and use the server encoding else.
-  QByteArray bufferEncode(const QString &bufferName, const QString &string) const;
+  //! Encode a string using the channel-specific encoding, if set, and use the standard encoding else.
+  QByteArray channelEncode(const QString &channelName, const QString &string) const;
 
-  //! Encode a string using the user-specific encoding, if set, and use the server encoding else.
+  //! Encode a string using the user-specific encoding, if set, and use the standard encoding else.
   QByteArray userEncode(const QString &userNick, const QString &string) const;
 
 public slots:
   // void setServerOptions();
-  void connectToIrc();
+  void connectToIrc(bool reconnecting = false);
   void disconnectFromIrc();
   void userInput(BufferInfo bufferInfo, QString msg);
 
@@ -92,6 +92,8 @@ public slots:
 
 private slots:
   void sendPerform();
+  void autoReconnectSettingsChanged();
+  void doAutoReconnect();
 
 signals:
   // #void networkState(QString net, QVariantMap data);
@@ -105,6 +107,8 @@ signals:
   void connectionInitialized(); ///< Emitted after receipt of 001 to indicate that we can now send data to the IRC server
   void connectionError(const QString &errorMsg);
 
+  void quitRequested(NetworkId networkId);
+
   //void queryRequested(QString network, QString nick);
 
 
@@ -130,6 +134,9 @@ private:
 
   QVariant _previousState;
 
+  QTimer _autoReconnectTimer;
+  int _autoReconnectCount;
+
   class ParseError : public Exception {
   public:
     ParseError(QString cmd, QString prefix, QStringList params);
@@ -139,7 +146,6 @@ private:
   public:
     UnknownCmdError(QString cmd, QString prefix, QStringList params);
   };
-    
 };
 
 #endif