@@ -27,9 +27,6 @@ public static class Chat
2727 public static bool SendGlobal([NotNull] Player player, [NotNull] string rawMessage) {
2828 if (player == null) throw new ArgumentNullException("player");
2929 if (rawMessage == null) throw new ArgumentNullException("rawMessage");
30-
31- rawMessage = Filter(rawMessage, player);
32- if (rawMessage == null) return false;
3330
3431 var recipientList = Server.Players.NotIgnoring(player);
3532
@@ -553,21 +550,20 @@ public static bool IRCSendStaff([NotNull] string player, [NotNull] string rawMes
553550 static bool SendInternal([NotNull] ChatSendingEventArgs e)
554551 {
555552 if (e == null) throw new ArgumentNullException("e");
553+
554+ e.FormattedMessage = Filter(e.FormattedMessage, e.Player);
555+ if (e.FormattedMessage == null) return false;
556556 if (RaiseSendingEvent(e)) return false;
557557
558558 Player[] players = e.RecepientList.ToArray();
559559 int packets = players.Message(e.FormattedMessage);
560560
561- // Only increment the MessagesWritten count if someone other than
562- // the player was on the recepient list.
563- if (players.Length > 1 || (players.Length == 1 && players[0] != e.Player))
564- {
561+ // Only increment MessagesWritten if someone other than the player was on the recepient list.
562+ if (players.Length > 1 || (players.Length == 1 && players[0] != e.Player)) {
565563 e.Player.Info.ProcessMessageWritten();
566564 }
567565
568- if (e.MessageType != ChatMessageType.SayStaff && e.MessageType != ChatMessageType.StaffSayOwner) {
569- RaiseSentEvent(e, packets);
570- }
566+ RaiseSentEvent(e, packets);
571567 return true;
572568 }
573569
0 commit comments