summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-11-22 12:37:20 +0000
committerPeter Powell <petpow@saberuk.com>2017-12-03 13:58:10 +0000
commit70be9c79d284982d03744443b84268bef44a3080 (patch)
tree362a57bc63905570f5e672dcfdfd29b5073f8202 /src/modules
parent4aa27e75af8da0a5bc2e35f931f0165339f5f289 (diff)
Move OnSync{Channel,Network,User} to ServerEventListener.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_filter.cpp8
-rw-r--r--src/modules/m_spanningtree/netburst.cpp9
2 files changed, 10 insertions, 7 deletions
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 8e43d2767..27c511c16 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -23,6 +23,7 @@
#include "inspircd.h"
#include "xline.h"
#include "modules/regex.h"
+#include "modules/server.h"
enum FilterFlags
{
@@ -154,7 +155,7 @@ class CommandFilter : public Command
}
};
-class ModuleFilter : public Module
+class ModuleFilter : public Module, public ServerEventListener
{
typedef insp::flat_set<std::string, irc::insensitive_swo> ExemptTargetSet;
@@ -292,7 +293,10 @@ bool ModuleFilter::AppliesToMe(User* user, FilterResult* filter, int iflags)
}
ModuleFilter::ModuleFilter()
- : initing(true), filtcommand(this), RegexEngine(this, "regex")
+ : ServerEventListener(this)
+ , initing(true)
+ , filtcommand(this)
+ , RegexEngine(this, "regex")
{
}
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index cdafa9ded..5115c7aa8 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -27,6 +27,7 @@
#include "treeserver.h"
#include "main.h"
#include "commands.h"
+#include "modules/server.h"
/**
* Creates FMODE messages, used only when syncing channels
@@ -122,7 +123,7 @@ void TreeSocket::DoBurst(TreeServer* s)
// Send all xlines
this->SendXLines();
- FOREACH_MOD(OnSyncNetwork, (bs.server));
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), ServerEventListener, OnSyncNetwork, (bs.server));
this->WriteLine(CmdBuilder("ENDBURST"));
ServerInstance->SNO->WriteToSnoMask('l',"Finished bursting to \2"+ s->GetName()+"\2.");
@@ -261,7 +262,7 @@ void TreeSocket::SyncChannel(Channel* chan, BurstState& bs)
this->WriteLine(CommandMetadata::Builder(chan, item->name, value));
}
- FOREACH_MOD(OnSyncChannel, (chan, bs.server));
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), ServerEventListener, OnSyncChannel, (chan, bs.server));
}
void TreeSocket::SyncChannel(Channel* chan)
@@ -273,8 +274,6 @@ void TreeSocket::SyncChannel(Channel* chan)
/** Send all users and their state, including oper and away status and global metadata */
void TreeSocket::SendUsers(BurstState& bs)
{
- ProtocolInterface::Server& piserver = bs.server;
-
const user_hash& users = ServerInstance->Users->GetUsers();
for (user_hash::const_iterator u = users.begin(); u != users.end(); ++u)
{
@@ -299,6 +298,6 @@ void TreeSocket::SendUsers(BurstState& bs)
this->WriteLine(CommandMetadata::Builder(user, item->name, value));
}
- FOREACH_MOD(OnSyncUser, (user, piserver));
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), ServerEventListener, OnSyncUser, (user, bs.server));
}
}