Replace {from,to}Ascii with {from,to}Latin1
[quassel.git] / src / core / coreircchannel.cpp
index a7e1b6c..4f2f4f3 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2013 by the Quassel Project                        *
+ *   Copyright (C) 2005-2014 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -52,6 +52,8 @@ Cipher *CoreIrcChannel::cipher() const
 
 void CoreIrcChannel::setEncrypted(bool e)
 {
+    IrcChannel::setEncrypted(e);
+
     if (!Cipher::neededFeaturesAvailable())
         return;
 
@@ -59,14 +61,7 @@ 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());
+        QByteArray decrypted = cipher()->decryptTopic(topic().toLatin1());
         setTopic(decodeString(decrypted));
     }
 }