mirror of
https://github.com/znc/znc.git
synced 2026-07-06 09:51:25 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user