From 49e2df0307b41f76529f26da2fa26456c179cdb2 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 1 Mar 2016 16:15:59 +0100 Subject: [PATCH] Add User::WriteRemoteNotice() Sends a NOTICE from the local server to the user which can be local or remote --- include/users.h | 11 +++++++++++ src/users.cpp | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/users.h b/include/users.h index 5e7df74ea..8d53197ba 100644 --- a/include/users.h +++ b/include/users.h @@ -519,6 +519,11 @@ class CoreExport User : public Extensible */ void WriteNotice(const std::string& text) { this->WriteCommand("NOTICE", ":" + text); } + /** Send a NOTICE message from the local server to the user. + * @param text Text to send + */ + virtual void WriteRemoteNotice(const std::string& text); + void WriteRemoteNumeric(const Numeric::Numeric& numeric); template @@ -847,6 +852,12 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_nodeWriteFrom(user, textbuffer); } +void User::WriteRemoteNotice(const std::string& text) +{ + ServerInstance->PI->SendUserNotice(this, text); +} + +void LocalUser::WriteRemoteNotice(const std::string& text) +{ + WriteNotice(text); +} + namespace { class WriteCommonRawHandler : public User::ForEachNeighborHandler