]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_auditorium.cpp
Remove current time parameter of the Timer constructor
[user/henk/code/inspircd.git] / src / modules / m_auditorium.cpp
index 502a9fb9f1e29f215b0d504790cb3e8c943bba8b..60bdd258277ab325751c29079a5eb5e0693b764d 100644 (file)
@@ -85,19 +85,16 @@ class ModuleAuditorium : public Module
                return false;
        }
 
-       void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick) CXX11_OVERRIDE
+       ModResult OnNamesListItem(User* issuer, Membership* memb, std::string& prefixes, std::string& nick) CXX11_OVERRIDE
        {
-               // Some module already hid this from being displayed, don't bother
-               if (nick.empty())
-                       return;
-
                if (IsVisible(memb))
-                       return;
+                       return MOD_RES_PASSTHRU;
 
                if (CanSee(issuer, memb))
-                       return;
+                       return MOD_RES_PASSTHRU;
 
-               nick.clear();
+               // Don't display this user in the NAMES list
+               return MOD_RES_DENY;
        }
 
        /** Build CUList for showing this join/part/kick */
@@ -129,19 +126,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))
@@ -150,12 +149,10 @@ class ModuleAuditorium : public Module
                }
        }
 
-       void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) CXX11_OVERRIDE
+       void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, Membership* memb, std::string& line) CXX11_OVERRIDE
        {
-               Channel* channel = ServerInstance->FindChan(params[0]);
-               if (!channel)
+               if (!memb)
                        return;
-               Membership* memb = channel->GetUser(user);
                if (IsVisible(memb))
                        return;
                if (CanSee(source, memb))