From ca78bc4a0e54c7a76482d3fc5cdf0e7ee3a65597 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 18 Aug 2024 15:44:54 +0100 Subject: Document Write* members in the User type correctly. --- include/users.h | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/users.h b/include/users.h index b3b191e88..f6dd59a0d 100644 --- a/include/users.h +++ b/include/users.h @@ -654,42 +654,56 @@ public: /** Logs this user out of their server operator account. Does nothing to non-operators. */ void OperLogout(); + /** Write to all users that can see this user (including this user in the list if include_self is true), appending CR/LF + * @param protoev Protocol event to send, may contain any number of messages. + * @param include_self Should the message be sent back to the author? + */ + void WriteCommonRaw(ClientProtocol::Event& protoev, bool include_self = true); + /** Sends a server notice to this user. - * @param text The contents of the message to send. + * @param text The message to send. */ void WriteNotice(const std::string& text); - /** Send a NOTICE message from the local server to the user. - * @param text Text to send + /** Sends a server notice from the local server to the user. + * @param text The message to send. */ virtual void WriteRemoteNotice(const std::string& text); - virtual void WriteRemoteNumeric(const Numeric::Numeric& numeric); + /** Sends a notice to this user. + * @param numeric The numeric to send. + */ + void WriteNumeric(const Numeric::Numeric& numeric); + /** Sends a notice to this user. + * @param numeric The numeric code to send. + * @param p One or more parameters to the numeric. + */ template - void WriteRemoteNumeric(unsigned int numeric, Param&&... p) + void WriteNumeric(unsigned int numeric, Param&&... p) { Numeric::Numeric n(numeric); n.push(std::forward(p)...); - WriteRemoteNumeric(n); + WriteNumeric(n); } - void WriteNumeric(const Numeric::Numeric& numeric); + /** Sends a notice from the local server to this user. + * @param numeric The numeric to send. + */ + virtual void WriteRemoteNumeric(const Numeric::Numeric& numeric); + /** Sends a notice from the local server to this user. + * @param numeric The numeric code to send. + * @param p One or more parameters to the numeric. + */ template - void WriteNumeric(unsigned int numeric, Param&&... p) + void WriteRemoteNumeric(unsigned int numeric, Param&&... p) { Numeric::Numeric n(numeric); n.push(std::forward(p)...); - WriteNumeric(n); + WriteRemoteNumeric(n); } - /** Write to all users that can see this user (including this user in the list if include_self is true), appending CR/LF - * @param protoev Protocol event to send, may contain any number of messages. - * @param include_self Should the message be sent back to the author? - */ - void WriteCommonRaw(ClientProtocol::Event& protoev, bool include_self = true); - /** Execute a function once for each local neighbor of this user. By default, the neighbors of a user are the users * who have at least one common channel with the user. Modules are allowed to alter the set of neighbors freely. * This function is used for example to send something conditionally to neighbors, or to send different messages -- cgit v1.3.1-10-gc9f91