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.9.1~12 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=110034347250de79a59a3a475b1b1350107d01dc 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;