added key map
authorJohannes Huber <johu@gmx.de>
Thu, 25 Feb 2010 18:20:45 +0000 (19:20 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 22 Jul 2010 07:37:52 +0000 (09:37 +0200)
src/common/network.cpp
src/common/network.h

index d7b2149..5dccc18 100644 (file)
@@ -475,6 +475,13 @@ NetworkInfo Network::networkInfoFromPreset(const QString &networkName) {
   return info;
 }
 
+QByteArray Network::bufferKey(const QString &recipient) const {
+  return _keyHash[recipient.toLower()];
+}
+
+void Network::setBufferKey(const QString &recipient, const QByteArray &key) {
+  _keyHash[recipient.toLower()] = key;
+}
 
 // ====================
 //  Public Slots:
index f0bd112..4e4d60d 100644 (file)
@@ -29,6 +29,7 @@
 #include <QVariantMap>
 #include <QPointer>
 #include <QMutex>
+#include <QByteArray>
 
 #include "types.h"
 #include "util.h"
@@ -214,6 +215,10 @@ public:
   static QStringList presetDefaultChannels(const QString &networkName);
   static NetworkInfo networkInfoFromPreset(const QString &networkName);
 
+  // Blowfish stuff
+  QByteArray bufferKey(const QString &recipient) const;
+  void setBufferKey(const QString &recipient, const QByteArray &key);
+
 public slots:
   void setNetworkName(const QString &networkName);
   void setCurrentServer(const QString &currentServer);
@@ -340,6 +345,9 @@ private:
   QHash<QString, IrcChannel *> _ircChannels; // stores all known channels
   QHash<QString, QString> _supports;  // stores results from RPL_ISUPPORT
 
+  // Blowfish key map
+  QHash<QString, QByteArray> _keyHash;
+  
   ServerList _serverList;
   bool _useRandomServer;
   QStringList _perform;