X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.h;h=a579e3bbac2549b9214515be4b11277167019913;hp=d30bb6e7c3781b7b8eb897c6b51fa33c61cddbb8;hb=14281719026a2d9d30667f63f3659c2c4e7e0cca;hpb=f6b9eeda207d42c99fc3e9085631722cf2ec83dc diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index d30bb6e7..a579e3bb 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -23,6 +23,7 @@ #include "network.h" #include "coreircchannel.h" +#include "coreircuser.h" #include @@ -33,12 +34,17 @@ # include #endif +#ifdef HAVE_QCA2 +# include "cipher.h" +#endif + #include "coresession.h" class CoreIdentity; class IrcServerHandler; -class UserInputHandler; +class CoreUserInputHandler; class CtcpHandler; +class CoreIgnoreListManager; class CoreNetwork : public Network { SYNCABLE_OBJECT @@ -54,8 +60,9 @@ public: inline CoreNetworkConfig *networkConfig() const { return coreSession()->networkConfig(); } inline IrcServerHandler *ircServerHandler() const { return _ircServerHandler; } - inline UserInputHandler *userInputHandler() const { return _userInputHandler; } + inline CoreUserInputHandler *userInputHandler() const { return _userInputHandler; } inline CtcpHandler *ctcpHandler() const { return _ctcpHandler; } + inline CoreIgnoreListManager *ignoreListManager() { return coreSession()->ignoreListManager(); } //! Decode a string using the server (network) decoding. inline QString serverDecode(const QByteArray &string) const { return decodeServerString(string); } @@ -106,12 +113,23 @@ public slots: void addChannelKey(const QString &channel, const QString &key); void removeChannelKey(const QString &channel); + // Blowfish stuff +#ifdef HAVE_QCA2 + Cipher *cipher(const QString &recipient) const; + QByteArray cipherKey(const QString &recipient) const; + void setCipherKey(const QString &recipient, const QByteArray &key); +#endif + void setAutoWhoEnabled(bool enabled); void setAutoWhoInterval(int interval); void setAutoWhoDelay(int delay); bool setAutoWhoDone(const QString &channel); + void updateIssuedModes(const QString &requestedModes); + void updatePersistentModes(QString addModes, QString removeModes); + void resetPersistentModes(); + Server usedServer() const; inline void resetPingTimeout() { _pingCount = 0; } @@ -132,6 +150,13 @@ signals: protected: inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new CoreIrcChannel(channelname, this); } + inline virtual IrcUser *ircUserFactory(const QString &hostmask) { return new CoreIrcUser(hostmask, this); } + +protected slots: + // TODO: remove cached cipher keys, when appropriate + //virtual void removeIrcUser(IrcUser *ircuser); + //virtual void removeIrcChannel(IrcChannel *ircChannel); + //virtual void removeChansAndUsers(); private slots: void socketHasData(); @@ -169,7 +194,7 @@ private: #endif IrcServerHandler *_ircServerHandler; - UserInputHandler *_userInputHandler; + CoreUserInputHandler *_userInputHandler; CtcpHandler *_ctcpHandler; QHash _channelKeys; // stores persistent channels and their passwords, if any @@ -201,6 +226,11 @@ private: int _burstSize; // size of the token bucket int _tokenBucket; // the virtual bucket that holds the tokens QList _msgQueue; + + QString _requestedUserModes; // 2 strings separated by a '-' character. first part are requested modes to add, the second to remove + + // Blowfish key map + QHash _cipherKeys; }; #endif //CORENETWORK_H