aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetDisplayNamesModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs44
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 eabacb4..bf559d3 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
120 120
121 public virtual void RegisterCaps(UUID agentID, Caps caps) 121 public virtual void RegisterCaps(UUID agentID, Caps caps)
122 { 122 {
123 UUID capID = UUID.Random();
124
125 if (m_URL == "localhost") 123 if (m_URL == "localhost")
126 { 124 {
127 m_log.DebugFormat("[GET_DISPLAY_NAMES]: /CAPS/agents/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); 125 string capUrl = "/CAPS/" + UUID.Random() + "/";
126// m_log.DebugFormat("[GET_DISPLAY_NAMES]: {0} in region {1}", capUrl, m_scene.RegionInfo.RegionName);
128 caps.RegisterHandler( 127 caps.RegisterHandler(
129 "GetDisplayNames", 128 "GetDisplayNames",
130 new GetDisplayNamesHandler("/CAPS/agents" + capID + "/", m_UserManager, "GetDisplayNames", agentID.ToString())); 129 new GetDisplayNamesHandler(capUrl, m_UserManager, "GetDisplayNames", agentID.ToString()));
131 } 130 }
132 else 131 else
133 { 132 {
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
index 2ba35df..7d54a00 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
45 private static readonly ILog m_log = LogManager.GetLogger( 45 private static readonly ILog m_log = LogManager.GetLogger(
46 MethodBase.GetCurrentMethod().DeclaringType); 46 MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 protected Timer m_logTimer = new Timer(10000);
49 protected List<GridInstantMessage> m_logData = new List<GridInstantMessage>();
50 protected string m_restUrl;
51
52 /// <value> 48 /// <value>
53 /// Is this module enabled? 49 /// Is this module enabled?
54 /// </value> 50 /// </value>
@@ -68,12 +64,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
68 "InstantMessageModule", "InstantMessageModule") != 64 "InstantMessageModule", "InstantMessageModule") !=
69 "InstantMessageModule") 65 "InstantMessageModule")
70 return; 66 return;
71 m_restUrl = config.Configs["Messaging"].GetString("LogURL", String.Empty);
72 } 67 }
73 68
74 m_enabled = true; 69 m_enabled = true;
75 m_logTimer.AutoReset = false;
76 m_logTimer.Elapsed += LogTimerElapsed;
77 } 70 }
78 71
79 public virtual void AddRegion(Scene scene) 72 public virtual void AddRegion(Scene scene)
@@ -153,20 +146,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
153 } 146 }
154 147
155 #endregion 148 #endregion
156 149/*
157 public virtual void OnViewerInstantMessage(IClientAPI client, GridInstantMessage im) 150 public virtual void OnViewerInstantMessage(IClientAPI client, GridInstantMessage im)
158 { 151 {
159 im.fromAgentName = client.FirstName + " " + client.LastName; 152 im.fromAgentName = client.FirstName + " " + client.LastName;
160 OnInstantMessage(client, im); 153 OnInstantMessage(client, im);
161 } 154 }
162 155*/
163 public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im) 156 public virtual void OnInstantMessage(IClientAPI client, GridInstantMessage im)
164 { 157 {
165 byte dialog = im.dialog; 158 byte dialog = im.dialog;
166 159
167 if (client != null && dialog == (byte)InstantMessageDialog.MessageFromAgent)
168 LogInstantMesssage(im);
169
170 if (dialog != (byte)InstantMessageDialog.MessageFromAgent 160 if (dialog != (byte)InstantMessageDialog.MessageFromAgent
171 && dialog != (byte)InstantMessageDialog.StartTyping 161 && dialog != (byte)InstantMessageDialog.StartTyping
172 && dialog != (byte)InstantMessageDialog.StopTyping 162 && dialog != (byte)InstantMessageDialog.StopTyping
@@ -243,35 +233,5 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
243 // 233 //
244 OnInstantMessage(null, msg); 234 OnInstantMessage(null, msg);
245 } 235 }
246
247 protected virtual void LogInstantMesssage(GridInstantMessage im)
248 {
249 if (m_logData.Count < 20)
250 {
251 // Restart the log write timer
252 m_logTimer.Stop();
253 }
254 if (!m_logTimer.Enabled)
255 m_logTimer.Start();
256
257 lock (m_logData)
258 {
259 m_logData.Add(im);
260 }
261 }
262
263 protected virtual void LogTimerElapsed(object source, ElapsedEventArgs e)
264 {
265 lock (m_logData)
266 {
267 if (m_restUrl != String.Empty && m_logData.Count > 0)
268 {
269 bool success = SynchronousRestObjectRequester.MakeRequest<List<GridInstantMessage>, bool>("POST", m_restUrl + "/LogMessages/", m_logData);
270 if (!success)
271 m_log.ErrorFormat("[INSTANT MESSAGE]: Failed to save log data");
272 }
273 m_logData.Clear();
274 }
275 }
276 } 236 }
277} 237}