From ae1f2114f5ccb0422536ec73feb2dbf16c2645fd Mon Sep 17 00:00:00 2001 From: Talun Date: Thu, 5 Jul 2012 23:34:23 +0100 Subject: [PATCH] Mantis 6077 trim NPC chat on channel zero. This patch trims leading and trailing spaces from NPC chat and suppresses the sending of empty chat strings on open chat channel 0. --- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 43a09ec25c..9b3400da78 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -192,6 +192,14 @@ namespace OpenSim.Region.OptionalModules.World.NPC private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType) { + if (channel == 0) + { + message = message.Trim(); + if (string.IsNullOrEmpty(message)) + { + return; + } + } OSChatMessage chatFromClient = new OSChatMessage(); chatFromClient.Channel = channel; chatFromClient.From = Name;