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.
0.7.4.1
Talun 2012-07-05 23:34:23 +01:00 committed by Justin Clark-Casey (justincc)
parent 1b1f841c6a
commit ae1f2114f5
1 changed files with 8 additions and 0 deletions

View File

@ -192,6 +192,14 @@ namespace OpenSim.Region.OptionalModules.World.NPC
private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType) private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType)
{ {
if (channel == 0)
{
message = message.Trim();
if (string.IsNullOrEmpty(message))
{
return;
}
}
OSChatMessage chatFromClient = new OSChatMessage(); OSChatMessage chatFromClient = new OSChatMessage();
chatFromClient.Channel = channel; chatFromClient.Channel = channel;
chatFromClient.From = Name; chatFromClient.From = Name;