Query buffers are now automatically renamed on nickchanges.
[quassel.git] / src / core / networkconnection.h
index a7aa1fd..83dcdec 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,9 @@ public slots:
 
 private slots:
   void sendPerform();
+  void autoReconnectSettingsChanged();
+  void doAutoReconnect();
+  void nickChanged(const QString &newNick, const QString &oldNick); // this signal is inteded to rename query buffers in the storage backend
 
 signals:
   // #void networkState(QString net, QVariantMap data);
@@ -105,8 +108,10 @@ 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 queryRequested(QString network, QString nick);
+  void quitRequested(NetworkId networkId);
 
+  //void queryRequested(QString network, QString nick);
+  void nickChanged(const NetworkId &networkId, const QString &newNick, const QString &oldNick); // this signal is inteded to rename query buffers in the storage backend
 
 private slots:
   void socketHasData();
@@ -130,6 +135,9 @@ private:
 
   QVariant _previousState;
 
+  QTimer _autoReconnectTimer;
+  int _autoReconnectCount;
+
   class ParseError : public Exception {
   public:
     ParseError(QString cmd, QString prefix, QStringList params);
@@ -139,7 +147,6 @@ private:
   public:
     UnknownCmdError(QString cmd, QString prefix, QStringList params);
   };
-    
 };
 
 #endif