diff options
author | Adam <Adam@anope.org> | 2011-09-03 14:39:12 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-09-03 14:39:12 -0400 |
commit | 3815e7d61ed07ce3d06c8c8db72128ef5ceaf39c (patch) | |
tree | 95ea90e88e1587f5ab4649e4592f649a918d1607 /src/users.cpp | |
parent | 30e6fc07d6f0c531a35602d62cfc550c5e7a5ff1 (diff) |
Translate whole messages before splitting them up to send to users
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp index 9e4b935fc..81809e288 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -233,20 +233,21 @@ void User::SendMessage(BotInfo *source, const char *fmt, ...) void User::SendMessage(BotInfo *source, Anope::string msg) { + const char *translated_message = translate(this, msg.c_str()); + /* Send privmsg instead of notice if: * - UsePrivmsg is enabled * - The user is not registered and NSDefMsg is enabled * - The user is registered and has set /ns set msg on */ - sepstream sep(msg, '\n'); + sepstream sep(translated_message, '\n'); Anope::string tok; while (sep.GetToken(tok)) { - const char *translated_message = translate(this, tok.c_str()); if (Config->UsePrivmsg && ((!this->nc && Config->NSDefFlags.HasFlag(NI_MSG)) || (this->nc && this->nc->HasFlag(NI_MSG)))) - ircdproto->SendPrivmsg(source, this->nick, "%s", translated_message); + ircdproto->SendPrivmsg(source, this->nick, "%s", tok.c_str()); else - ircdproto->SendNotice(source, this->nick, "%s", translated_message); + ircdproto->SendNotice(source, this->nick, "%s", tok.c_str()); } } |