/* * Anope IRC Services * * Copyright (C) 2011-2016 Anope Team * Copyright (C) 2011-2012, 2014 Alexander Barton * * This file is part of Anope. Anope is free software; you can * redistribute it and/or modify it under the terms of the GNU * General Public License as published by the Free Software * Foundation, version 2. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see see . */ #pragma once namespace ngircd { class Proto : public IRCDProto { void SendSVSKill(const MessageSource &source, User *user, const Anope::string &buf) override; public: Proto(Module *creator); void SendAkill(User *u, XLine *x) override; void SendAkillDel(XLine *x) override; void SendChannel(Channel *c) override; // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator void SendClientIntroduction(User *u) override; void SendConnect() override; void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) override; void SendGlobalNotice(ServiceBot *bi, Server *dest, const Anope::string &msg) override; void SendGlobalPrivmsg(ServiceBot *bi, Server *dest, const Anope::string &msg) override; void SendGlobops(const MessageSource &source, const Anope::string &buf) override; void SendJoin(User *user, Channel *c, const ChannelStatus *status) override; void SendLogin(User *u, NickServ::Nick *na) override; void SendLogout(User *u) override; /* SERVER name hop descript */ void SendServer(Server *server) override; void SendTopic(const MessageSource &source, Channel *c) override; void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) override; void SendVhostDel(User *u) override; Anope::string Format(IRCMessage &message) override; }; class Numeric005 : public IRCDMessage { public: Numeric005(Module *creator) : IRCDMessage(creator, "005", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } // Please see for details. void Run(MessageSource &source, const std::vector ¶ms) override; }; class ChanInfo : public IRCDMessage { public: ChanInfo(Module *creator) : IRCDMessage(creator, "CHANINFO", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } /* * CHANINFO is used by servers to inform each other about a channel: its * modes, channel key, user limits and its topic. The parameter combination * and is optional, as well as the parameter, so that * there are three possible forms of this command: * * CHANINFO + * CHANINFO + : * CHANINFO + : * * The parameter must be ignored if a channel has no key (the parameter * doesn't list the "k" channel mode). In this case should * contain "*" because the parameter is required by the CHANINFO syntax * and therefore can't be omitted. The parameter must be ignored when * a channel has no user limit (the parameter doesn't list the "l" * channel mode). In this case should be "0". */ void Run(MessageSource &source, const std::vector ¶ms); }; class Join : public rfc1459::Join { public: Join(Module *creator) : rfc1459::Join(creator, "JOIN") { } void Run(MessageSource &source, const std::vector ¶ms) override; }; class Metadata : public IRCDMessage { public: Metadata(Module *creator) : IRCDMessage(creator, "METADATA", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } void Run(MessageSource &source, const std::vector ¶ms) override; }; class Mode : public IRCDMessage { public: Mode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector ¶ms) override; }; struct Nick : public IRCDMessage { public: Nick(Module *creator) : IRCDMessage(creator, "NICK", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector ¶ms) override; }; class NJoin : public IRCDMessage { public: NJoin(Module *creator) : IRCDMessage(creator, "NJOIN", 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }; /* * RFC 2813, 4.2.2: Njoin Message: * The NJOIN message is used between servers only. * It is used when two servers connect to each other to exchange * the list of channel members for each channel. * * Even though the same function can be performed by using a succession * of JOIN, this message SHOULD be used instead as it is more efficient. * * Received: :dev.anope.de NJOIN #test :DukeP2,@DukeP,%test,+test2 */ void Run(MessageSource &source, const std::vector ¶ms) override; }; class Pong : public IRCDMessage { public: Pong(Module *creator) : IRCDMessage(creator, "PONG", 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); SetFlag(IRCDMESSAGE_REQUIRE_SERVER); } void Run(MessageSource &source, const std::vector ¶ms) override; }; class ServerMessage : public IRCDMessage { public: ServerMessage(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); } void Run(MessageSource &source, const std::vector ¶ms) override; }; } // namespace ngircd