From 10d8e9151d75c1ef81740d56b703fc147086f175 Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 22 Mar 2010 20:29:05 +0000 Subject: 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 --- src/modules/m_auditorium.cpp | 3 ++- src/modules/m_hideoper.cpp | 2 +- src/modules/m_invisible.cpp | 42 +++++------------------------------------- 3 files changed, 8 insertions(+), 39 deletions(-) (limited to 'src/modules') 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&, User* user, Channel* channel, std::string& line) + void OnSendWhoLine(User* source, const std::vector& 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& params, User* user, Channel* channel, std::string& line) + void OnSendWhoLine(User* source, const std::vector& 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 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 &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&, User* user, Channel* channel, std::string& line); + void OnSendWhoLine(User* source, const std::vector&, 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& params, User* user, Channel* channel, std::string& line) +void ModuleInvisible::OnSendWhoLine(User* source, const std::vector& 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(); } -- cgit v1.2.3