summaryrefslogtreecommitdiff
path: root/src/modules/m_censor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_censor.cpp')
-rw-r--r--src/modules/m_censor.cpp6
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;
}