From aab1601642ef6c1b028fc3160e809732ab4d1769 Mon Sep 17 00:00:00 2001 From: idb Date: Sat, 7 Mar 2009 14:16:26 +0000 Subject: Limit the message length from llInstantMessage to 1024 characters http://wiki.secondlife.com/wiki/LlInstantMessage Also truncate messages that may exceed the limit set by the packet size. The limit in OpenMetaverse is 1100 bytes including a zero byte terminator. Fixes Mantis #3244 --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6bb0fe9..69d9c38 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2717,7 +2717,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //{ // msg.fromAgentName = "(hippos)";// Added for posterity. This means that we can't figure out who sent it //} - msg.message = message; + // Cap the message length at 1024. + if (message != null && message.Length > 1024) + msg.message = message.Substring(0, 1024); + else + msg.message = message; msg.dialog = (byte)19; // messgage from script ??? // dialog; msg.fromGroup = false;// fromGroup; msg.offline = (byte)0; //offline; -- cgit v1.1