mirror of
https://github.com/anope/anope.git
synced 2026-06-25 20:16:36 +02:00
Made the help command description code more sane
This commit is contained in:
+15
-5
@@ -234,17 +234,27 @@ void User::SendMessage(BotInfo *source, const char *fmt, ...)
|
||||
}
|
||||
}
|
||||
|
||||
void User::SendMessage(BotInfo *source, const Anope::string &msg)
|
||||
void User::SendMessage(BotInfo *source, Anope::string msg)
|
||||
{
|
||||
if (Config->UseStrictPrivMsg)
|
||||
msg = msg.replace_all_cs("%R", "/");
|
||||
else
|
||||
msg = msg.replace_all_cs("%R", "/msg ");
|
||||
|
||||
/* 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
|
||||
*/
|
||||
if (Config->UsePrivmsg && ((!this->nc && Config->NSDefFlags.HasFlag(NI_MSG)) || (this->nc && this->nc->HasFlag(NI_MSG))))
|
||||
ircdproto->SendPrivmsg(source, this->nick, "%s", msg.c_str());
|
||||
else
|
||||
ircdproto->SendNotice(source, this->nick, "%s", msg.c_str());
|
||||
sepstream sep(msg, '\n');
|
||||
Anope::string tok;
|
||||
while (sep.GetToken(tok))
|
||||
{
|
||||
if (Config->UsePrivmsg && ((!this->nc && Config->NSDefFlags.HasFlag(NI_MSG)) || (this->nc && this->nc->HasFlag(NI_MSG))))
|
||||
ircdproto->SendPrivmsg(source, this->nick, "%s", tok.c_str());
|
||||
else
|
||||
ircdproto->SendNotice(source, this->nick, "%s", tok.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
/** Collides a nick.
|
||||
|
||||
Reference in New Issue
Block a user