From 6aaf3ba96a089edb804ddebc91cf6f01054b97f6 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Tue, 29 Jul 2014 11:17:17 -0400 Subject: [PATCH] Add timestamp parsing to awaystore away messages Pass the given reason through CUtils::FormatTime before setting it, allows use of strftime formatting in away messages. --- modules/awaystore.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/awaystore.cpp b/modules/awaystore.cpp index a4891088..8a429d4b 100644 --- a/modules/awaystore.cpp +++ b/modules/awaystore.cpp @@ -53,12 +53,14 @@ class CAway : public CModule { void AwayCommand(const CString& sCommand) { CString sReason; + time_t curtime; + time(&curtime); if (sCommand.Token(1) != "-quiet") { - sReason = sCommand.Token(1, true); + sReason = CUtils::FormatTime(curtime, sCommand.Token(1, true), m_pUser->GetTimezone()); PutModNotice("You have been marked as away"); } else { - sReason = sCommand.Token(2, true); + sReason = CUtils::FormatTime(curtime, sCommand.Token(2, true), m_pUser->GetTimezone()); } Away(false, sReason);