- Implementation eventlist[] = { I_OnPostJoin, I_OnCleanup, I_OnUserQuit, I_OnUserKick, I_OnUserPart, I_OnOper };
- ServerInstance->Modules->Attach(eventlist, this, 6);
- }
-
- void PushChanMode(Channel* channel, User* user, bool negate = false)
- {
- if (negate)
- DelPrefixChan(user, channel);
- else
- AddPrefixChan(user, channel);
- char modeline[] = "+y";
- if (negate)
- modeline[0] = '-';
- std::vector<std::string> modechange;
- modechange.push_back(channel->name);
- modechange.push_back(modeline);
- modechange.push_back(user->nick);
- ServerInstance->SendMode(modechange,this->ServerInstance->FakeClient);
- }
-
- virtual void OnPostJoin(User *user, Channel *channel)
- {
- if (user && IS_OPER(user))
- {
- if (user->IsModeSet('H'))
- {
- /* we respect your wish to be invisible */
- return;
- }
- PushChanMode(channel, user);
- }
- }
-
- // XXX: is there a better way to do this?
- virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string ¶m, bool adding, int pcnt, bool servermode)
- {
- /* force event propagation to its ModeHandler */
- if (!servermode && chan && (mode == 'y'))
- return ACR_ALLOW;
- return 0;
- }
-
- virtual void OnOper(User *user, const std::string&)