From dd69349ca91776432a4a53aa4d18dd8ef018cd26 Mon Sep 17 00:00:00 2001 From: Shane Synan Date: Thu, 13 Apr 2017 19:26:08 -0500 Subject: [PATCH] core: Fix timestamps in manual /away messages Change handleAway() to NOT skip timestamp formatting by default. This is the intended behavior as the one situation where it should be skipped already manually sets skipFormatting to true. All other places deal with unformatted input strings (either from identity or set by the client). Remove now-redundant call to formatCurrentDateTimeInString() as the handleAway command now uses it by default. Fixes sending "/away Away since %%hh:mm%% on %%dd.MM%%" on the client not getting formatted as "Away since 07:43 on 22.10" or some such. Resolves GH-288. --- src/core/coresession.cpp | 3 ++- src/core/coreuserinputhandler.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 39bd69b7..2ca9627c 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -662,8 +662,9 @@ void CoreSession::clientsDisconnected() if (identity->detachAwayEnabled() && !me->isAway()) { if (!identity->detachAwayReason().isEmpty()) - awayReason = formatCurrentDateTimeInString(identity->detachAwayReason()); + awayReason = identity->detachAwayReason(); net->setAutoAwayActive(true); + // Allow handleAway() to format the current date/time in the string. net->userInputHandler()->handleAway(BufferInfo(), awayReason); } } diff --git a/src/core/coreuserinputhandler.h b/src/core/coreuserinputhandler.h index b13fd394..5c9dcd6e 100644 --- a/src/core/coreuserinputhandler.h +++ b/src/core/coreuserinputhandler.h @@ -49,7 +49,7 @@ public slots: * @param[in] skipFormatting If true, skip timestamp formatting codes (e.g. if already done) */ void handleAway(const BufferInfo &bufferInfo, const QString &text, - const bool skipFormatting = true); + const bool skipFormatting = false); void handleBan(const BufferInfo &bufferInfo, const QString &text); void handleUnban(const BufferInfo &bufferInfo, const QString &text); void handleCtcp(const BufferInfo &bufferInfo, const QString &text); -- 2.20.1