diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-22 20:29:05 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-03-22 20:29:05 +0000 |
commit | 10d8e9151d75c1ef81740d56b703fc147086f175 (patch) | |
tree | 373806d5cb483df0e40221df269f37b37104a5a8 /src/modules | |
parent | 406010998eee82cebe6467c4f64e446ff8b79e5f (diff) |
Remove channel argument from OnSendWhoLine, this information is already available in params[0]
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12650 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_auditorium.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_hideoper.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_invisible.cpp | 42 |
3 files changed, 8 insertions, 39 deletions
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 4be1feb5c..2aebc88da 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -168,8 +168,9 @@ class ModuleAuditorium : public Module } } - void OnSendWhoLine(User* source, const std::vector<std::string>&, User* user, Channel* channel, std::string& line) + void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) { + Channel* channel = ServerInstance->FindChan(params[0]); if (!channel) return; Membership* memb = channel->GetUser(user); diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index 360dae014..7e919fcc6 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -88,7 +88,7 @@ class ModuleHideOper : public Module return MOD_RES_PASSTHRU; } - void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, Channel* channel, std::string& line) + void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) { if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex")) { diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index 56390bdb4..49114fa28 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -77,39 +77,16 @@ class InvisibleMode : public ModeHandler } }; -class InvisibleDeOper : public ModeWatcher -{ - public: - InvisibleDeOper(Module* parent) : ModeWatcher(parent, 'o', MODETYPE_USER) - { - } - - bool BeforeMode(User* source, User* dest, Channel* channel, std::string ¶m, bool adding, ModeType type) - { - /* Users who are opers and have +Q get their +Q removed when they deoper */ - if ((!adding) && (dest->IsModeSet('Q'))) - { - std::vector<std::string> newmodes; - newmodes.push_back(dest->nick); - newmodes.push_back("-Q"); - ServerInstance->Modes->Process(newmodes, source); - } - return true; - } -}; - - class ModuleInvisible : public Module { private: InvisibleMode qm; - InvisibleDeOper ido; bool hidejoin; bool hidelist; bool hidewho; bool hidemsg; public: - ModuleInvisible() : qm(this), ido(this) + ModuleInvisible() : qm(this) { } @@ -117,8 +94,6 @@ class ModuleInvisible : public Module { if (!ServerInstance->Modes->AddMode(&qm)) throw ModuleException("Could not add new modes!"); - if (!ServerInstance->Modes->AddModeWatcher(&ido)) - throw ModuleException("Could not add new mode watcher on usermode +o!"); /* Yeah i know people can take this out. I'm not about to obfuscate code just to be a pain in the ass. */ ServerInstance->Users->ServerNoticeAll("*** m_invisible.so has just been loaded on this network. For more information, please visit http://inspircd.org/wiki/Modules/invisible"); @@ -129,14 +104,7 @@ class ModuleInvisible : public Module }; ServerInstance->Modules->Attach(eventlist, this, 7); OnRehash(NULL); - }; - - ~ModuleInvisible() - { - /* XXX is this the best place to do this? */ - if (!ServerInstance->Modes->DelModeWatcher(&ido)) - ServerInstance->Logs->Log("m_banredirect.so", DEBUG, "Failed to delete modewatcher!"); - }; + } void OnRehash(User*) { @@ -151,7 +119,7 @@ class ModuleInvisible : public Module void OnBuildNeighborList(User* source, UserChanList &include, std::map<User*,bool> &exceptions); ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list); ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list); - void OnSendWhoLine(User* source, const std::vector<std::string>&, User* user, Channel* channel, std::string& line); + void OnSendWhoLine(User* source, const std::vector<std::string>&, User* user, std::string& line); void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick); }; @@ -208,9 +176,9 @@ ModResult ModuleInvisible::OnUserPreMessage(User* user,void* dest,int target_typ return OnUserPreNotice(user, dest, target_type, text, status, exempt_list); } -void ModuleInvisible::OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, Channel* channel, std::string& line) +void ModuleInvisible::OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) { - if ((channel ? hidelist : hidewho) && user->IsModeSet('Q') && !IS_OPER(source)) + if (hidewho && user->IsModeSet('Q') && !IS_OPER(source)) line.clear(); } |