GroupChatSessions.add(msg.SessionID, new ArrayList<ChatSessionMember>());
}
for (int i = 0; i < msg.Updates.length; i++)
{
ChatSessionMember fndMbr;
synchronized (GroupChatSessions.getDictionary())
{
fndMbr = findChatSessionMember(GroupChatSessions.get(msg.SessionID), msg.Updates[i].AgentID);
}
if (msg.Updates[i].Transition != null)
{
if (msg.Updates[i].Transition.equals("ENTER"))
{
if (fndMbr.AvatarKey == UUID.Zero)
{
fndMbr = new ChatSessionMember();
fndMbr.AvatarKey = msg.Updates[i].AgentID;
synchronized (GroupChatSessions.getDictionary())
{
GroupChatSessions.get(msg.SessionID).add(fndMbr);
}
if (onChatSessionMemberAdded != null)
{
onChatSessionMemberAdded.raiseEvent(new ChatSessionMemberAddedEventArgs(msg.SessionID, fndMbr.AvatarKey));
}
}
}
else if (msg.Updates[i].Transition.equals("LEAVE"))
{
if (fndMbr.AvatarKey != UUID.Zero)
synchronized (GroupChatSessions.getDictionary())
{
GroupChatSessions.get(msg.SessionID).remove(fndMbr);
}
if (onChatSessionMemberLeft != null)
{
onChatSessionMemberLeft.raiseEvent(new ChatSessionMemberLeftEventArgs(msg.SessionID, msg.Updates[i].AgentID));
}
}
}
// handle updates
ChatSessionMember update_member = findChatSessionMember(GroupChatSessions.getDictionary().get(msg.SessionID), msg.Updates[i].AgentID);
update_member.MuteText = msg.Updates[i].MuteText;
update_member.MuteVoice = msg.Updates[i].MuteVoice;