summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/command.cpp9
-rw-r--r--src/users.cpp9
2 files changed, 9 insertions, 9 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 041551bd4..8a564e91a 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -27,13 +27,12 @@ void CommandSource::Reply(const char *message, ...)
void CommandSource::Reply(const Anope::string &message)
{
- sepstream sep(message, '\n');
+ const char *translated_message = translate(this->u, message.c_str());
+
+ sepstream sep(translated_message, '\n');
Anope::string tok;
while (sep.GetToken(tok))
- {
- const char *translated_message = translate(this->u, tok.c_str());
- this->reply.push_back(translated_message);
- }
+ this->reply.push_back(tok);
}
void CommandSource::DoReply()
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());
}
}