summaryrefslogtreecommitdiff
path: root/src/messages.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-05-21 08:50:40 -0400
committerAdam <Adam@anope.org>2014-05-21 08:50:40 -0400
commitf627a3bacd0d058e94260dac1555790cafd9a926 (patch)
tree4ba71bf94b44ba07abc627ba0c26f3b8b94da439 /src/messages.cpp
parent5a1257b7f0b44ee3fd4639e5be288d160ceb5095 (diff)
Core prep for p10 stuff
Diffstat (limited to 'src/messages.cpp')
-rw-r--r--src/messages.cpp14
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> &params)
void Message::Mode::Run(MessageSource &source, const std::vector<Anope::string> &params)
{
+ 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> &param
* 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> &param
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> &params)
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());