From: Matt Schatz Date: Thu, 29 Mar 2018 12:14:39 +0000 (-0600) Subject: Prepend current nickname if buffer has no name X-Git-Tag: 0.13-rc1~29 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=8a299aa68d09b6d210a8f69300b292d6ca4dad70;hp=b3fadf10c01de8f2f6eae5303e1950977b35b2ad Prepend current nickname if buffer has no name If the buffer name is blank, assume Status Buffer (or otherwise some un-named buffer?) and prepend our current nickname. Now shortcuts like '/mode +R' will work on ourself from the Status Buffer and doesn't interfere with current behaviour otherwise. --- 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]); }