mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Fix opchat/adminchat/PM not triggering auto mute, fixes #488. (Thanks goodlyay)
This commit is contained in:
parent
0da31735e5
commit
1aa1f977b4
@ -22,11 +22,7 @@ namespace MCGalaxy {
|
||||
public static bool Handle(Player p, string text) {
|
||||
if (text.Length >= 2 && text[0] == '@' && text[1] == '@') {
|
||||
text = text.Remove(0, 2);
|
||||
if (text.Length < 1) { Player.Message(p, "No message entered"); return true; }
|
||||
|
||||
Player.Message(p, "[<] Console: &f" + text);
|
||||
string name = p == null ? "(console)" : p.name;
|
||||
Logger.Log(LogType.PrivateChat, "{0} @(console): {1}", name, text);
|
||||
DoConsolePM(p, text);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -85,6 +81,7 @@ namespace MCGalaxy {
|
||||
pl => (p == pl || pl.Rank >= perm) && Chat.NotIgnoring(p, pl),
|
||||
displayName, message);
|
||||
|
||||
if (p != null) p.CheckForMessageSpam();
|
||||
Logger.Log(LogType.StaffChat, "({0}): {1}: {2}", group, name, message);
|
||||
Server.IRC.Say(displayName + "%S: " + message, true);
|
||||
}
|
||||
@ -95,14 +92,25 @@ namespace MCGalaxy {
|
||||
if (who == p) { Player.Message(p, "Trying to talk to yourself, huh?"); return; }
|
||||
|
||||
if (who.Ignores.All) {
|
||||
DoFakePM(p, who, message); return;
|
||||
}
|
||||
if (p != null && who.Ignores.Names.CaselessContains(p.name)) {
|
||||
DoFakePM(p, who, message); return;
|
||||
}
|
||||
DoFakePM(p, who, message);
|
||||
} else if (p != null && who.Ignores.Names.CaselessContains(p.name)) {
|
||||
DoFakePM(p, who, message);
|
||||
} else {
|
||||
DoPM(p, who, message);
|
||||
}
|
||||
|
||||
if (p != null) p.CheckForMessageSpam();
|
||||
}
|
||||
|
||||
static void DoConsolePM(Player p, string message) {
|
||||
if (message.Length < 1) { Player.Message(p, "No message entered"); return; }
|
||||
Player.Message(p, "[<] Console: &f" + message);
|
||||
string name = p == null ? "(console)" : p.name;
|
||||
Logger.Log(LogType.PrivateChat, "{0} @(console): {1}", name, message);
|
||||
|
||||
if (p != null) p.CheckForMessageSpam();
|
||||
}
|
||||
|
||||
static void DoFakePM(Player p, Player who, string message) {
|
||||
string name = p == null ? "(console)" : p.name;
|
||||
Logger.Log(LogType.PrivateChat, "{0} @{1}: {2}", name, who.name, message);
|
||||
|
Loading…
x
Reference in New Issue
Block a user