diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-06 21:30:22 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-06 21:30:22 +0000 |
commit | e34448092eb668aec1ea73e7d5aab0ef536b5520 (patch) | |
tree | 7a08f5ce0d87b115150911cbd6e93d48cc015aea /src | |
parent | 9124a3be5347317918d9fb95991bdb2dd3818c99 (diff) |
Messaging service@server.name works again as it should
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2737 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/messages.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/messages.c b/src/messages.c index ae0d078a5..50d168838 100644 --- a/src/messages.c +++ b/src/messages.c @@ -148,13 +148,16 @@ int m_privmsg(const char *source, const std::string &receiver, const char *msg) /* If a server is specified (nick@server format), make sure it matches * us, and strip it off. */ - unsigned s = receiver.find('@'); + std::string botname = receiver; + size_t s = receiver.find('@'); if (s != std::string::npos) { - ci::string servername(receiver.begin() + s, receiver.end()); + ci::string servername(receiver.begin() + s + 1, receiver.end()); + botname = botname.erase(s); if (servername != Config.ServerName) return MOD_CONT; - } else if (Config.UseStrictPrivMsg) { + } + else if (Config.UseStrictPrivMsg) { if (debug) { alog("Ignored PRIVMSG without @ from %s", source); } @@ -165,7 +168,7 @@ int m_privmsg(const char *source, const std::string &receiver, const char *msg) starttime = time(NULL); - bi = findbot(receiver); + bi = findbot(botname); if (bi) { |