diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-21 16:35:27 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-22 00:14:08 +0000 |
commit | c4ab550ec719a80abada719dbe8680be806c370f (patch) | |
tree | 371e5b11134303336719c9a18affdfeab3afcb25 /include/protocol.h | |
parent | 3ecf6b495b02bdabe317547fe4bcf2179e3fb6d7 (diff) |
Add Uplink::Send, rework message formatting.
This is the new way of sending messages to the uplink inspired by
the work done in the old git master. This will allow us to do new
things involving tags in the future.
Diffstat (limited to 'include/protocol.h')
-rw-r--r-- | include/protocol.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/protocol.h b/include/protocol.h index 29943d0e0..ec4570490 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -51,10 +51,20 @@ public: * @return If the message was well formed then true; otherwise, false. */ virtual bool Parse(const Anope::string &message, Anope::map<Anope::string> &tags, Anope::string &source, Anope::string &command, std::vector<Anope::string> ¶ms); - virtual Anope::string Format(const Anope::string &source, const Anope::string &message); + + /* Formats an outgoing message so it can be sent to the IRC server. + * @param message The location to store the formatted message. + * @param tags IRCv3 message tags. + * @param source Source of the message. + * @param command Command name. + * @param params Any extra parameters. + * @return If the message was formatted then true; otherwise, false. + */ + virtual bool Format(Anope::string &message, const Anope::map<Anope::string> &tags, const MessageSource &source, const Anope::string &command, const std::vector<Anope::string> ¶ms); /* Modes used by default by our clients */ Anope::string DefaultPseudoclientModes = "+io"; + /* Can we force change a users's nick? */ bool CanSVSNick = false; @@ -279,7 +289,7 @@ class CoreExport MessageSource final Server *s = nullptr; public: - MessageSource(const Anope::string &); + explicit MessageSource(const Anope::string &); MessageSource(User *u); MessageSource(Server *s); const Anope::string &GetName() const; |