diff options
6 files changed, 32 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs index dee86df..7753c25 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs | |||
@@ -196,10 +196,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
196 | 196 | ||
197 | Util.FireAndForget(delegate | 197 | Util.FireAndForget(delegate |
198 | { | 198 | { |
199 | bool success = m_IMService.OutgoingInstantMessage(im, url, foreigner); | 199 | bool success = false; |
200 | if (!success && account == null) | 200 | if (foreigner && url == string.Empty) // we don't know about this user |
201 | { | 201 | { |
202 | // One last chance | ||
203 | string recipientUUI = TryGetRecipientUUI(new UUID(im.fromAgentID), toAgentID); | 202 | string recipientUUI = TryGetRecipientUUI(new UUID(im.fromAgentID), toAgentID); |
204 | m_log.DebugFormat("[HG MESSAGE TRANSFER]: Got UUI {0}", recipientUUI); | 203 | m_log.DebugFormat("[HG MESSAGE TRANSFER]: Got UUI {0}", recipientUUI); |
205 | if (recipientUUI != string.Empty) | 204 | if (recipientUUI != string.Empty) |
@@ -213,6 +212,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
213 | } | 212 | } |
214 | } | 213 | } |
215 | } | 214 | } |
215 | else | ||
216 | success = m_IMService.OutgoingInstantMessage(im, url, foreigner); | ||
217 | |||
216 | if (!success && !foreigner) | 218 | if (!success && !foreigner) |
217 | HandleUndeliveredMessage(im, result); | 219 | HandleUndeliveredMessage(im, result); |
218 | else | 220 | else |
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 9961164..2022d8a 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | |||
@@ -268,18 +268,18 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
268 | ids.Add(requestData[key].ToString()); | 268 | ids.Add(requestData[key].ToString()); |
269 | } | 269 | } |
270 | 270 | ||
271 | List<UUID> online = m_HomeUsersService.GetOnlineFriends(userID, ids); | 271 | //List<UUID> online = m_HomeUsersService.GetOnlineFriends(userID, ids); |
272 | if (online.Count > 0) | 272 | //if (online.Count > 0) |
273 | { | 273 | //{ |
274 | int i = 0; | 274 | // int i = 0; |
275 | foreach (UUID id in online) | 275 | // foreach (UUID id in online) |
276 | { | 276 | // { |
277 | hash["friend_" + i.ToString()] = id.ToString(); | 277 | // hash["friend_" + i.ToString()] = id.ToString(); |
278 | i++; | 278 | // i++; |
279 | } | 279 | // } |
280 | } | 280 | //} |
281 | else | 281 | //else |
282 | hash["result"] = "No Friends Online"; | 282 | // hash["result"] = "No Friends Online"; |
283 | } | 283 | } |
284 | 284 | ||
285 | XmlRpcResponse response = new XmlRpcResponse(); | 285 | XmlRpcResponse response = new XmlRpcResponse(); |
diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs index 66cf4de..90a0bf2 100644 --- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs +++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs | |||
@@ -185,7 +185,6 @@ namespace OpenSim.Services.HypergridService | |||
185 | { | 185 | { |
186 | lookupAgent = true; | 186 | lookupAgent = true; |
187 | upd = null; | 187 | upd = null; |
188 | url = string.Empty; | ||
189 | } | 188 | } |
190 | } | 189 | } |
191 | else | 190 | else |
@@ -221,19 +220,16 @@ namespace OpenSim.Services.HypergridService | |||
221 | url = m_UserAgentService.LocateUser(toAgentID); | 220 | url = m_UserAgentService.LocateUser(toAgentID); |
222 | } | 221 | } |
223 | 222 | ||
224 | if (upd != null || url != string.Empty) | 223 | // check if we've tried this before.. |
224 | // This is one way to end the recursive loop | ||
225 | // | ||
226 | if (!firstTime && ((previousLocation is PresenceInfo && upd != null && upd.RegionID == ((PresenceInfo)previousLocation).RegionID) || | ||
227 | (previousLocation is string && upd == null && previousLocation.Equals(url)))) | ||
225 | { | 228 | { |
226 | // check if we've tried this before.. | 229 | // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); |
227 | // This is one way to end the recursive loop | 230 | m_log.DebugFormat("[HG IM SERVICE]: Fail 2 {0} {1}", previousLocation, url); |
228 | // | ||
229 | if (!firstTime && ((previousLocation is PresenceInfo && upd != null && upd.RegionID == ((PresenceInfo)previousLocation).RegionID) || | ||
230 | (previousLocation is string && upd == null && previousLocation.Equals(url)))) | ||
231 | { | ||
232 | // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); | ||
233 | m_log.DebugFormat("[HG IM SERVICE]: Fail 2 {0} {1}", previousLocation, url); | ||
234 | 231 | ||
235 | return false; | 232 | return false; |
236 | } | ||
237 | } | 233 | } |
238 | } | 234 | } |
239 | 235 | ||
@@ -332,10 +328,6 @@ namespace OpenSim.Services.HypergridService | |||
332 | else | 328 | else |
333 | { | 329 | { |
334 | // try again, but lookup user this time. | 330 | // try again, but lookup user this time. |
335 | // Warning, this must call the Async version | ||
336 | // of this method or we'll be making thousands of threads | ||
337 | // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync | ||
338 | // The version that spawns the thread is SendGridInstantMessageViaXMLRPC | ||
339 | 331 | ||
340 | // This is recursive!!!!! | 332 | // This is recursive!!!!! |
341 | return TrySendInstantMessage(im, url, false, foreigner); | 333 | return TrySendInstantMessage(im, url, false, foreigner); |
@@ -348,13 +340,17 @@ namespace OpenSim.Services.HypergridService | |||
348 | if (m_RestURL != string.Empty && (im.offline != 0) | 340 | if (m_RestURL != string.Empty && (im.offline != 0) |
349 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) | 341 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) |
350 | { | 342 | { |
343 | m_log.DebugFormat("[HG IM SERVICE]: Message saved"); | ||
351 | return SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( | 344 | return SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( |
352 | "POST", m_RestURL + "/SaveMessage/", im); | 345 | "POST", m_RestURL + "/SaveMessage/", im); |
353 | 346 | ||
354 | } | 347 | } |
355 | 348 | ||
356 | else | 349 | else |
350 | { | ||
351 | m_log.DebugFormat("[HG IM SERVICE]: No offline IM service, message not saved"); | ||
357 | return false; | 352 | return false; |
353 | } | ||
358 | } | 354 | } |
359 | } | 355 | } |
360 | } | 356 | } |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 2f2ebfb..8d78f97 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -482,7 +482,7 @@ namespace OpenSim.Services.HypergridService | |||
482 | { | 482 | { |
483 | foreach (TravelingAgentInfo t in m_TravelingAgents.Values) | 483 | foreach (TravelingAgentInfo t in m_TravelingAgents.Values) |
484 | { | 484 | { |
485 | if (t.UserID == userID) | 485 | if (t.UserID == userID && !m_GridName.Equals(t.GridExternalName)) |
486 | return t.GridExternalName; | 486 | return t.GridExternalName; |
487 | } | 487 | } |
488 | 488 | ||
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index 82ec8ce..3c6fedf 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Services.Interfaces | |||
62 | string GetUUI(UUID userID, UUID targetUserID); | 62 | string GetUUI(UUID userID, UUID targetUserID); |
63 | 63 | ||
64 | void StatusNotification(List<string> friends, UUID userID, bool online); | 64 | void StatusNotification(List<string> friends, UUID userID, bool online); |
65 | List<UUID> GetOnlineFriends(UUID userID, List<string> friends); | 65 | //List<UUID> GetOnlineFriends(UUID userID, List<string> friends); |
66 | 66 | ||
67 | bool AgentIsComingHome(UUID sessionID, string thisGridExternalName); | 67 | bool AgentIsComingHome(UUID sessionID, string thisGridExternalName); |
68 | bool VerifyAgent(UUID sessionID, string token); | 68 | bool VerifyAgent(UUID sessionID, string token); |
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 574375e..8480a77 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini | |||
@@ -160,6 +160,7 @@ | |||
160 | GridService = "OpenSim.Services.GridService.dll:GridService" | 160 | GridService = "OpenSim.Services.GridService.dll:GridService" |
161 | PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" | 161 | PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" |
162 | UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" | 162 | UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService" |
163 | InGatekeeper = True | ||
163 | 164 | ||
164 | 165 | ||
165 | ;; This should always be the very last thing on this file | 166 | ;; This should always be the very last thing on this file |