summaryrefslogtreecommitdiff
path: root/src/coremods/core_message.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-07-07 01:42:38 +0100
committerSadie Powell <sadie@witchery.services>2020-07-07 01:49:03 +0100
commit7823761cf3bbdd58ff9c33bcc1cc72c6a36a4c25 (patch)
tree40c12753f1df949b97837539c1f4b47950da77a2 /src/coremods/core_message.cpp
parent0f6f704aa45330e34c805ba31f0ab183b39b2178 (diff)
Add a config option that forces bots to use NOTICEs.
Diffstat (limited to 'src/coremods/core_message.cpp')
-rw-r--r--src/coremods/core_message.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp
index 585e29948..c950ab24b 100644
--- a/src/coremods/core_message.cpp
+++ b/src/coremods/core_message.cpp
@@ -247,21 +247,21 @@ class CommandMessage : public Command
return CMD_FAILURE;
}
- // If the target is away then inform the user.
- if (target->IsAway() && msgtype == MSG_PRIVMSG)
- source->WriteNumeric(RPL_AWAY, target->nick, target->awaymsg);
-
// Fire the pre-message events.
MessageTarget msgtarget(target);
MessageDetailsImpl msgdetails(msgtype, parameters[1], parameters.GetTags());
if (!FirePreEvents(source, msgtarget, msgdetails))
return CMD_FAILURE;
+ // If the target is away then inform the user.
+ if (target->IsAway() && msgdetails.type == MSG_PRIVMSG)
+ source->WriteNumeric(RPL_AWAY, target->nick, target->awaymsg);
+
LocalUser* const localtarget = IS_LOCAL(target);
if (localtarget)
{
// Send to the target if they are a local user.
- ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, source, localtarget->nick, msgdetails.text, msgtype);
+ ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, source, localtarget->nick, msgdetails.text, msgdetails.type);
privmsg.AddTags(msgdetails.tags_out);
privmsg.SetSideEffect(true);
localtarget->Send(ServerInstance->GetRFCEvents().privmsg, privmsg);