diff options
author | Adam <Adam@anope.org> | 2014-05-21 08:50:40 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-05-21 08:50:40 -0400 |
commit | f627a3bacd0d058e94260dac1555790cafd9a926 (patch) | |
tree | 4ba71bf94b44ba07abc627ba0c26f3b8b94da439 /src/messages.cpp | |
parent | 5a1257b7f0b44ee3fd4639e5be288d160ceb5095 (diff) |
Core prep for p10 stuff
Diffstat (limited to 'src/messages.cpp')
-rw-r--r-- | src/messages.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/messages.cpp b/src/messages.cpp index 8e92d19c2..d6fd99143 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -208,19 +208,23 @@ void Kill::Run(MessageSource &source, const std::vector<Anope::string> ¶ms) void Message::Mode::Run(MessageSource &source, const std::vector<Anope::string> ¶ms) { + Anope::string buf; + for (unsigned i = 1; i < params.size(); ++i) + buf += " " + params[i]; + if (IRCD->IsChannelValid(params[0])) { Channel *c = Channel::Find(params[0]); if (c) - c->SetModesInternal(source, params[1], 0); + c->SetModesInternal(source, buf.substr(1), 0); } else { User *u = User::Find(params[0]); if (u) - u->SetModesInternal(source, "%s", params[1].c_str()); + u->SetModesInternal(source, "%s", buf.substr(1).c_str()); } } @@ -313,10 +317,12 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m * us, and strip it off. */ Anope::string botname = receiver; size_t s = receiver.find('@'); + bool nick_only = false; if (s != Anope::string::npos) { Anope::string servername(receiver.begin() + s + 1, receiver.end()); botname = botname.substr(0, s); + nick_only = true; if (!servername.equals_ci(Me->GetName())) return; } @@ -330,7 +336,7 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m return; } - BotInfo *bi = BotInfo::Find(botname); + BotInfo *bi = BotInfo::Find(botname, nick_only); if (bi) { @@ -469,7 +475,7 @@ void Whois::Run(MessageSource &source, const std::vector<Anope::string> ¶ms) if (u && u->server == Me) { - const BotInfo *bi = BotInfo::Find(u->nick); + const BotInfo *bi = BotInfo::Find(u->GetUID()); IRCD->SendNumeric(311, source.GetSource(), "%s %s %s * :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->realname.c_str()); if (bi) IRCD->SendNumeric(307, source.GetSource(), "%s :is a registered nick", bi->nick.c_str()); |