From 8dd9601fdcdaf77060446f40e69b3d1524afa31f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Nov 2016 00:42:08 +0000 Subject: [PATCH] minor change to getdisplaynames cap url --- .../Linden/Caps/GetDisplayNamesModule.cs | 7 ++- .../InstantMessage/InstantMessageModule.cs | 44 +------------------ 2 files changed, 5 insertions(+), 46 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs index eabacb42dd..bf559d3abe 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs @@ -120,14 +120,13 @@ namespace OpenSim.Region.ClientStack.Linden public virtual void RegisterCaps(UUID agentID, Caps caps) { - UUID capID = UUID.Random(); - if (m_URL == "localhost") { - m_log.DebugFormat("[GET_DISPLAY_NAMES]: /CAPS/agents/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); + string capUrl = "/CAPS/" + UUID.Random() + "/"; +// m_log.DebugFormat("[GET_DISPLAY_NAMES]: {0} in region {1}", capUrl, m_scene.RegionInfo.RegionName); caps.RegisterHandler( "GetDisplayNames", - new GetDisplayNamesHandler("/CAPS/agents" + capID + "/", m_UserManager, "GetDisplayNames", agentID.ToString())); + new GetDisplayNamesHandler(capUrl, m_UserManager, "GetDisplayNames", agentID.ToString())); } else { diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 2ba35df092..7d54a00c7f 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -45,10 +45,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - protected Timer m_logTimer = new Timer(10000); - protected List m_logData = new List(); - protected string m_restUrl; - /// /// Is this module enabled? /// @@ -68,12 +64,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "InstantMessageModule", "InstantMessageModule") != "InstantMessageModule") return; - m_restUrl = config.Configs["Messaging"].GetString("LogURL", String.Empty); } m_enabled = true; - m_logTimer.AutoReset = false; - m_logTimer.Elapsed += LogTimerElapsed; } public virtual void AddRegion(Scene scene) @@ -153,20 +146,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } #endregion - +/* public virtual void OnViewerInstantMessage(IClientAPI client, GridInstantMessage im) { im.fromAgentName = client.FirstName + " " + client.LastName; OnInstantMessage(client, im); } - +*/ public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) { byte dialog = im.dialog; - if (client != null && dialog == (byte)InstantMessageDialog.MessageFromAgent) - LogInstantMesssage(im); - if (dialog != (byte)InstantMessageDialog.MessageFromAgent && dialog != (byte)InstantMessageDialog.StartTyping && dialog != (byte)InstantMessageDialog.StopTyping @@ -243,35 +233,5 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // OnInstantMessage(null, msg); } - - protected virtual void LogInstantMesssage(GridInstantMessage im) - { - if (m_logData.Count < 20) - { - // Restart the log write timer - m_logTimer.Stop(); - } - if (!m_logTimer.Enabled) - m_logTimer.Start(); - - lock (m_logData) - { - m_logData.Add(im); - } - } - - protected virtual void LogTimerElapsed(object source, ElapsedEventArgs e) - { - lock (m_logData) - { - if (m_restUrl != String.Empty && m_logData.Count > 0) - { - bool success = SynchronousRestObjectRequester.MakeRequest, bool>("POST", m_restUrl + "/LogMessages/", m_logData); - if (!success) - m_log.ErrorFormat("[INSTANT MESSAGE]: Failed to save log data"); - } - m_logData.Clear(); - } - } } }