summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/coremods/core_channel/cmd_kick.cpp7
-rw-r--r--src/modules/m_channames.cpp8
-rw-r--r--src/modules/m_clearchan.cpp7
3 files changed, 12 insertions, 10 deletions
diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp
index 9039d8551..d646d9a45 100644
--- a/src/coremods/core_channel/cmd_kick.cpp
+++ b/src/coremods/core_channel/cmd_kick.cpp
@@ -66,12 +66,13 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
}
}
- Membership* const memb = c->GetUser(u);
- if (!memb)
+ const UserMembIter victimiter = c->userlist.find(u);
+ if (victimiter == c->userlist.end())
{
user->WriteNumeric(ERR_USERNOTINCHANNEL, "%s %s :They are not on that channel", u->nick.c_str(), c->name.c_str());
return CMD_FAILURE;
}
+ Membership* const memb = victimiter->second;
if (parameters.size() > 2)
{
@@ -112,7 +113,7 @@ CmdResult CommandKick::Handle (const std::vector<std::string>& parameters, User
}
}
- c->KickUser(user, u, reason);
+ c->KickUser(user, victimiter, reason);
return CMD_SUCCESS;
}
diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp
index 5a38fbbc2..3a27cab73 100644
--- a/src/modules/m_channames.cpp
+++ b/src/modules/m_channames.cpp
@@ -82,14 +82,14 @@ class ModuleChannelNames : public Module
ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
}
- const UserMembList* users = c->GetUsers();
- for(UserMembCIter j = users->begin(); j != users->end(); )
+ UserMembList& users = c->userlist;
+ for (UserMembIter j = users.begin(); j != users.end(); )
{
if (IS_LOCAL(j->first))
{
// KickUser invalidates the iterator
- UserMembCIter it = j++;
- c->KickUser(ServerInstance->FakeClient, it->first, "Channel name no longer valid");
+ UserMembIter it = j++;
+ c->KickUser(ServerInstance->FakeClient, it, "Channel name no longer valid");
}
else
++j;
diff --git a/src/modules/m_clearchan.cpp b/src/modules/m_clearchan.cpp
index 27f8ec32f..d7dceaf95 100644
--- a/src/modules/m_clearchan.cpp
+++ b/src/modules/m_clearchan.cpp
@@ -93,10 +93,11 @@ class CommandClearChan : public Command
std::string mask;
// Now remove all local non-opers from the channel
- const UserMembList* users = chan->GetUsers();
- for (UserMembCIter i = users->begin(); i != users->end(); )
+ UserMembList& users = chan->userlist;
+ for (UserMembIter i = users.begin(); i != users.end(); )
{
User* curr = i->first;
+ const UserMembIter currit = i;
++i;
if (!IS_LOCAL(curr) || curr->IsOper())
@@ -105,7 +106,7 @@ class CommandClearChan : public Command
// If kicking users, remove them and skip the QuitUser()
if (kick)
{
- chan->KickUser(ServerInstance->FakeClient, curr, reason);
+ chan->KickUser(ServerInstance->FakeClient, currit, reason);
continue;
}