aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDiva Canto2010-02-27 10:24:55 -0800
committerDiva Canto2010-02-27 10:24:55 -0800
commit3906a14857eb3fbef9705240763afb9af1c9e303 (patch)
tree2fe985bc0e4910303745a0d84e89e4965d974891 /OpenSim/Region/CoreModules
parentImplement the requestonlinenotification method (diff)
downloadopensim-SC-3906a14857eb3fbef9705240763afb9af1c9e303.zip
opensim-SC-3906a14857eb3fbef9705240763afb9af1c9e303.tar.gz
opensim-SC-3906a14857eb3fbef9705240763afb9af1c9e303.tar.bz2
opensim-SC-3906a14857eb3fbef9705240763afb9af1c9e303.tar.xz
Friends online notifications upon friendship now working (same sim only).
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs16
2 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 1719447..34f14df 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -432,6 +432,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
432 GridInstantMessage im = new GridInstantMessage(client.Scene, client.AgentId, client.Name, friendID, 432 GridInstantMessage im = new GridInstantMessage(client.Scene, client.AgentId, client.Name, friendID,
433 (byte)OpenMetaverse.InstantMessageDialog.FriendshipAccepted, client.AgentId.ToString(), false, Vector3.Zero); 433 (byte)OpenMetaverse.InstantMessageDialog.FriendshipAccepted, client.AgentId.ToString(), false, Vector3.Zero);
434 friendClient.SendInstantMessage(im); 434 friendClient.SendInstantMessage(im);
435 client.SendAgentOnline(new UUID[] { friendID });
435 // we're done 436 // we're done
436 return; 437 return;
437 } 438 }
@@ -442,7 +443,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
442 { 443 {
443 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); 444 GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
444 m_FriendsSimConnector.FriendshipApproved(region, agentID, friendID); 445 m_FriendsSimConnector.FriendshipApproved(region, agentID, friendID);
446 client.SendAgentOnline(new UUID[] { friendID });
445 } 447 }
448
446 } 449 }
447 450
448 private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) 451 private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
index 4e57394..bafad82 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
@@ -123,6 +123,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
123 return; 123 return;
124 124
125 IClientAPI client = (IClientAPI)sender; 125 IClientAPI client = (IClientAPI)sender;
126 m_log.DebugFormat("[PRESENCE MODULE]: OnlineNotification requested by {0}", client.Name);
126 127
127 PresenceInfo[] status = PresenceService.GetAgents(args.ToArray()); 128 PresenceInfo[] status = PresenceService.GetAgents(args.ToArray());
128 129
@@ -131,10 +132,21 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
131 132
132 foreach (PresenceInfo pi in status) 133 foreach (PresenceInfo pi in status)
133 { 134 {
135 UUID uuid = new UUID(pi.UserID);
134 if (pi.Online) 136 if (pi.Online)
135 online.Add(new UUID(pi.UserID)); 137 {
138 if (!online.Contains(uuid))
139 {
140 online.Add(uuid);
141 if (offline.Contains(uuid))
142 offline.Remove(uuid);
143 }
144 }
136 else 145 else
137 offline.Add(new UUID(pi.UserID)); 146 {
147 if (!online.Contains(uuid) && !offline.Contains(uuid))
148 offline.Add(uuid);
149 }
138 } 150 }
139 151
140 if (online.Count > 0) 152 if (online.Count > 0)