X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoreuserinputhandler.cpp;h=29efd4bd2eb312a0216ef15baf03c8b5ab62e898;hb=f18d6c40cd704e26734a77b371ae2c4a284bee38;hp=8878340824c53b1187c7cacae575ca8782894b25;hpb=6e7b4039cde65c37f711c8c4c0b0b405aa9054e1;p=quassel.git diff --git a/src/core/coreuserinputhandler.cpp b/src/core/coreuserinputhandler.cpp index 88783408..29efd4bd 100644 --- a/src/core/coreuserinputhandler.cpp +++ b/src/core/coreuserinputhandler.cpp @@ -474,7 +474,6 @@ 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 (params[0] == "-reset" && params.count() == 1) { network()->resetPersistentModes(); @@ -483,7 +482,11 @@ void CoreUserInputHandler::handleMode(const BufferInfo &bufferInfo, const QStrin return; } if (!network()->isChannelName(params[0]) && !network()->isMyNick(params[0])) - params.prepend(bufferInfo.bufferName()); + // 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]); }