aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-02-27 15:50:41 +0000
committerMelanie2010-02-27 15:50:41 +0000
commita4472ceeac7d95997d9a143bfc002da22de416c6 (patch)
treeefa4b1b469def49f37962647084e4202eb2abed6 /OpenSim
parentMove requestonlinenotification generic message to presence module (diff)
downloadopensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.zip
opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.tar.gz
opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.tar.bz2
opensim-SC_OLD-a4472ceeac7d95997d9a143bfc002da22de416c6.tar.xz
Implement the requestonlinenotification method
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
index 5f51ce1..4e57394 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs
@@ -38,6 +38,7 @@ using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39using OpenSim.Services.Interfaces; 39using OpenSim.Services.Interfaces;
40using GridRegion = OpenSim.Services.Interfaces.GridRegion; 40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
41 42
42namespace OpenSim.Region.CoreModules.Avatar.InstantMessage 43namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
43{ 44{
@@ -118,6 +119,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
118 119
119 public void OnRequestOnlineNotification(Object sender, string method, List<String> args) 120 public void OnRequestOnlineNotification(Object sender, string method, List<String> args)
120 { 121 {
122 if (!(sender is IClientAPI))
123 return;
124
125 IClientAPI client = (IClientAPI)sender;
126
127 PresenceInfo[] status = PresenceService.GetAgents(args.ToArray());
128
129 List<UUID> online = new List<UUID>();
130 List<UUID> offline = new List<UUID>();
131
132 foreach (PresenceInfo pi in status)
133 {
134 if (pi.Online)
135 online.Add(new UUID(pi.UserID));
136 else
137 offline.Add(new UUID(pi.UserID));
138 }
139
140 if (online.Count > 0)
141 client.SendAgentOnline(online.ToArray());
142 if (offline.Count > 0)
143 client.SendAgentOffline(offline.ToArray());
121 } 144 }
122 } 145 }
123} 146}