diff options
| author | 2014-01-24 12:58:01 +0100 | |
|---|---|---|
| committer | 2014-01-24 12:58:01 +0100 | |
| commit | 932e8d13f81c7c94a89dc3702f6d45bc185f5dcf (patch) | |
| tree | cb50264af2ff50ccf8070ce9123ee350d95ff7f8 /src/modules/m_auditorium.cpp | |
| parent | Add intrusive list template (diff) | |
Convert UserChanList to an intrusively linked list
Diffstat (limited to 'src/modules/m_auditorium.cpp')
| -rw-r--r-- | src/modules/m_auditorium.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 502a9fb9f..62aa7ec75 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -129,19 +129,21 @@ class ModuleAuditorium : public Module BuildExcept(memb, excepts); } - void OnBuildNeighborList(User* source, UserChanList &include, std::map<User*,bool> &exception) CXX11_OVERRIDE + void OnBuildNeighborList(User* source, IncludeChanList& include, std::map<User*, bool>& exception) CXX11_OVERRIDE { - UCListIter i = include.begin(); - while (i != include.end()) + for (IncludeChanList::iterator i = include.begin(); i != include.end(); ) { - Channel* c = *i++; - Membership* memb = c->GetUser(source); - if (!memb || IsVisible(memb)) + Membership* memb = *i; + if (IsVisible(memb)) + { + ++i; continue; + } + // this channel should not be considered when listing my neighbors - include.erase(c); + i = include.erase(i); // however, that might hide me from ops that can see me... - const UserMembList* users = c->GetUsers(); + const UserMembList* users = memb->chan->GetUsers(); for(UserMembCIter j = users->begin(); j != users->end(); j++) { if (IS_LOCAL(j->first) && CanSee(j->first, memb)) |
