From 58a0a7e01422e62de1565a8eb0a1febdc463d04d Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 13 Aug 2018 20:17:46 +0100 Subject: Implement IRCv3 message tag support. Co-authored-by: Attila Molnar --- src/modules/m_showfile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/modules/m_showfile.cpp') diff --git a/src/modules/m_showfile.cpp b/src/modules/m_showfile.cpp index 565aaf78b..99c545140 100644 --- a/src/modules/m_showfile.cpp +++ b/src/modules/m_showfile.cpp @@ -63,13 +63,14 @@ class CommandShowFile : public Command user->WriteRemoteNumeric(endnumeric, endtext.c_str()); } - else + else if (IS_LOCAL(user)) { - const char* msgcmd = (method == SF_MSG ? "PRIVMSG" : "NOTICE"); + LocalUser* const localuser = IS_LOCAL(user); for (file_cache::const_iterator i = contents.begin(); i != contents.end(); ++i) { const std::string& line = *i; - user->WriteCommand(msgcmd, ":" + line); + ClientProtocol::Messages::Privmsg msg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, localuser, line, ((method == SF_MSG) ? MSG_PRIVMSG : MSG_NOTICE)); + localuser->Send(ServerInstance->GetRFCEvents().privmsg, msg); } } return CMD_SUCCESS; -- cgit v1.3.1-10-gc9f91