Indicate whether a key is set for the buffer.
[quassel.git] / src / core / coreircchannel.cpp
index a7e1b6c..7ec82b9 100644 (file)
@@ -52,6 +52,8 @@ Cipher *CoreIrcChannel::cipher() const
 
 void CoreIrcChannel::setEncrypted(bool e)
 {
+    IrcChannel::setEncrypted(e);
+
     if (!Cipher::neededFeaturesAvailable())
         return;
 
@@ -59,13 +61,6 @@ void CoreIrcChannel::setEncrypted(bool e)
         if (topic().isEmpty())
             return;
 
-        QByteArray key = qobject_cast<CoreNetwork *>(network())->cipherKey(name());
-        if (key.isEmpty())
-            return;
-
-        if (!cipher()->setKey(key))
-            return;
-
         QByteArray decrypted = cipher()->decryptTopic(topic().toAscii());
         setTopic(decodeString(decrypted));
     }