summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_who.cpp5
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules.cpp4
-rw-r--r--src/modules/m_auditorium.cpp8
-rw-r--r--src/modules/m_channames.cpp4
-rw-r--r--src/modules/m_check.cpp4
-rw-r--r--src/modules/m_clearchan.cpp8
-rw-r--r--src/modules/m_deaf.cpp4
-rw-r--r--src/modules/m_delayjoin.cpp8
-rw-r--r--src/modules/m_delaymsg.cpp4
-rw-r--r--src/modules/m_hostcycle.cpp4
-rw-r--r--src/modules/m_httpd_stats.cpp6
-rw-r--r--src/modules/m_ircv3.cpp12
-rw-r--r--src/modules/m_repeat.cpp4
-rw-r--r--src/modules/m_silence.cpp4
-rw-r--r--src/modules/m_spanningtree/netburst.cpp4
-rw-r--r--src/modules/m_spanningtree/utils.cpp5
-rw-r--r--src/modules/m_sslmodes.cpp4
-rw-r--r--src/users.cpp8
19 files changed, 51 insertions, 53 deletions
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index 6f4bc088e..d39c07520 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -325,9 +325,8 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
bool inside = ch->HasUser(user);
/* who on a channel. */
- const UserMembList *cu = ch->GetUsers();
-
- for (UserMembCIter i = cu->begin(); i != cu->end(); i++)
+ const UserMembList& cu = ch->GetUsers();
+ for (UserMembCIter i = cu.begin(); i != cu.end(); ++i)
{
/* None of this applies if we WHO ourselves */
if (user != i->first)
diff --git a/src/mode.cpp b/src/mode.cpp
index 3d2b8e5c4..52d7d4fb5 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -915,8 +915,8 @@ void ModeHandler::RemoveMode(Channel* channel, irc::modestacker& stack)
void PrefixMode::RemoveMode(Channel* chan, irc::modestacker& stack)
{
- const UserMembList* userlist = chan->GetUsers();
- for (UserMembCIter i = userlist->begin(); i != userlist->end(); ++i)
+ const UserMembList& userlist = chan->GetUsers();
+ for (UserMembCIter i = userlist.begin(); i != userlist.end(); ++i)
{
if (i->second->hasMode(this->GetModeChar()))
stack.Push(this->GetModeChar(), i->first->nick);
diff --git a/src/modules.cpp b/src/modules.cpp
index edcb243e2..62bdedcfd 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -391,8 +391,8 @@ void ModuleManager::DoSafeUnload(Module* mod)
++c;
mod->OnCleanup(TYPE_CHANNEL, chan);
chan->doUnhookExtensions(items);
- const UserMembList* users = chan->GetUsers();
- for(UserMembCIter mi = users->begin(); mi != users->end(); mi++)
+ const UserMembList& users = chan->GetUsers();
+ for (UserMembCIter mi = users.begin(); mi != users.end(); ++mi)
mi->second->doUnhookExtensions(items);
}
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp
index 60bdd2582..40226d002 100644
--- a/src/modules/m_auditorium.cpp
+++ b/src/modules/m_auditorium.cpp
@@ -103,8 +103,8 @@ class ModuleAuditorium : public Module
if (IsVisible(memb))
return;
- const UserMembList* users = memb->chan->GetUsers();
- for(UserMembCIter i = users->begin(); i != users->end(); i++)
+ const UserMembList& users = memb->chan->GetUsers();
+ for (UserMembCIter i = users.begin(); i != users.end(); ++i)
{
if (IS_LOCAL(i->first) && !CanSee(i->first, memb))
excepts.insert(i->first);
@@ -140,8 +140,8 @@ class ModuleAuditorium : public Module
// this channel should not be considered when listing my neighbors
i = include.erase(i);
// however, that might hide me from ops that can see me...
- const UserMembList* users = memb->chan->GetUsers();
- for(UserMembCIter j = users->begin(); j != users->end(); j++)
+ const UserMembList& users = memb->chan->GetUsers();
+ for(UserMembCIter j = users.begin(); j != users.end(); ++j)
{
if (IS_LOCAL(j->first) && CanSee(j->first, memb))
exception[j->first] = true;
diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp
index 3a27cab73..1eb080ada 100644
--- a/src/modules/m_channames.cpp
+++ b/src/modules/m_channames.cpp
@@ -132,8 +132,8 @@ class ModuleChannelNames : public Module
{
if (badchan)
{
- const UserMembList* users = memb->chan->GetUsers();
- for(UserMembCIter i = users->begin(); i != users->end(); i++)
+ const UserMembList& users = memb->chan->GetUsers();
+ for (UserMembCIter i = users.begin(); i != users.end(); ++i)
if (i->first != memb->user)
except_list.insert(i->first);
}
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 35901f8d5..a2c0b2e2c 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -224,10 +224,10 @@ class CommandCheck : public Command
/* now the ugly bit, spool current members of a channel. :| */
- const UserMembList *ulist= targchan->GetUsers();
+ const UserMembList& ulist = targchan->GetUsers();
/* note that unlike /names, we do NOT check +i vs in the channel */
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
+ for (UserMembCIter i = ulist.begin(); i != ulist.end(); ++i)
{
/*
* Unlike Asuka, I define a clone as coming from the same host. --w00t
diff --git a/src/modules/m_clearchan.cpp b/src/modules/m_clearchan.cpp
index d7dceaf95..69ae00800 100644
--- a/src/modules/m_clearchan.cpp
+++ b/src/modules/m_clearchan.cpp
@@ -170,8 +170,8 @@ class ModuleClearChan : public Module
}
}
- const UserMembList* users = cmd.activechan->GetUsers();
- for (UserMembCIter i = users->begin(); i != users->end(); ++i)
+ const UserMembList& users = cmd.activechan->GetUsers();
+ for (UserMembCIter i = users.begin(); i != users.end(); ++i)
{
LocalUser* curr = IS_LOCAL(i->first);
if (!curr)
@@ -200,8 +200,8 @@ class ModuleClearChan : public Module
{
// Hide the KICK from all non-opers
User* leaving = memb->user;
- const UserMembList* users = memb->chan->GetUsers();
- for (UserMembCIter i = users->begin(); i != users->end(); ++i)
+ const UserMembList& users = memb->chan->GetUsers();
+ for (UserMembCIter i = users.begin(); i != users.end(); ++i)
{
User* curr = i->first;
if ((IS_LOCAL(curr)) && (!curr->IsOper()) && (curr != leaving))
diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp
index 9800b32a9..5c4f7b2b6 100644
--- a/src/modules/m_deaf.cpp
+++ b/src/modules/m_deaf.cpp
@@ -66,7 +66,6 @@ class ModuleDeaf : public Module
return MOD_RES_PASSTHRU;
Channel* chan = static_cast<Channel*>(dest);
- const UserMembList *ulist = chan->GetUsers();
bool is_bypasschar = (deaf_bypasschars.find(text[0]) != std::string::npos);
bool is_bypasschar_uline = (deaf_bypasschars_uline.find(text[0]) != std::string::npos);
@@ -77,7 +76,8 @@ class ModuleDeaf : public Module
if (!deaf_bypasschars_uline.empty() && is_bypasschar)
return MOD_RES_PASSTHRU;
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
+ const UserMembList& ulist = chan->GetUsers();
+ for (UserMembCIter i = ulist.begin(); i != ulist.end(); ++i)
{
/* not +d ? */
if (!i->first->IsModeSet(m1))
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index 0a883265f..f830daf4b 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -66,8 +66,8 @@ ModeAction DelayJoinMode::OnModeChange(User* source, User* dest, Channel* channe
* Make all users visible, as +D is being removed. If we don't do this,
* they remain permanently invisible on this channel!
*/
- const UserMembList* names = channel->GetUsers();
- for (UserMembCIter n = names->begin(); n != names->end(); ++n)
+ const UserMembList& users = channel->GetUsers();
+ for (UserMembCIter n = users.begin(); n != users.end(); ++n)
creator->OnText(n->first, channel, TYPE_CHANNEL, "", 0, empty);
}
channel->SetMode(this, adding);
@@ -94,8 +94,8 @@ ModResult ModuleDelayJoin::OnNamesListItem(User* issuer, Membership* memb, std::
static void populate(CUList& except, Membership* memb)
{
- const UserMembList* users = memb->chan->GetUsers();
- for(UserMembCIter i = users->begin(); i != users->end(); i++)
+ const UserMembList& users = memb->chan->GetUsers();
+ for (UserMembCIter i = users.begin(); i != users.end(); ++i)
{
if (i->first == memb->user || !IS_LOCAL(i->first))
continue;
diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp
index 1730663c5..3384e1107 100644
--- a/src/modules/m_delaymsg.cpp
+++ b/src/modules/m_delaymsg.cpp
@@ -73,8 +73,8 @@ void DelayMsgMode::OnUnset(User* source, Channel* chan)
/*
* Clean up metadata
*/
- const UserMembList* names = chan->GetUsers();
- for (UserMembCIter n = names->begin(); n != names->end(); ++n)
+ const UserMembList& users = chan->GetUsers();
+ for (UserMembCIter n = users.begin(); n != users.end(); ++n)
jointime.set(n->second, 0);
}
diff --git a/src/modules/m_hostcycle.cpp b/src/modules/m_hostcycle.cpp
index d3646e899..87f05a9ee 100644
--- a/src/modules/m_hostcycle.cpp
+++ b/src/modules/m_hostcycle.cpp
@@ -72,8 +72,8 @@ class ModuleHostCycle : public Module
modeline.append(" ").append(user->nick);
}
- const UserMembList* ulist = c->GetUsers();
- for (UserMembList::const_iterator j = ulist->begin(); j != ulist->end(); ++j)
+ const UserMembList& ulist = c->GetUsers();
+ for (UserMembList::const_iterator j = ulist.begin(); j != ulist.end(); ++j)
{
LocalUser* u = IS_LOCAL(j->first);
if (u == NULL || u == user)
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 008c3f2cd..b160159fb 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -155,16 +155,16 @@ class ModuleHttpStats : public Module
Channel* c = i->second;
data << "<channel>";
- data << "<usercount>" << c->GetUsers()->size() << "</usercount><channelname>" << Sanitize(c->name) << "</channelname>";
+ data << "<usercount>" << c->GetUsers().size() << "</usercount><channelname>" << Sanitize(c->name) << "</channelname>";
data << "<channeltopic>";
data << "<topictext>" << Sanitize(c->topic) << "</topictext>";
data << "<setby>" << Sanitize(c->setby) << "</setby>";
data << "<settime>" << c->topicset << "</settime>";
data << "</channeltopic>";
data << "<channelmodes>" << Sanitize(c->ChanModes(true)) << "</channelmodes>";
- const UserMembList* ulist = c->GetUsers();
- for (UserMembCIter x = ulist->begin(); x != ulist->end(); ++x)
+ const UserMembList& ulist = c->GetUsers();
+ for (UserMembCIter x = ulist.begin(); x != ulist.end(); ++x)
{
Membership* memb = x->second;
data << "<channelmember><uid>" << memb->user->uuid << "</uid><privs>"
diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp
index 5cb2ab6b1..17572423d 100644
--- a/src/modules/m_ircv3.cpp
+++ b/src/modules/m_ircv3.cpp
@@ -50,8 +50,8 @@ class ModuleIRCv3 : public Module
std::set<User*> already_sent;
for (IncludeChanList::const_iterator i = chans.begin(); i != chans.end(); ++i)
{
- const UserMembList* userlist = (*i)->chan->GetUsers();
- for (UserMembList::const_iterator m = userlist->begin(); m != userlist->end(); ++m)
+ const UserMembList& userlist = (*i)->chan->GetUsers();
+ for (UserMembList::const_iterator m = userlist.begin(); m != userlist.end(); ++m)
{
/*
* Send the line if the channel member in question meets all of the following criteria:
@@ -134,8 +134,8 @@ class ModuleIRCv3 : public Module
std::string line;
std::string mode;
- const UserMembList* userlist = memb->chan->GetUsers();
- for (UserMembCIter it = userlist->begin(); it != userlist->end(); ++it)
+ const UserMembList& userlist = memb->chan->GetUsers();
+ for (UserMembCIter it = userlist.begin(); it != userlist.end(); ++it)
{
// Send the extended join line if the current member is local, has the extended-join cap and isn't excepted
User* member = IS_LOCAL(it->first);
@@ -208,8 +208,8 @@ class ModuleIRCv3 : public Module
std::string line = ":" + memb->user->GetFullHost() + " AWAY :" + memb->user->awaymsg;
- const UserMembList* userlist = memb->chan->GetUsers();
- for (UserMembCIter it = userlist->begin(); it != userlist->end(); ++it)
+ const UserMembList& userlist = memb->chan->GetUsers();
+ for (UserMembCIter it = userlist.begin(); it != userlist.end(); ++it)
{
// Send the away notify line if the current member is local, has the away-notify cap and isn't excepted
User* member = IS_LOCAL(it->first);
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp
index d8fccbffc..6ad3a6aa7 100644
--- a/src/modules/m_repeat.cpp
+++ b/src/modules/m_repeat.cpp
@@ -129,8 +129,8 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >
void OnUnset(User* source, Channel* chan)
{
// Unset the per-membership extension when the mode is removed
- const UserMembList* users = chan->GetUsers();
- for (UserMembCIter i = users->begin(); i != users->end(); ++i)
+ const UserMembList& users = chan->GetUsers();
+ for (UserMembCIter i = users.begin(); i != users.end(); ++i)
MemberInfoExt.unset(i->second);
}
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index 5e157420e..6ba748d2f 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -315,9 +315,9 @@ class ModuleSilence : public Module
void OnBuildExemptList(MessageType message_type, Channel* chan, User* sender, char status, CUList &exempt_list, const std::string &text)
{
int public_silence = (message_type == MSG_PRIVMSG ? SILENCE_CHANNEL : SILENCE_CNOTICE);
- const UserMembList *ulist = chan->GetUsers();
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
+ const UserMembList& ulist = chan->GetUsers();
+ for (UserMembCIter i = ulist.begin(); i != ulist.end(); ++i)
{
if (IS_LOCAL(i->first))
{
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index f96e47d60..f583a9d8f 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -167,9 +167,9 @@ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s)
void TreeSocket::SendFJoins(Channel* c)
{
CommandFJoin::Builder fjoin(c);
- const UserMembList *ulist = c->GetUsers();
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); ++i)
+ const UserMembList& ulist = c->GetUsers();
+ for (UserMembCIter i = ulist.begin(); i != ulist.end(); ++i)
{
Membership* memb = i->second;
if (!fjoin.has_room(memb))
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index d6dccba14..254b50dcc 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -166,9 +166,8 @@ void SpanningTreeUtilities::GetListOfServersForChannel(Channel* c, TreeSocketSet
minrank = mh->GetPrefixRank();
}
- const UserMembList *ulist = c->GetUsers();
-
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
+ const UserMembList& ulist = c->GetUsers();
+ for (UserMembCIter i = ulist.begin(); i != ulist.end(); ++i)
{
if (IS_LOCAL(i->first))
continue;
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp
index 6ac07434f..5f3fc9215 100644
--- a/src/modules/m_sslmodes.cpp
+++ b/src/modules/m_sslmodes.cpp
@@ -48,8 +48,8 @@ class SSLMode : public ModeHandler
if (!API)
return MODEACTION_DENY;
- const UserMembList* userlist = channel->GetUsers();
- for(UserMembCIter i = userlist->begin(); i != userlist->end(); i++)
+ const UserMembList& userlist = channel->GetUsers();
+ for (UserMembCIter i = userlist.begin(); i != userlist.end(); ++i)
{
ssl_cert* cert = API->GetCertificate(i->first);
if (!cert && !i->first->server->IsULine())
diff --git a/src/users.cpp b/src/users.cpp
index abe0f8804..039fdce57 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -891,8 +891,8 @@ void User::WriteCommonRaw(const std::string &line, bool include_self)
for (IncludeChanList::const_iterator v = include_c.begin(); v != include_c.end(); ++v)
{
Channel* c = (*v)->chan;
- const UserMembList* ulist = c->GetUsers();
- for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
+ const UserMembList& ulist = c->GetUsers();
+ for (UserMembList::const_iterator i = ulist.begin(); i != ulist.end(); ++i)
{
LocalUser* u = IS_LOCAL(i->first);
if (u && u->already_sent != LocalUser::already_sent_id)
@@ -931,8 +931,8 @@ void User::WriteCommonQuit(const std::string &normal_text, const std::string &op
}
for (IncludeChanList::const_iterator v = include_c.begin(); v != include_c.end(); ++v)
{
- const UserMembList* ulist = (*v)->chan->GetUsers();
- for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
+ const UserMembList& ulist = (*v)->chan->GetUsers();
+ for (UserMembList::const_iterator i = ulist.begin(); i != ulist.end(); i++)
{
LocalUser* u = IS_LOCAL(i->first);
if (u && (u->already_sent != uniq_id))