summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h13
-rw-r--r--src/channels.cpp23
-rw-r--r--src/modules.cpp1
-rw-r--r--src/modules/m_spy.cpp52
-rw-r--r--src/modules/m_testnet.cpp1
5 files changed, 9 insertions, 81 deletions
diff --git a/include/modules.h b/include/modules.h
index bb50c417a..4f60d55e4 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -97,7 +97,7 @@ struct ModResult {
/** If you change the module API in any way, increment this value.
* This MUST be a pure integer, with no parenthesis
*/
-#define API_VERSION 140
+#define API_VERSION 141
/**
* This #define allows us to call a method in all
@@ -324,7 +324,7 @@ enum Implementation
I_OnStats, I_OnChangeLocalUserHost, I_OnPreTopicChange,
I_OnPostTopicChange, I_OnEvent, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan,
I_OnDelBan, I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete,
- I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin,
+ I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnPostCommand, I_OnPostJoin,
I_OnWhoisLine, I_OnBuildNeighborList, I_OnGarbageCollect, I_OnSetConnectClass,
I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookIO,
I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, I_OnChannelRestrictionApply,
@@ -1231,15 +1231,6 @@ class CoreExport Module : public classbase, public usecountbase
*/
virtual ModResult OnSetAway(User* user, const std::string &awaymsg);
- /** Called whenever a NAMES list is requested.
- * You can produce the nameslist yourself, overriding the current list,
- * and if you do you must return 1. If you do not handle the names list,
- * return 0.
- * @param The user requesting the NAMES list
- * @param Ptr The channel the NAMES list is requested for
- */
- virtual ModResult OnUserList(User* user, Channel* Ptr);
-
/** Called whenever a line of WHOIS output is sent to a user.
* You may change the numeric and the text of the output by changing
* the values numeric and text, but you cannot change the user the
diff --git a/src/channels.cpp b/src/channels.cpp
index ee1ba2e1f..d0533aee6 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -746,20 +746,14 @@ void Channel::UserList(User *user)
{
char list[MAXBUF];
size_t dlen, curlen;
- ModResult call_modules;
if (!IS_LOCAL(user))
return;
- FIRST_MOD_RESULT(OnUserList, call_modules, (user, this));
-
- if (call_modules != MOD_RES_ALLOW)
+ if (this->IsModeSet('s') && !this->HasUser(user) && !user->HasPrivPermission("channels/auspex"))
{
- if ((this->IsModeSet('s')) && (!this->HasUser(user)))
- {
- user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str());
- return;
- }
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel",user->nick.c_str(), this->name.c_str());
+ return;
}
dlen = curlen = snprintf(list,MAXBUF,"%s %c %s :", user->nick.c_str(), this->IsModeSet('s') ? '@' : this->IsModeSet('p') ? '*' : '=', this->name.c_str());
@@ -786,14 +780,11 @@ void Channel::UserList(User *user)
std::string prefixlist = this->GetPrefixChar(i->first);
std::string nick = i->first->nick;
- if (call_modules != MOD_RES_DENY)
- {
- FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->second, prefixlist, nick));
+ FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->second, prefixlist, nick));
- /* Nick was nuked, a module wants us to skip it */
- if (nick.empty())
- continue;
- }
+ /* Nick was nuked, a module wants us to skip it */
+ if (nick.empty())
+ continue;
size_t ptrlen = 0;
diff --git a/src/modules.cpp b/src/modules.cpp
index 6586166c8..98788c616 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -152,7 +152,6 @@ void Module::OnCleanup(int, void*) { }
ModResult Module::OnChannelPreDelete(Channel*) { return MOD_RES_PASSTHRU; }
void Module::OnChannelDelete(Channel*) { }
ModResult Module::OnSetAway(User*, const std::string &) { return MOD_RES_PASSTHRU; }
-ModResult Module::OnUserList(User*, Channel*) { return MOD_RES_PASSTHRU; }
ModResult Module::OnWhoisLine(User*, User*, int&, std::string&) { return MOD_RES_PASSTHRU; }
void Module::OnBuildNeighborList(User*, UserChanList&, std::map<User*,bool>&) { }
void Module::OnGarbageCollect() { }
diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp
deleted file mode 100644
index 4465235a5..000000000
--- a/src/modules/m_spy.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/* +------------------------------------+
- * | Inspire Internet Relay Chat Daemon |
- * +------------------------------------+
- *
- * InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
- *
- * This program is free but copyrighted software; see
- * the file COPYING for details.
- *
- * ---------------------------------------------------
- */
-
-/* $ModDesc: Provides the ability to see the complete names list of channels an oper is not a member of */
-
-#include "inspircd.h"
-
-class ModuleSpy : public Module
-{
- public:
- ModuleSpy() {
- ServerInstance->Modules->Attach(I_OnUserList, this);
- }
-
- virtual ModResult OnUserList(User* user, Channel* Ptr)
- {
- /* User has priv and is NOT on the channel */
- if (user->HasPrivPermission("channels/auspex") && !Ptr->HasUser(user))
- return MOD_RES_ALLOW;
-
- return MOD_RES_PASSTHRU;
- }
-
- void Prioritize()
- {
- /* To ensure that we get priority over namesx and delayjoin for names list generation */
- Module* list[] = { ServerInstance->Modules->Find("m_namesx.so"), ServerInstance->Modules->Find("m_delayjoin.so") };
- ServerInstance->Modules->SetPriority(this, I_OnUserList, PRIORITY_BEFORE, list, 2);
- }
-
- virtual ~ModuleSpy()
- {
- }
-
- virtual Version GetVersion()
- {
- return Version("Provides the ability to see the complete names list of channels an oper is not a member of", VF_VENDOR);
- }
-};
-
-MODULE_INIT(ModuleSpy)
-
diff --git a/src/modules/m_testnet.cpp b/src/modules/m_testnet.cpp
index cd57cb52b..faa0c7b2e 100644
--- a/src/modules/m_testnet.cpp
+++ b/src/modules/m_testnet.cpp
@@ -154,7 +154,6 @@ static void checkall(Module* noimpl)
CHK(OnPostOper);
CHK(OnSyncNetwork);
CHK(OnSetAway);
- CHK(OnUserList);
CHK(OnPostCommand);
CHK(OnPostJoin);
CHK(OnWhoisLine);