projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not allow keyx to be used on channels.
[quassel.git]
/
src
/
core
/
coreuserinputhandler.cpp
diff --git
a/src/core/coreuserinputhandler.cpp
b/src/core/coreuserinputhandler.cpp
index
87c497d
..
12c13cd
100644
(file)
--- 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,
parms.prepend(bufferInfo.bufferName());
else if (parms.count() != 1) {
emit displayMsg(Message::Info, bufname,
- tr("[usage] /keyx [<nick
|channel
>] Initiates a DH1080 key exchange with the target."));
+ tr("[usage] /keyx [<nick>] Initiates a DH1080 key exchange with the target."));
return;
}
QString target = parms.at(0);
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;
Cipher *cipher = network()->cipher(target);
if (!cipher) // happens when there is no CoreIrcChannel for the target
return;
@@
-657,7
+662,7
@@
void CoreUserInputHandler::handleShowkey(const BufferInfo &bufferInfo, const QSt
return;
}
return;
}
- emit displayMsg(Message::Info, bufname, tr("The key for %1 is %2
").arg(target).arg(
QString(key)));
+ emit displayMsg(Message::Info, bufname, tr("The key for %1 is %2
:%3").arg(target, network()->cipherUsesCBC(target) ? "CBC" : "ECB",
QString(key)));
#else
Q_UNUSED(msg)
#else
Q_UNUSED(msg)