Show last online status of group members from the PresenceService in group profiles

Signed-off-by: Oren Hurvitz <orenh@kitely.com>
This commit is contained in:
Cinder
2015-07-30 08:50:07 -06:00
committed by Oren Hurvitz
parent 14b4d8bad7
commit 368ea78d14
3 changed files with 80 additions and 48 deletions

View File

@@ -307,6 +307,21 @@ namespace OpenSim.Groups
m.Contribution = Int32.Parse(d.Data["Contribution"]);
m.ListInProfile = d.Data["ListInProfile"] == "1" ? true : false;
GridUserData gud = m_GridUserService.Get(d.PrincipalID);
if (gud != null)
{
if (bool.Parse(gud.Data["Online"]))
{
m.OnlineStatus = @"Online";
}
else
{
int unixtime = int.Parse(gud.Data["Login"]);
// The viewer is very picky about how these strings are formed. Eg. it will crash on malformed dates!
m.OnlineStatus = (unixtime == 0) ? @"unknown" : Util.ToDateTime(unixtime).ToString("MM/dd/yyyy");
}
}
// Is this person an owner of the group?
m.IsOwner = (rolemembershipsList.Find(r => r.RoleID == ownerRoleID) != null) ? true : false;