summaryrefslogtreecommitdiff
path: root/src/modules/m_showfile.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-08-13 20:17:46 +0100
committerPeter Powell <petpow@saberuk.com>2018-08-13 21:51:11 +0100
commit58a0a7e01422e62de1565a8eb0a1febdc463d04d (patch)
tree8861789deefe9df3524690de8ccd11e5366f1f2e /src/modules/m_showfile.cpp
parente2a820cce21342478653a34cf8ce2b593128d035 (diff)
Implement IRCv3 message tag support.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
Diffstat (limited to 'src/modules/m_showfile.cpp')
-rw-r--r--src/modules/m_showfile.cpp7
1 files changed, 4 insertions, 3 deletions
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;