X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.h;h=359d032e4a86837cce34beebf16af48942cc415a;hb=aca9592be427fb2ac41249e8fc062d7a7e26d160;hp=3b31f0ded6484eb299983bc75fc808e3e3a035a1;hpb=76db8cdfbeffaaba359c8e80cf2146da9e9e7f8a;p=quassel.git diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index 3b31f0de..359d032e 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -40,6 +40,8 @@ #include "coresession.h" +#include + class CoreIdentity; class CoreUserInputHandler; class CoreIgnoreListManager; @@ -82,6 +84,9 @@ public: inline QString channelKey(const QString &channel) const { return _channelKeys.value(channel.toLower(), QString()); } + inline QByteArray readChannelCipherKey(const QString &channel) const { return _cipherKeys.value(channel.toLower()); } + inline void storeChannelCipherKey(const QString &channel, const QByteArray &key) { _cipherKeys[channel.toLower()] = key; } + inline bool isAutoWhoInProgress(const QString &channel) const { return _autoWhoPending.value(channel.toLower(), 0); } inline UserId userId() const { return _coreSession->user(); } @@ -93,6 +98,8 @@ public: inline quint16 localPort() const { return socket.localPort(); } inline quint16 peerPort() const { return socket.peerPort(); } + QList> splitMessage(const QString &cmd, const QString &message, std::function(QString &)> cmdGenerator); + public slots: virtual void setMyNick(const QString &mynick); @@ -112,6 +119,7 @@ public slots: void userInput(BufferInfo bufferInfo, QString msg); void putRawLine(QByteArray input); void putCmd(const QString &cmd, const QList ¶ms, const QByteArray &prefix = QByteArray()); + void putCmd(const QString &cmd, const QList> ¶ms, const QByteArray &prefix = QByteArray()); void setChannelJoined(const QString &channel); void setChannelParted(const QString &channel); @@ -123,6 +131,7 @@ public slots: Cipher *cipher(const QString &recipient); QByteArray cipherKey(const QString &recipient) const; void setCipherKey(const QString &recipient, const QByteArray &key); + bool cipherUsesCBC(const QString &target); #endif void setAutoWhoEnabled(bool enabled); @@ -173,7 +182,7 @@ private slots: void socketHasData(); void socketError(QAbstractSocket::SocketError); void socketInitialized(); - inline void socketCloseTimeout() { socket.disconnectFromHost(); } + inline void socketCloseTimeout() { socket.abort(); } void socketDisconnected(); void socketStateChanged(QAbstractSocket::SocketState); void networkInitialized(); @@ -225,6 +234,7 @@ private: QTimer _pingTimer; uint _lastPingTime; uint _pingCount; + bool _sendPings; QStringList _autoWhoQueue; QHash _autoWhoPending; @@ -238,7 +248,7 @@ private: QString _requestedUserModes; // 2 strings separated by a '-' character. first part are requested modes to add, the second to remove - // Blowfish key map + // List of blowfish keys for channels QHash _cipherKeys; };