diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-23 17:16:17 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-23 17:22:25 +0000 |
commit | a697104a8c768228ce494967c11ff669d4aa3555 (patch) | |
tree | 03069ff0ec2a9f96d489b3b973ea1983f65fb1ce /src/modules/m_censor.cpp | |
parent | b7382a91384e6e9463ba85c6effec32f071dd4ca (diff) |
Add a method for getting the name of a MessageTarget.
This fixes a minor bug in the filter module where the target would
be blank in messages when a server-targetted message matches a
filter.
Diffstat (limited to 'src/modules/m_censor.cpp')
-rw-r--r-- | src/modules/m_censor.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 436b9ae53..0a83707e9 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -52,8 +52,6 @@ class ModuleCensor : public Module return MOD_RES_PASSTHRU; int numeric = 0; - const char* targetname = NULL; - switch (target.type) { case MessageTarget::TYPE_USER: @@ -63,7 +61,6 @@ class ModuleCensor : public Module return MOD_RES_PASSTHRU; numeric = ERR_CANTSENDTOUSER; - targetname = targuser->nick.c_str(); break; } @@ -78,7 +75,6 @@ class ModuleCensor : public Module return MOD_RES_PASSTHRU; numeric = ERR_CANNOTSENDTOCHAN; - targetname = targchan->name.c_str(); break; } @@ -93,7 +89,7 @@ class ModuleCensor : public Module { if (index->second.empty()) { - user->WriteNumeric(numeric, targetname, "Your message contained a censored word (" + index->first + "), and was blocked"); + user->WriteNumeric(numeric, target.GetName(), "Your message contained a censored word (" + index->first + "), and was blocked"); return MOD_RES_DENY; } |