summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_ircv3_ctctags.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp
index 06896c905..e22c1f125 100644
--- a/src/modules/m_ircv3_ctctags.cpp
+++ b/src/modules/m_ircv3_ctctags.cpp
@@ -41,6 +41,13 @@ class CommandTagMsg : public Command
return false;
}
+ // Check whether a module zapped the message tags.
+ if (msgdetails.tags_out.empty())
+ {
+ source->WriteNumeric(ERR_NOTEXTTOSEND, "No tags to send");
+ return false;
+ }
+
// Inform modules that a TAGMSG is about to be sent.
FOREACH_MOD_CUSTOM(tagevprov, CTCTags::EventListener, OnUserTagMessage, (source, msgtarget, msgdetails));
return true;
@@ -209,6 +216,13 @@ class CommandTagMsg : public Command
if (CommandParser::LoopCall(user, this, parameters, 0))
return CMD_SUCCESS;
+ // The specified message tags were empty.
+ if (parameters.GetTags().empty())
+ {
+ user->WriteNumeric(ERR_NOTEXTTOSEND, "No tags to send");
+ return CMD_FAILURE;
+ }
+
// Check that the source has the message tags capability.
if (IS_LOCAL(user) && !cap.get(user))
return CMD_FAILURE;