aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/1588_world.sql9
-rw-r--r--src/game/Level2.cpp8
2 files changed, 15 insertions, 2 deletions
diff --git a/sql/updates/1588_world.sql b/sql/updates/1588_world.sql
new file mode 100644
index 00000000000..d7ccaeaf6d6
--- /dev/null
+++ b/sql/updates/1588_world.sql
@@ -0,0 +1,9 @@
+# 1588
+DELETE FROM `trinity_string` WHERE `entry` IN(301, 300);
+INSERT INTO `trinity_string` (`entry`, `content_default`)VALUES
+('300', 'Your chat has been disabled for %u minutes. Reason: %s.'),
+('301', 'You have disabled %s\'s chat for %u minutes. Reason: %s.');
+
+DELETE FROM `command` WHERE `name` = 'mute';
+INSERT INTO `command` (`name`, `security`, `help`) VALUES
+('mute', 1 ,'Syntax: .mute [$playerName] $timeInMinutes [$reason]\r\n\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $timeInMinutes minutes. Player can be offline.');
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 4caa6f29578..4e80cfda1d7 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -69,6 +69,10 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if(!timetonotspeak)
return false;
+ char *mutereason = strtok(NULL, " ");
+ if(!mutereason)
+ strcpy(mutereason, "No reason.");
+
uint32 notspeaktime = (uint32) atoi(timetonotspeak);
if(!normalizePlayerName(cname))
@@ -118,9 +122,9 @@ bool ChatHandler::HandleMuteCommand(const char* args)
LoginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id );
if(chr)
- ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime);
+ ChatHandler(chr).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereason);
- PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime);
+ PSendSysMessage(LANG_YOU_DISABLE_CHAT, cname.c_str(), notspeaktime, mutereason);
return true;
}