OnRehash(NULL);
- Implementation eventlist[] = { I_OnUserJoin, I_OnUserPart, I_OnUserKick, I_OnBuildNeighborList, I_OnNamesListItem, I_OnRehash };
- ServerInstance->Modules->Attach(eventlist, this, 6);
+ Implementation eventlist[] = {
+ I_OnUserJoin, I_OnUserPart, I_OnUserKick,
+ I_OnBuildNeighborList, I_OnNamesListItem, I_OnSendWhoLine,
+ I_OnRehash };
+ ServerInstance->Modules->Attach(eventlist, this, 7);
}
~ModuleAuditorium()
while (i != include.end())
{
Channel* c = *i++;
- Membership* memb = c->GetUser(source); // will be non-null
- if (IsVisible(memb))
+ Membership* memb = c->GetUser(source);
+ if (!memb || IsVisible(memb))
continue;
- // TODO this doesn't take can-see into account
+ // this channel should not be considered when listing my neighbors
include.erase(c);
+ // however, that might hide me from ops that can see me...
+ const UserMembList* users = c->GetUsers();
+ for(UserMembCIter j = users->begin(); j != users->end(); j++)
+ {
+ if (IS_LOCAL(j->first) && CanSee(j->first, memb))
+ exception[j->first] = true;
+ }
}
}
+
+ void OnSendWhoLine(User* source, const std::vector<std::string>&, User* user, Channel* channel, std::string& line)
+ {
+ if (!channel)
+ return;
+ Membership* memb = channel->GetUser(user);
+ if (IsVisible(memb))
+ return;
+ if (CanSee(source, memb))
+ return;
+ line.clear();
+ }
};
MODULE_INIT(ModuleAuditorium)