From e34448092eb668aec1ea73e7d5aab0ef536b5520 Mon Sep 17 00:00:00 2001 From: Adam- Date: Wed, 6 Jan 2010 21:30:22 +0000 Subject: [PATCH] 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 --- src/messages.c | 11 +++++++---- 1 file 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) {