diff options
author | Adam <Adam@anope.org> | 2010-10-07 18:25:24 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-10-07 18:25:24 -0400 |
commit | 7df71750cb6f3b463dc7bd3b7008931ffbf242fb (patch) | |
tree | 57a1de03fb45f73c0fc3f75409eb8b1a4c94e5df /src/channels.cpp | |
parent | b4f675adcf9c52a5aaae36a2aeba962f2dc0d07a (diff) |
Log the kicker as the source of kicking log messages, not the target
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index b3a5a8d7f..756140cef 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -914,27 +914,31 @@ void Channel::SetModesInternal(User *setter, const Anope::string &mode, bool Enf */ void Channel::KickInternal(const Anope::string &source, const Anope::string &nick, const Anope::string &reason) { + User *sender = finduser(source); BotInfo *bi = NULL; if (!Config->s_BotServ.empty() && this->ci) bi = findbot(nick); - User *user = bi ? bi : finduser(nick); - if (!user) + User *target = bi ? bi : finduser(nick); + if (!target) { Log() << "Channel::KickInternal got a nonexistent user " << nick << " on " << this->name << ": " << reason; return; } - Log(user, this, "kick") << "by " << source << " (" << reason << ")"; + if (sender) + Log(sender, this, "kick") << "kicked " << target->nick << " (" << reason << ")"; + else + Log(target, this, "kick") << "was kicked by " << source << " (" << reason << ")"; Anope::string chname = this->name; - if (user->FindChannel(this)) + if (target->FindChannel(this)) { - FOREACH_MOD(I_OnUserKicked, OnUserKicked(this, user, source, reason)); - this->DeleteUser(user); + FOREACH_MOD(I_OnUserKicked, OnUserKicked(this, target, source, reason)); + this->DeleteUser(target); } else - Log() << "Channel::KickInternal got kick for user " << user->nick << " who isn't on channel " << this->name << " ?"; + Log() << "Channel::KickInternal got kick for user " << target->nick << " from " << (sender ? sender->nick : source) << " who isn't on channel " << this->name; /* Bots get rejoined */ if (bi) |