summaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-12-17 21:44:22 -0500
committerAdam <Adam@anope.org>2016-12-17 21:44:22 -0500
commit4fcbbbe4fbc137841b47c8e2372477b85649270a (patch)
treef2a5fd3b5a77ef0384df6e2712fdd74f832d7dfe /include/modules
parented08d1a31119adb379f8bec46d7ad47ee35c4c92 (diff)
Split ircdproto send functions out into separate services
This makes it easier to see which send functions a protocol module implements as they are all explicitly registered by the module, and avoids the problem of subtly breaking other protocol modules when using inheritance. Also split the old "core" send implementations out into a module, and the TS6 ID generator
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/protocol/bahamut.h195
-rw-r--r--include/modules/protocol/charybdis.h98
-rw-r--r--include/modules/protocol/hybrid.h234
-rw-r--r--include/modules/protocol/inspircd20.h264
-rw-r--r--include/modules/protocol/ngircd.h88
-rw-r--r--include/modules/protocol/plexus.h99
-rw-r--r--include/modules/protocol/ratbox.h93
-rw-r--r--include/modules/protocol/rfc1459.h159
-rw-r--r--include/modules/protocol/ts6.h37
-rw-r--r--include/modules/protocol/unreal.h232
10 files changed, 1254 insertions, 245 deletions
diff --git a/include/modules/protocol/bahamut.h b/include/modules/protocol/bahamut.h
index f120c7d4c..fd0d47c87 100644
--- a/include/modules/protocol/bahamut.h
+++ b/include/modules/protocol/bahamut.h
@@ -22,62 +22,201 @@
namespace bahamut
{
-class Proto : public IRCDProto
+namespace senders
+{
+
+class Akill : public messages::Akill
{
public:
- Proto(Module *creator);
+ using messages::Akill::Akill;
- void SendMode(const MessageSource &source, Channel *dest, const Anope::string &buf) override;
+ void Send(User *, XLine *) override;
+};
- void SendMode(const MessageSource &source, User *u, const Anope::string &buf) override;
+class AkillDel : public messages::AkillDel
+{
+ public:
+ using messages::AkillDel::AkillDel;
- void SendGlobalNotice(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+ void Send(XLine *) override;
+};
+
+class MessageChannel : public messages::MessageChannel
+{
+ public:
+ using messages::MessageChannel::MessageChannel;
+
+ void Send(Channel *) override;
+};
- void SendGlobalPrivmsg(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+class Join : public messages::Join
+{
+ public:
+ using messages::Join::Join;
+
+ void Send(User *u, Channel *c, const ChannelStatus *status) override;
+};
+
+class Kill : public messages::Kill
+{
+ public:
+ using messages::Kill::Kill;
+
+ void Send(const MessageSource &source, const Anope::string &target, const Anope::string &reason) override;
+
+ void Send(const MessageSource &source, User *user, const Anope::string &reason) override;
+};
+
+class Login : public messages::Login
+{
+ public:
+ using messages::Login::Login;
- void SendSVSHold(const Anope::string &nick, time_t time) override;
+ void Send(User *u, NickServ::Nick *na) override;
+};
- void SendSVSHoldDel(const Anope::string &nick) override;
+class Logout : public messages::Logout
+{
+ public:
+ using messages::Logout::Logout;
- void SendSQLine(User *, XLine *x) override;
+ void Send(User *u) override;
+};
- void SendSGLineDel(XLine *x) override;
+class ModeChannel : public messages::ModeChannel
+{
+ public:
+ using messages::ModeChannel::ModeChannel;
- void SendSZLineDel(XLine *x) override;
+ void Send(const MessageSource &source, Channel *channel, const Anope::string &modes) override;
+};
- void SendSZLine(User *, XLine *x) override;
+class ModeUser : public messages::ModeUser
+{
+ public:
+ using messages::ModeUser::ModeUser;
- void SendSVSNOOP(Server *server, bool set) override;
+ void Send(const MessageSource &source, User *user, const Anope::string &modes) override;
+};
- void SendSGLine(User *, XLine *x) override;
+class NickIntroduction : public messages::NickIntroduction
+{
+ public:
+ using messages::NickIntroduction::NickIntroduction;
- void SendAkillDel(XLine *x) override;
+ void Send(User *user) override;
+};
- void SendTopic(const MessageSource &source, Channel *c) override;
+class NOOP : public messages::NOOP
+{
+ public:
+ static constexpr const char *NAME = "noop";
- void SendSQLineDel(XLine *x) override;
+ using messages::NOOP::NOOP;
- void SendJoin(User *user, Channel *c, const ChannelStatus *status) override;
+ void Send(Server *s, bool mode) override;
+};
- void SendAkill(User *u, XLine *x) override;
+class SGLine : public messages::SGLine
+{
+ public:
+ using messages::SGLine::SGLine;
- void SendSVSKill(const MessageSource &source, User *user, const Anope::string &buf) override;
+ void Send(User *, XLine *) override;
+};
- void SendBOB() override;
+class SGLineDel : public messages::SGLineDel
+{
+ public:
+ using messages::SGLineDel::SGLineDel;
- void SendEOB() override;
+ void Send(XLine *) override;
+};
- void SendClientIntroduction(User *u) override;
+class SQLine : public messages::SQLine
+{
+ public:
+ using messages::SQLine::SQLine;
+
+ void Send(User *, XLine *) override;
+};
+
+class SQLineDel : public messages::SQLineDel
+{
+ public:
+ using messages::SQLineDel::SQLineDel;
+
+ void Send(XLine *) override;
+};
+
+class SZLine : public messages::SZLine
+{
+ public:
+ using messages::SZLine::SZLine;
+
+ void Send(User *, XLine *) override;
+};
+
+class SZLineDel : public messages::SZLineDel
+{
+ public:
+ using messages::SZLineDel::SZLineDel;
+
+ void Send(XLine *) override;
+};
+
+class SVSHold : public messages::SVSHold
+{
+ public:
+ using messages::SVSHold::SVSHold;
+
+ void Send(const Anope::string &, time_t) override;
+};
+
+class SVSHoldDel : public messages::SVSHoldDel
+{
+ public:
+ using messages::SVSHoldDel::SVSHoldDel;
- void SendServer(Server *server) override;
+ void Send(const Anope::string &) override;
+};
- void SendConnect() override;
+class SVSNick : public messages::SVSNick
+{
+ public:
+ using messages::SVSNick::SVSNick;
- void SendChannel(Channel *c) override;
+ void Send(User *u, const Anope::string &newnick, time_t ts) override;
+};
- void SendLogin(User *u, NickServ::Nick *) override;
+class Topic : public messages::Topic
+{
+ public:
+ using messages::Topic::Topic;
+
+ void Send(const MessageSource &source, Channel *channel, const Anope::string &topic, time_t topic_ts, const Anope::string &topic_setter) override;
+};
+
+class Wallops : public messages::Wallops
+{
+ public:
+ using messages::Wallops::Wallops;
+
+ void Send(const MessageSource &source, const Anope::string &msg) override;
+};
+
+} // namespace senders
+
+class Proto : public IRCDProto
+{
+ public:
+ Proto(Module *creator);
+
+ void SendBOB() override;
+
+ void SendEOB() override;
- void SendLogout(User *u) override;
+ void Handshake() override;
};
class Burst : public IRCDMessage
diff --git a/include/modules/protocol/charybdis.h b/include/modules/protocol/charybdis.h
index ee81a60a1..f3c06bfeb 100644
--- a/include/modules/protocol/charybdis.h
+++ b/include/modules/protocol/charybdis.h
@@ -19,53 +19,91 @@
#pragma once
+#include "modules/protocol/ts6.h"
+#include "modules/protocol/ratbox.h"
+
namespace charybdis
{
-class Proto : public IRCDProto
+namespace senders
{
- ServiceReference<IRCDProto> ratbox; // XXX
+class NickIntroduction : public messages::NickIntroduction
+{
public:
- Proto(Module *creator);
+ using messages::NickIntroduction::NickIntroduction;
- void SendSVSKill(const MessageSource &source, User *targ, const Anope::string &reason) override { ratbox->SendSVSKill(source, targ, reason); }
- void SendGlobalNotice(ServiceBot *bi, Server *dest, const Anope::string &msg) override { ratbox->SendGlobalNotice(bi, dest, msg); }
- void SendGlobalPrivmsg(ServiceBot *bi, Server *dest, const Anope::string &msg) override { ratbox->SendGlobalPrivmsg(bi, dest, msg); }
- void SendGlobops(const MessageSource &source, const Anope::string &buf) override { ratbox->SendGlobops(source, buf); }
- void SendSGLine(User *u, XLine *x) override { ratbox->SendSGLine(u, x); }
- void SendSGLineDel(XLine *x) override { ratbox->SendSGLineDel(x); }
- void SendAkill(User *u, XLine *x) override { ratbox->SendAkill(u, x); }
- void SendAkillDel(XLine *x) override { ratbox->SendAkillDel(x); }
- void SendSQLine(User *u, XLine *x) override { ratbox->SendSQLine(u, x); }
- void SendSQLineDel(XLine *x) override { ratbox->SendSQLineDel(x); }
- void SendJoin(User *user, Channel *c, const ChannelStatus *status) override { ratbox->SendJoin(user, c, status); }
- void SendServer(Server *server) override { ratbox->SendServer(server); }
- void SendChannel(Channel *c) override { ratbox->SendChannel(c); }
- void SendTopic(const MessageSource &source, Channel *c) override { ratbox->SendTopic(source, c); }
- bool IsIdentValid(const Anope::string &ident) override { return ratbox->IsIdentValid(ident); }
- void SendLogin(User *u, NickServ::Nick *na) override { ratbox->SendLogin(u, na); }
- void SendLogout(User *u) override { ratbox->SendLogout(u); }
+ void Send(User *user) override;
+};
- void SendConnect() override;
+class SASL : public messages::SASL
+{
+ public:
+ using messages::SASL::SASL;
- void SendClientIntroduction(User *u) override;
+ void Send(const ::SASL::Message &) override;
+};
- void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override;
+class SASLMechanisms : public messages::SASLMechanisms
+{
+ public:
+ using messages::SASLMechanisms::SASLMechanisms;
- void SendSVSHold(const Anope::string &nick, time_t delay) override;
+ void Send(const std::vector<Anope::string> &mechanisms) override;
+};
- void SendSVSHoldDel(const Anope::string &nick) override;
+class SVSHold : public messages::SVSHold
+{
+ public:
+ using messages::SVSHold::SVSHold;
- void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override;
+ void Send(const Anope::string &, time_t) override;
+};
- void SendVhostDel(User *u) override;
+class SVSHoldDel : public messages::SVSHoldDel
+{
+ public:
+ using messages::SVSHoldDel::SVSHoldDel;
- void SendSASLMechanisms(std::vector<Anope::string> &mechanisms) override;
+ void Send(const Anope::string &) override;
+};
+
+class SVSLogin : public messages::SVSLogin
+{
+ public:
+ using messages::SVSLogin::SVSLogin;
+
+ void Send(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override;
+};
+
+class VhostDel : public messages::VhostDel
+{
+ public:
+ using messages::VhostDel::VhostDel;
+
+ void Send(User *u) override;
+};
+
+class VhostSet : public messages::VhostSet
+{
+ public:
+ using messages::VhostSet::VhostSet;
+
+ void Send(User *u, const Anope::string &vident, const Anope::string &vhost) override;
+};
+
+} // namespace senders
+
+class Proto : public ts6::Proto
+{
+ ratbox::Proto ratbox;
+
+ public:
+ Proto(Module *creator);
- void SendSASLMessage(const SASL::Message &message) override;
+ bool IsIdentValid(const Anope::string &ident) override { return ratbox.IsIdentValid(ident); }
- void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override;
+ void Handshake() override;
};
class Encap : public IRCDMessage
diff --git a/include/modules/protocol/hybrid.h b/include/modules/protocol/hybrid.h
index a0a9143a8..7843859c0 100644
--- a/include/modules/protocol/hybrid.h
+++ b/include/modules/protocol/hybrid.h
@@ -20,74 +20,242 @@
#pragma once
#include "modules/protocol/rfc1459.h"
+#include "modules/protocol/ts6.h"
namespace hybrid
{
-class Proto : public IRCDProto
+namespace senders
{
- ServiceBot *FindIntroduced();
- void SendSVSKill(const MessageSource &source, User *u, const Anope::string &buf) override;
+class Akill : public messages::Akill
+{
+ public:
+ using messages::Akill::Akill;
- public:
- Proto(Module *creator);
+ void Send(User *, XLine *) override;
+};
- void SendInvite(const MessageSource &source, Channel *c, User *u) override;
+class AkillDel : public messages::AkillDel
+{
+ public:
+ using messages::AkillDel::AkillDel;
- void SendGlobalNotice(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+ void Send(XLine *) override;
+};
- void SendGlobalPrivmsg(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+class MessageChannel : public messages::MessageChannel
+{
+ public:
+ using messages::MessageChannel::MessageChannel;
- void SendSQLine(User *, XLine *x) override;
+ void Send(Channel *) override;
+};
- void SendSGLineDel(XLine *x) override;
+class GlobalNotice : public messages::GlobalNotice
+{
+ public:
+ using messages::GlobalNotice::GlobalNotice;
- void SendSGLine(User *, XLine *x) override;
+ void Send(const MessageSource &, Server *dest, const Anope::string &msg) override;
+};
- void SendSZLineDel(XLine *x) override;
+class GlobalPrivmsg : public messages::GlobalPrivmsg
+{
+ public:
+ using messages::GlobalPrivmsg::GlobalPrivmsg;
- void SendSZLine(User *, XLine *x) override;
+ void Send(const MessageSource &, Server *dest, const Anope::string &msg) override;
+};
- void SendAkillDel(XLine *x) override;
+class Invite : public messages::Invite
+{
+ public:
+ using messages::Invite::Invite;
- void SendSQLineDel(XLine *x) override;
+ void Send(const MessageSource &source, Channel *chan, User *user) override;
+};
- void SendJoin(User *u, Channel *c, const ChannelStatus *status) override;
+class Join : public messages::Join
+{
+ public:
+ using messages::Join::Join;
- void SendAkill(User *u, XLine *x) override;
+ void Send(User *u, Channel *c, const ChannelStatus *status) override;
+};
- void SendServer(Server *server) override;
+class Login : public messages::Login
+{
+ public:
+ using messages::Login::Login;
- void SendConnect() override;
+ void Send(User *u, NickServ::Nick *na) override;
+};
- void SendClientIntroduction(User *u) override;
+class Logout : public messages::Logout
+{
+ public:
+ using messages::Logout::Logout;
- void SendEOB() override;
+ void Send(User *u) override;
+};
+
+class ModeUser : public messages::ModeUser
+{
+ public:
+ using messages::ModeUser::ModeUser;
- void SendMode(const MessageSource &source, User *u, const Anope::string &buf) override;
+ void Send(const MessageSource &source, User *user, const Anope::string &modes) override;
+};
+
+class NickIntroduction : public messages::NickIntroduction
+{
+ public:
+ using messages::NickIntroduction::NickIntroduction;
+
+ void Send(User *user) override;
+};
+
+class MessageServer : public messages::MessageServer
+{
+ public:
+ using messages::MessageServer::MessageServer;
+
+ void Send(Server *server) override;
+};
- void SendLogin(User *u, NickServ::Nick *na) override;
+class SGLine : public messages::SGLine
+{
+ public:
+ using messages::SGLine::SGLine;
- void SendLogout(User *u) override;
+ void Send(User *, XLine *) override;
+};
- void SendChannel(Channel *c) override;
+class SGLineDel : public messages::SGLineDel
+{
+ public:
+ using messages::SGLineDel::SGLineDel;
- void SendTopic(const MessageSource &source, Channel *c) override;
+ void Send(XLine *) override;
+};
- void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override;
+class SQLine : public messages::SQLine
+{
+ public:
+ using messages::SQLine::SQLine;
- void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override;
+ void Send(User *, XLine *) override;
+};
- void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) override;
+class SQLineDel : public messages::SQLineDel
+{
+ public:
+ using messages::SQLineDel::SQLineDel;
- void SendSVSHold(const Anope::string &nick, time_t t) override;
+ void Send(XLine *) override;
+};
- void SendSVSHoldDel(const Anope::string &nick) override;
+class SZLine : public messages::SZLine
+{
+ public:
+ using messages::SZLine::SZLine;
- void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) override;
+ void Send(User *, XLine *) override;
+};
- void SendVhostDel(User *u) override;
+class SZLineDel : public messages::SZLineDel
+{
+ public:
+ using messages::SZLineDel::SZLineDel;
+
+ void Send(XLine *) override;
+};
+
+class SVSHold : public messages::SVSHold
+{
+ public:
+ using messages::SVSHold::SVSHold;
+
+ void Send(const Anope::string &, time_t) override;
+};
+
+class SVSHoldDel : public messages::SVSHoldDel
+{
+ public:
+ using messages::SVSHoldDel::SVSHoldDel;
+
+ void Send(const Anope::string &) override;
+};
+
+class SVSJoin : public messages::SVSJoin
+{
+ public:
+ using messages::SVSJoin::SVSJoin;
+
+ void Send(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) override;
+};
+
+class SVSNick : public messages::SVSNick
+{
+ public:
+ using messages::SVSNick::SVSNick;
+
+ void Send(User *u, const Anope::string &newnick, time_t ts) override;
+};
+
+class SVSPart : public messages::SVSPart
+{
+ public:
+ using messages::SVSPart::SVSPart;
+
+ void Send(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &reason) override;
+};
+
+class Topic : public messages::Topic
+{
+ public:
+ using messages::Topic::Topic;
+
+ void Send(const MessageSource &source, Channel *channel, const Anope::string &topic, time_t topic_ts, const Anope::string &topic_setter) override;
+};
+
+class VhostDel : public messages::VhostDel
+{
+ public:
+ using messages::VhostDel::VhostDel;
+
+ void Send(User *u) override;
+};
+
+class VhostSet : public messages::VhostSet
+{
+ public:
+ using messages::VhostSet::VhostSet;
+
+ void Send(User *u, const Anope::string &vident, const Anope::string &vhost) override;
+};
+
+class Wallops : public messages::Wallops
+{
+ public:
+ using messages::Wallops::Wallops;
+
+ void Send(const MessageSource &source, const Anope::string &msg) override;
+};
+
+} // namespace senders
+
+class Proto : public ts6::Proto
+{
+ ServiceBot *FindIntroduced();
+
+ public:
+ Proto(Module *creator);
+
+ void Handshake() override;
+
+ void SendEOB() override;
bool IsIdentValid(const Anope::string &ident) override;
};
diff --git a/include/modules/protocol/inspircd20.h b/include/modules/protocol/inspircd20.h
index f2126a931..391a0bc79 100644
--- a/include/modules/protocol/inspircd20.h
+++ b/include/modules/protocol/inspircd20.h
@@ -19,88 +19,270 @@
#pragma once
+#include "modules/protocol/ts6.h"
+
namespace inspircd20
{
-class Proto : public IRCDProto
+class Proto;
+
+namespace senders
{
- private:
- void SendSVSKill(const MessageSource &source, User *user, const Anope::string &buf) override;
- void SendChgIdentInternal(const Anope::string &nick, const Anope::string &vIdent);
+class Akill : public messages::Akill
+{
+ Proto *proto = nullptr;
- void SendChgHostInternal(const Anope::string &nick, const Anope::string &vhost);
+ public:
+ Akill(Module *creator, Proto *p) : messages::Akill(creator),
+ proto(p)
+ {
+ }
- void SendAddLine(const Anope::string &xtype, const Anope::string &mask, time_t duration, const Anope::string &addedby, const Anope::string &reason);
+ void Send(User *, XLine *) override;
+};
- void SendDelLine(const Anope::string &xtype, const Anope::string &mask);
+class AkillDel : public messages::AkillDel
+{
+ Proto *proto = nullptr;
public:
- Proto(Module *creator);
+ AkillDel(Module *creator, Proto *p) : messages::AkillDel(creator),
+ proto(p)
+ {
+ }
- void SendConnect() override;
+ void Send(XLine *) override;
+};
- void SendGlobalNotice(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+class MessageChannel : public messages::MessageChannel
+{
+ public:
+ using messages::MessageChannel::MessageChannel;
- void SendGlobalPrivmsg(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+ void Send(Channel *) override;
+};
- void SendAkillDel(XLine *x) override;
+class Join : public messages::Join
+{
+ public:
+ using messages::Join::Join;
- void SendTopic(const MessageSource &source, Channel *c) override;
+ void Send(User *u, Channel *c, const ChannelStatus *status) override;
+};
- void SendVhostDel(User *u) override;
+class Login : public messages::Login
+{
+ public:
+ using messages::Login::Login;
- void SendAkill(User *u, XLine *x) override;
+ void Send(User *u, NickServ::Nick *na) override;
+};
- void SendNumeric(int numeric, User *dest, IRCMessage &message);
+class Logout : public messages::Logout
+{
+ public:
+ using messages::Logout::Logout;
- void SendMode(const MessageSource &source, Channel *dest, const Anope::string &buf) override;
+ void Send(User *u) override;
+};
- void SendClientIntroduction(User *u) override;
+class ModeChannel : public messages::ModeChannel
+{
+ public:
+ using messages::ModeChannel::ModeChannel;
- void SendServer(Server *server) override;
+ void Send(const MessageSource &source, Channel *channel, const Anope::string &modes) override;
+};
- void SendSquit(Server *s, const Anope::string &message) override;
+class NickIntroduction : public messages::NickIntroduction
+{
+ public:
+ using messages::NickIntroduction::NickIntroduction;
- void SendJoin(User *user, Channel *c, const ChannelStatus *status) override;
+ void Send(User *user) override;
+};
- void SendSQLineDel(XLine *x) override;
+class MessageServer : public messages::MessageServer
+{
+ public:
+ using messages::MessageServer::MessageServer;
- void SendSQLine(User *, XLine *x) override;
+ void Send(Server *server) override;
+};
- void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override;
+class SASL : public messages::SASL
+{
+ public:
+ using messages::SASL::SASL;
- void SendSVSHold(const Anope::string &nick, time_t t) override;
+ void Send(const ::SASL::Message &) override;
+};
- void SendSVSHoldDel(const Anope::string &nick) override;
+class SASLMechanisms : public messages::SASLMechanisms
+{
+ public:
+ using messages::SASLMechanisms::SASLMechanisms;
- void SendSZLineDel(XLine *x) override;
+ void Send(const std::vector<Anope::string> &mechanisms) override;
+};
- void SendSZLine(User *, XLine *x) override;
+class SQLine : public messages::SQLine
+{
+ Proto *proto = nullptr;
- void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override;
+ public:
+ SQLine(Module *creator, Proto *p) : messages::SQLine(creator),
+ proto(p)
+ {
+ }
- void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) override;
+ void Send(User *, XLine *) override;
+};
- void SendSWhois(const MessageSource &, const Anope::string &who, const Anope::string &mask) override;
+class SQLineDel : public messages::SQLineDel
+{
+ Proto *proto = nullptr;
- void SendBOB() override;
+ public:
+ SQLineDel(Module *creator, Proto *p) : messages::SQLineDel(creator),
+ proto(p)
+ {
+ }
- void SendEOB() override;
+ void Send(XLine *) override;
+};
+
+class SQuit : public messages::SQuit
+{
+ public:
+ using messages::SQuit::SQuit;
+
+ void Send(Server *s, const Anope::string &message) override;
+};
+
+class SZLine : public messages::SZLine
+{
+ Proto *proto = nullptr;
+
+ public:
+ SZLine(Module *creator, Proto *p) : messages::SZLine(creator),
+ proto(p)
+ {
+ }
+
+ void Send(User *, XLine *) override;
+};
+
+class SZLineDel : public messages::SZLineDel
+{
+ Proto *proto = nullptr;
+
+ public:
+ SZLineDel(Module *creator, Proto *p) : messages::SZLineDel(creator),
+ proto(p)
+ {
+ }
+
+ void Send(XLine *) override;
+};
+
+class SVSHold : public messages::SVSHold
+{
+ public:
+ using messages::SVSHold::SVSHold;
+
+ void Send(const Anope::string &, time_t) override;
+};
+
+class SVSHoldDel : public messages::SVSHoldDel
+{
+ public:
+ using messages::SVSHoldDel::SVSHoldDel;
- void SendGlobops(const MessageSource &source, const Anope::string &buf) override;
+ void Send(const Anope::string &) override;
+};
- void SendLogin(User *u, NickServ::Nick *na) override;
+class SVSLogin : public messages::SVSLogin
+{
+ public:
+ using messages::SVSLogin::SVSLogin;
- void SendLogout(User *u) override;
+ void Send(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override;
+};
- void SendChannel(Channel *c) override;
+class SWhois : public messages::SWhois
+{
+ public:
+ using messages::SWhois::SWhois;
- void SendSASLMechanisms(std::vector<Anope::string> &mechanisms) override;
+ void Send(const MessageSource &, User *user, const Anope::string &) override;
+};
- void SendSASLMessage(const SASL::Message &message) override;
+class Topic : public messages::Topic
+{
+ public:
+ using messages::Topic::Topic;
+
+ void Send(const MessageSource &source, Channel *channel, const Anope::string &topic, time_t topic_ts, const Anope::string &topic_setter) override;
+};
+
+class VhostDel : public messages::VhostDel
+{
+ Proto *proto = nullptr;
+
+ public:
+ VhostDel(Module *creator, Proto *p) : messages::VhostDel(creator),
+ proto(p)
+ {
+ }
- void SendSVSLogin(const Anope::string &uid, const Anope::string &acc, const Anope::string &vident, const Anope::string &vhost) override;
+ void Send(User *u) override;
+};
+
+class VhostSet : public messages::VhostSet
+{
+ Proto *proto = nullptr;
+
+ public:
+ VhostSet(Module *creator, Proto *p) : messages::VhostSet(creator),
+ proto(p)
+ {
+ }
+
+ void Send(User *u, const Anope::string &vident, const Anope::string &vhost) override;
+};
+
+class Wallops : public messages::Wallops
+{
+ public:
+ using messages::Wallops::Wallops;
+
+ void Send(const MessageSource &source, const Anope::string &msg) override;
+};
+
+} // namespace senders
+
+class Proto : public ts6::Proto
+{
+ public:
+ Proto(Module *creator);
+
+ void SendChgIdentInternal(const Anope::string &nick, const Anope::string &vIdent);
+
+ void SendChgHostInternal(const Anope::string &nick, const Anope::string &vhost);
+
+ void SendAddLine(const Anope::string &xtype, const Anope::string &mask, time_t duration, const Anope::string &addedby, const Anope::string &reason);
+
+ void SendDelLine(const Anope::string &xtype, const Anope::string &mask);
+
+ void Handshake() override;
+
+ void SendNumeric(int numeric, User *dest, IRCMessage &message) override;
+
+ void SendBOB() override;
+
+ void SendEOB() override;
bool IsExtbanValid(const Anope::string &mask) override;
@@ -272,7 +454,7 @@ class ServerMessage : public IRCDMessage
class SQuit : public rfc1459::SQuit
{
public:
- SQuit(Module *creator) : rfc1459::SQuit(creator) { }
+ using rfc1459::SQuit::SQuit;
void Run(MessageSource &source, const std::vector<Anope::string> &params) override;
};
diff --git a/include/modules/protocol/ngircd.h b/include/modules/protocol/ngircd.h
index fef637aca..072dfb0f6 100644
--- a/include/modules/protocol/ngircd.h
+++ b/include/modules/protocol/ngircd.h
@@ -23,46 +23,89 @@
namespace ngircd
{
-class Proto : public IRCDProto
+namespace senders
{
- void SendSVSKill(const MessageSource &source, User *user, const Anope::string &buf) override;
+class Akill : public messages::Akill
+{
public:
- Proto(Module *creator);
+ using messages::Akill::Akill;
+
+ void Send(User *, XLine *) override;
+};
+
+class AkillDel : public messages::AkillDel
+{
+ public:
+ using messages::AkillDel::AkillDel;
+
+ void Send(XLine *) override;
+};
- void SendAkill(User *u, XLine *x) override;
+class MessageChannel : public messages::MessageChannel
+{
+ public:
+ using messages::MessageChannel::MessageChannel;
- void SendAkillDel(XLine *x) override;
+ void Send(Channel *) override;
+};
- void SendChannel(Channel *c) override;
+class NickIntroduction : public messages::NickIntroduction
+{
+ public:
+ using messages::NickIntroduction::NickIntroduction;
+
+ void Send(User *user) override;
+};
- // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
- void SendClientIntroduction(User *u) override;
+class Login : public messages::Login
+{
+ public:
+ using messages::Login::Login;
- void SendConnect() override;
+ void Send(User *u, NickServ::Nick *na) override;
+};
- void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override;
+class Logout : public messages::Logout
+{
+ public:
+ using messages::Logout::Logout;
- void SendGlobalNotice(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+ void Send(User *u) override;
+};
- void SendGlobalPrivmsg(ServiceBot *bi, Server *dest, const Anope::string &msg) override;
+class SVSNick : public messages::SVSNick
+{
+ public:
+ using messages::SVSNick::SVSNick;
- void SendGlobops(const MessageSource &source, const Anope::string &buf) override;
+ void Send(User *u, const Anope::string &newnick, time_t ts) override;
+};
- void SendJoin(User *user, Channel *c, const ChannelStatus *status) override;
+class VhostDel : public messages::VhostDel
+{
+ public:
+ using messages::VhostDel::VhostDel;
- void SendLogin(User *u, NickServ::Nick *na) override;
+ void Send(User *u) override;
+};
- void SendLogout(User *u) override;
+class VhostSet : public messages::VhostSet
+{
+ public:
+ using messages::VhostSet::VhostSet;
- /* SERVER name hop descript */
- void SendServer(Server *server) override;
+ void Send(User *u, const Anope::string &vident, const Anope::string &vhost) override;
+};
- void SendTopic(const MessageSource &source, Channel *c) override;
+}
- void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override;
+class Proto : public IRCDProto
+{
+ public:
+ Proto(Module *creator);
- void SendVhostDel(User *u) override;
+ void Handshake() override;
Anope::string Format(IRCMessage &message) override;
};
@@ -72,7 +115,6 @@ class Numeric005 : public IRCDMessage
public:
Numeric005(Module *creator) : IRCDMessage(creator, "005", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
- // Please see <http://www.irc.org/tech_docs/005.html> for details.
void Run(MessageSource &source, const std::vector<Anope::string> &params) override;
};
@@ -168,4 +210,4 @@ class ServerMessage : public IRCDMessage
void Run(MessageSource &source, const std::vector&l