summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:50:43 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:50:43 +0000
commit94a601fb3b67e72e075af28174094117cd09f5f2 (patch)
treec667c935abf679c40ca25d5e960ddc497bdedd07 /src/modules
parentc32734fb23bb7c811076d1f4acc819020533e89c (diff)
Rip out VisData in preparation for replacing it with more flexible hooks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11640 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_delayjoin.cpp4
-rw-r--r--src/modules/m_invisible.cpp27
-rw-r--r--src/modules/m_watch.cpp22
3 files changed, 5 insertions, 48 deletions
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index 9463457f7..9ccb89167 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -229,10 +229,6 @@ void ModuleDelayJoin::WriteCommonFrom(User *user, Channel* channel, const char*
if (user == i->first)
continue;
- /* Users with a visibility state that hides them dont appear */
- if (user->Visibility && !user->Visibility->VisibleTo(i->first))
- continue;
-
i->first->Write(std::string(tb));
}
}
diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp
index 5c879aea6..1d8c8a385 100644
--- a/src/modules/m_invisible.cpp
+++ b/src/modules/m_invisible.cpp
@@ -18,39 +18,15 @@
static ConfigReader* conf;
-class QuietOper : public VisData
-{
- public:
- QuietOper()
- {
- }
-
- virtual ~QuietOper()
- {
- }
-
- virtual bool VisibleTo(User* user)
- {
- return IS_OPER(user);
- }
-};
-
-
class InvisibleMode : public ModeHandler
{
- QuietOper* qo;
public:
InvisibleMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'Q', 0, 0, false, MODETYPE_USER, true)
{
- qo = new QuietOper();
}
~InvisibleMode()
{
- for (user_hash::iterator i = ServerInstance->Users->clientlist->begin(); i != ServerInstance->Users->clientlist->end(); i++)
- if (i->second->Visibility == qo)
- i->second->Visibility = NULL;
- delete qo;
}
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
@@ -66,9 +42,6 @@ class InvisibleMode : public ModeHandler
if (m && adding)
m->OnUserQuit(dest, "Connection closed", "Connection closed");
- /* Set visibility handler object */
- dest->Visibility = adding ? qo : NULL;
-
/* This has to come after setting/unsetting the handler */
if (m && !adding)
m->OnPostConnect(dest);
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp
index c78bfa638..1cda4484f 100644
--- a/src/modules/m_watch.cpp
+++ b/src/modules/m_watch.cpp
@@ -226,13 +226,6 @@ class CommandWatch : public Command
User* target = ServerInstance->FindNick(nick);
if (target)
{
- if (target->Visibility && !target->Visibility->VisibleTo(user))
- {
- (*wl)[nick] = "";
- user->WriteNumeric(605, "%s %s * * 0 :is offline",user->nick.c_str(), nick);
- return CMD_FAILURE;
- }
-
(*wl)[nick] = std::string(target->ident).append(" ").append(target->dhost).append(" ").append(ConvToStr(target->age));
user->WriteNumeric(604, "%s %s %s :is online",user->nick.c_str(), nick, (*wl)[nick].c_str());
if (IS_AWAY(target))
@@ -410,8 +403,7 @@ class Modulewatch : public Module
{
for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
{
- if (!user->Visibility || user->Visibility->VisibleTo(user))
- (*n)->WriteNumeric(inum, numeric);
+ (*n)->WriteNumeric(inum, numeric);
}
}
@@ -425,8 +417,7 @@ class Modulewatch : public Module
{
for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
{
- if (!user->Visibility || user->Visibility->VisibleTo(*n))
- (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick.c_str() ,user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), (unsigned long) ServerInstance->Time());
+ (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick.c_str() ,user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), (unsigned long) ServerInstance->Time());
watchlist* wl;
if ((*n)->GetExt("watchlist", wl))
@@ -496,8 +487,7 @@ class Modulewatch : public Module
{
for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
{
- if (!user->Visibility || user->Visibility->VisibleTo(*n))
- (*n)->WriteNumeric(600, "%s %s %s %s %lu :arrived online", (*n)->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), (unsigned long) user->age);
+ (*n)->WriteNumeric(600, "%s %s %s %s %lu :arrived online", (*n)->nick.c_str(), user->nick.c_str(), user->ident.c_str(), user->dhost.c_str(), (unsigned long) user->age);
watchlist* wl;
if ((*n)->GetExt("watchlist", wl))
@@ -519,8 +509,7 @@ class Modulewatch : public Module
watchlist* wl;
if ((*n)->GetExt("watchlist", wl))
{
- if (!user->Visibility || user->Visibility->VisibleTo(*n))
- (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick.c_str(), oldnick.c_str(), user->ident.c_str(), user->dhost.c_str(), (unsigned long) user->age);
+ (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick.c_str(), oldnick.c_str(), user->ident.c_str(), user->dhost.c_str(), (unsigned long) user->age);
(*wl)[oldnick.c_str()] = "";
}
}
@@ -534,8 +523,7 @@ class Modulewatch : public Module
if ((*n)->GetExt("watchlist", wl))
{
(*wl)[user->nick.c_str()] = std::string(user->ident).append(" ").append(user->dhost).append(" ").append(ConvToStr(user->age));
- if (!user->Visibility || user->Visibility->VisibleTo(*n))
- (*n)->WriteNumeric(600, "%s %s %s :arrived online", (*n)->nick.c_str(), user->nick.c_str(), (*wl)[user->nick.c_str()].c_str());
+ (*n)->WriteNumeric(600, "%s %s %s :arrived online", (*n)->nick.c_str(), user->nick.c_str(), (*wl)[user->nick.c_str()].c_str());
}
}
}