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 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);
void socketError(QAbstractSocket::SocketError);
void socketConnected();
void socketInitialized();
+ void socketCloseTimeout();
void socketDisconnected();
void socketStateChanged(QAbstractSocket::SocketState);
void setConnectionState(Network::ConnectionState);
void sslErrors(const QList<QSslError> &errors);
#endif
+ void fillBucketAndProcessQueue();
+
private:
#ifndef QT_NO_OPENSSL
QSslSocket socket;
QHash<QString, QString> _channelKeys; // stores persistent channels and their passwords, if any
QTimer _autoReconnectTimer;
+
int _autoReconnectCount;
+ QTimer _socketCloseTimer;
+
+ bool _quitRequested;
+
bool _previousConnectionAttemptFailed;
int _lastUsedServerlistIndex;
bool _autoWhoEnabled;
QStringList _autoWhoQueue;
- QSet<QString> _autoWhoInProgress;
+ QHash<QString, int> _autoWhoInProgress;
int _autoWhoInterval;
int _autoWhoNickLimit;
int _autoWhoDelay;
QTimer _autoWhoTimer, _autoWhoCycleTimer;
+ QTimer _tokenBucketTimer;
+ int _messagesPerSecond; // token refill speed
+ int _burstSize; // size of the token bucket
+ int _tokenBucket; // the virtual bucket that holds the tokens
+ QList<QByteArray> _msgQueue;
+
+ int _maxMsgSize;
+
+ void writeToSocket(QByteArray s);
+
+
class ParseError : public Exception {
public: