From: Bas Pape Date: Sun, 25 Aug 2013 16:41:33 +0000 (+0200) Subject: Do not allow keyx to be used on channels. X-Git-Tag: 0.10-beta1~123 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=6d77f281c4e9862ab00a00cedf2de941046f1421;ds=sidebyside Do not allow keyx to be used on channels. Given that incoming exchanges are ignored for channels, it makes no sense to send them either. --- diff --git a/src/core/coreuserinputhandler.cpp b/src/core/coreuserinputhandler.cpp index 24d5f8b8..12c13cdc 100644 --- a/src/core/coreuserinputhandler.cpp +++ b/src/core/coreuserinputhandler.cpp @@ -368,12 +368,17 @@ void CoreUserInputHandler::handleKeyx(const BufferInfo &bufferInfo, const QStrin parms.prepend(bufferInfo.bufferName()); else if (parms.count() != 1) { emit displayMsg(Message::Info, bufname, - tr("[usage] /keyx [] Initiates a DH1080 key exchange with the target.")); + tr("[usage] /keyx [] Initiates a DH1080 key exchange with the target.")); return; } QString target = parms.at(0); + if (network()->isChannelName(target)) { + emit displayMsg(Message::Info, bufname, tr("It is only possible to exchange keys in a query buffer.")); + return; + } + Cipher *cipher = network()->cipher(target); if (!cipher) // happens when there is no CoreIrcChannel for the target return;