X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoreuserinputhandler.cpp;h=755e64a95d4b470db26f38f101afe72cb4765dbe;hb=1d1178f7d73ab19e62798f23c1d0cd5e0b4cdb59;hp=b616a5d65b51fc30135822dd907c64d81af108fc;hpb=dcd6c362d77ab4cb5ea73b7e54ce944a68aa3f06;p=quassel.git diff --git a/src/core/coreuserinputhandler.cpp b/src/core/coreuserinputhandler.cpp index b616a5d6..755e64a9 100644 --- a/src/core/coreuserinputhandler.cpp +++ b/src/core/coreuserinputhandler.cpp @@ -61,29 +61,38 @@ void CoreUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const Q // ==================== // Public Slots // ==================== -void CoreUserInputHandler::handleAway(const BufferInfo &bufferInfo, const QString &msg) +void CoreUserInputHandler::handleAway(const BufferInfo &bufferInfo, const QString &msg, + const bool skipFormatting) { Q_UNUSED(bufferInfo) if (msg.startsWith("-all")) { if (msg.length() == 4) { - coreSession()->globalAway(); + coreSession()->globalAway(QString(), skipFormatting); return; } Q_ASSERT(msg.length() > 4); if (msg[4] == ' ') { - coreSession()->globalAway(msg.mid(5)); + coreSession()->globalAway(msg.mid(5), skipFormatting); return; } } - issueAway(msg); + issueAway(msg, true /* force away */, skipFormatting); } -void CoreUserInputHandler::issueAway(const QString &msg, bool autoCheck) +void CoreUserInputHandler::issueAway(const QString &msg, bool autoCheck, const bool skipFormatting) { QString awayMsg = msg; IrcUser *me = network()->me(); + // Only apply timestamp formatting when requested + // This avoids re-processing any existing away message when the core restarts, so chained escape + // percent signs won't get down-processed. + if (!skipFormatting) { + // Apply the timestamp formatting to the away message (if empty, nothing will happen) + awayMsg = formatCurrentDateTimeInString(awayMsg); + } + // if there is no message supplied we have to check if we are already away or not if (autoCheck && msg.isEmpty()) { if (me && !me->isAway()) {