summaryrefslogtreecommitdiff
path: root/modules/protocol/hybrid.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
committerAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
commit0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch)
tree45df813323e023c5c89db7279426c4ad0943b4a9 /modules/protocol/hybrid.cpp
parenta3c8afae00c54d5b95c620248b51f90679d7d53f (diff)
Allow serializable fields to use storage in the respective objects.
Split service management code nito a proper servicemanager. Make service references managed instead of lazy lookup. Also made events and serializable use service manager instead of their respective systems for management
Diffstat (limited to 'modules/protocol/hybrid.cpp')
-rw-r--r--modules/protocol/hybrid.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp
index b5c524530..65ea4a565 100644
--- a/modules/protocol/hybrid.cpp
+++ b/modules/protocol/hybrid.cpp
@@ -149,7 +149,7 @@ class HybridProto : public IRCDProto
* Find users that match and ban them.
*/
for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
- if (x->manager->Check(it->second, x))
+ if (x->GetManager()->Check(it->second, x))
this->SendAkill(it->second, x);
return;
@@ -157,13 +157,18 @@ class HybridProto : public IRCDProto
XLine *old = x;
- if (old->manager->HasEntry("*@" + u->host))
+ if (old->GetManager()->HasEntry("*@" + u->host))
return;
/* We can't akill x as it has a nick and/or realname included, so create a new akill for *@host */
- XLine *xl = new XLine("*@" + u->host, old->GetBy(), old->GetExpires(), old->GetReason(), old->id);
-
- old->manager->AddXLine(xl);
+ XLine *xl = Serialize::New<XLine *>();
+ xl->SetMask("*@" + u->host);
+ xl->SetBy(old->GetBy());
+ xl->SetExpires(old->GetExpires());
+ xl->SetReason(old->GetReason());
+ xl->SetID(old->GetID());
+
+ old->GetManager()->AddXLine(xl);
x = xl;
Log(Config->GetClient("OperServ"), "akill") << "AKILL: Added an akill for " << x->GetMask() << " because " << u->GetMask() << "#"
@@ -277,14 +282,19 @@ class HybridProto : public IRCDProto
void SendSVSHold(const Anope::string &nick, time_t t) override
{
+#if 0
XLine x(nick, Me->GetName(), Anope::CurTime + t, "Being held for registered user");
this->SendSQLine(NULL, &x);
+#endif
}
+#warning "xline on stack"
void SendSVSHoldDel(const Anope::string &nick) override
{
+#if 0
XLine x(nick);
this->SendSQLineDel(&x);
+#endif
}
void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override
@@ -579,7 +589,7 @@ struct IRCDMessageCertFP: IRCDMessage
User *u = source.GetUser();
u->fingerprint = params[0];
- Event::OnFingerprint(&Event::Fingerprint::OnFingerprint, u);
+ EventManager::Get()->Dispatch(&Event::Fingerprint::OnFingerprint, u);
}
};
@@ -627,6 +637,7 @@ class ProtoHybrid : public Module
public:
ProtoHybrid(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR)
+ , EventHook<Event::UserNickChange>(this)
, ircd_proto(this)
, message_away(this)
, message_capab(this)