diff options
author | Adam <Adam@anope.org> | 2017-01-23 12:35:14 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-01-23 12:35:14 -0500 |
commit | 16ca76c2e7ab287e480185fbb03a0bb438351eda (patch) | |
tree | dfb25534afa2352b65b2ee707086cb5eecc96fbb /modules/nickserv/identify.cpp | |
parent | ff030c1eb7c3764f9add2a689479e84d616cabcb (diff) |
Make log system use newer format strings
Also allow log messages to be translatable
Diffstat (limited to 'modules/nickserv/identify.cpp')
-rw-r--r-- | modules/nickserv/identify.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/nickserv/identify.cpp b/modules/nickserv/identify.cpp index 13e578b69..a88c9c90b 100644 --- a/modules/nickserv/identify.cpp +++ b/modules/nickserv/identify.cpp @@ -42,9 +42,10 @@ class NSIdentifyRequestListener : public NickServ::IdentifyRequestListener } if (u->IsIdentified()) - Log(LOG_COMMAND, source, cmd) << "to log out of account " << u->Account()->GetDisplay(); + cmd->logger.Command(LogType::COMMAND, source, _("{source} used {command} to log out of account {0}"), u->Account()->GetDisplay()); + + cmd->logger.Command(LogType::COMMAND, source, _("{source} used {command} and identified for account {0}"), na->GetAccount()->GetDisplay()); - Log(LOG_COMMAND, source, cmd) << "and identified for account " << na->GetAccount()->GetDisplay(); source.Reply(_("Password accepted - you are now recognized as \002{0}\002."), na->GetAccount()->GetDisplay()); u->Identify(na); } @@ -55,14 +56,20 @@ class NSIdentifyRequestListener : public NickServ::IdentifyRequestListener return; bool accountexists = NickServ::FindNick(req->GetAccount()) != NULL; - Log(LOG_COMMAND, source, cmd) << "and failed to identify to" << (accountexists ? " " : " nonexistent ") << "account " << req->GetAccount(); + if (!accountexists) + cmd->logger.Command(LogType::COMMAND, source, _("{source} used {command} and failed to identify to nonexistent account {0}"), req->GetAccount()); + else + cmd->logger.Command(LogType::COMMAND, source, _("{source} used {command} and failed to identify to account {0}"), req->GetAccount()); + if (accountexists) { source.Reply(_("Password incorrect.")); source.GetUser()->BadPassword(); } else + { source.Reply("\002{0}\002 isn't registered.", req->GetAccount()); + } } }; |