X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoreuserinputhandler.cpp;h=29efd4bd2eb312a0216ef15baf03c8b5ab62e898;hb=f12d6496251729f7d21f4fbcb0814dec7fba4b75;hp=c30a2fa8c36d5d535ddd14c487c52a583284f37e;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/core/coreuserinputhandler.cpp b/src/core/coreuserinputhandler.cpp index c30a2fa8..29efd4bd 100644 --- a/src/core/coreuserinputhandler.cpp +++ b/src/core/coreuserinputhandler.cpp @@ -474,17 +474,21 @@ void CoreUserInputHandler::handleMode(const BufferInfo &bufferInfo, const QStrin Q_UNUSED(bufferInfo) QStringList params = msg.split(' ', QString::SkipEmptyParts); - // if the first argument is neither a channel nor us (user modes are only to oneself) the current buffer is assumed to be the target if (!params.isEmpty()) { - if (!network()->isChannelName(params[0]) && !network()->isMyNick(params[0])) - params.prepend(bufferInfo.bufferName()); - if (network()->isMyNick(params[0]) && params.count() == 2) - network()->updateIssuedModes(params[1]); if (params[0] == "-reset" && params.count() == 1) { - // FIXME: give feedback to the user (I don't want to add new strings right now) network()->resetPersistentModes(); + emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", + tr("Your persistent modes have been reset.")); return; } + if (!network()->isChannelName(params[0]) && !network()->isMyNick(params[0])) + // If the first argument is neither a channel nor us (user modes are only to oneself) + // the current buffer is assumed to be the target. + // If the current buffer returns no name (e.g. status buffer), assume target is us. + params.prepend(!bufferInfo.bufferName().isEmpty() ? + bufferInfo.bufferName() : network()->myNick()); + if (network()->isMyNick(params[0]) && params.count() == 2) + network()->updateIssuedModes(params[1]); } // TODO handle correct encoding for buffer modes (channelEncode())