change group lists control so it does show something (only xmlrpcgroups for now). This will never work without a centralized dispatcher/controler, or more complex information exchange.
parent
bdab44ef7e
commit
c4db0dd6ac
|
@ -296,15 +296,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
|
|
||||||
attemptDeliveryUuidSet
|
attemptDeliveryUuidSet
|
||||||
= new HashSet<string>(Array.ConvertAll<PresenceInfo, string>(onlineAgents, pi => pi.UserID));
|
= new HashSet<string>(Array.ConvertAll<PresenceInfo, string>(onlineAgents, pi => pi.UserID));
|
||||||
|
|
||||||
//Array.ForEach<PresenceInfo>(onlineAgents, pi => attemptDeliveryUuidSet.Add(pi.UserID));
|
|
||||||
|
|
||||||
//groupMembers = groupMembers.Where(gmd => onlineAgentsUuidSet.Contains(gmd.AgentID.ToString())).ToList();
|
|
||||||
|
|
||||||
// if (m_debugEnabled)
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members, {2} online",
|
|
||||||
// groupID, groupMembersCount, groupMembers.Count());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -387,7 +378,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
member.AgentID, Environment.TickCount - startTick);
|
member.AgentID, Environment.TickCount - startTick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if(im.dialog != (byte)InstantMessageDialog.SessionAdd &&
|
||||||
|
im.dialog != (byte)InstantMessageDialog.SessionDrop)
|
||||||
{
|
{
|
||||||
int startTick = Environment.TickCount;
|
int startTick = Environment.TickCount;
|
||||||
|
|
||||||
|
@ -443,22 +435,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
{
|
{
|
||||||
IClientAPI client = null;
|
IClientAPI client = null;
|
||||||
|
|
||||||
if (msg.dialog == (byte)InstantMessageDialog.SessionSend)
|
|
||||||
{
|
|
||||||
client = GetActiveClient(new UUID(msg.toAgentID));
|
client = GetActiveClient(new UUID(msg.toAgentID));
|
||||||
|
|
||||||
if (client != null)
|
if (client == null)
|
||||||
{
|
|
||||||
if (m_debugEnabled)
|
|
||||||
m_log.DebugFormat("[GROUPS-MESSAGING]: Delivering to {0} locally", client.Name);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[GROUPS-MESSAGING]: Received a message over the grid for a client that isn't here: {0}", msg.toAgentID);
|
m_log.WarnFormat("[GROUPS-MESSAGING]: Received a message over the grid for a client that isn't here: {0}", msg.toAgentID);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ProcessMessageFromGroupSession(msg, client);
|
ProcessMessageFromGroupSession(msg, client);
|
||||||
}
|
}
|
||||||
|
@ -471,42 +455,59 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
"[GROUPS-MESSAGING]: Session message from {0} going to agent {1}, sessionID {2}, type {3}",
|
"[GROUPS-MESSAGING]: Session message from {0} going to agent {1}, sessionID {2}, type {3}",
|
||||||
msg.fromAgentName, msg.toAgentID, msg.imSessionID, (InstantMessageDialog)msg.dialog);
|
msg.fromAgentName, msg.toAgentID, msg.imSessionID, (InstantMessageDialog)msg.dialog);
|
||||||
|
|
||||||
UUID AgentID = new UUID(msg.fromAgentID);
|
UUID fromAgentID = new UUID(msg.fromAgentID);
|
||||||
UUID GroupID = new UUID(msg.imSessionID);
|
UUID GroupID = new UUID(msg.imSessionID);
|
||||||
|
IEventQueue eq = client.Scene.RequestModuleInterface<IEventQueue>();
|
||||||
|
|
||||||
switch (msg.dialog)
|
switch (msg.dialog)
|
||||||
{
|
{
|
||||||
case (byte)InstantMessageDialog.SessionAdd:
|
case (byte)InstantMessageDialog.SessionAdd:
|
||||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
m_groupData.AgentInvitedToGroupChatSession(fromAgentID, GroupID);
|
||||||
|
if(eq != null)
|
||||||
|
eq.ChatterBoxSessionAgentListUpdates(
|
||||||
|
GroupID
|
||||||
|
, fromAgentID
|
||||||
|
, client.AgentId
|
||||||
|
, false //canVoiceChat
|
||||||
|
, false //isModerator
|
||||||
|
, false //text mute
|
||||||
|
, true // enter
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (byte)InstantMessageDialog.SessionDrop:
|
case (byte)InstantMessageDialog.SessionDrop:
|
||||||
m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID);
|
m_groupData.AgentDroppedFromGroupChatSession(fromAgentID, GroupID);
|
||||||
|
if(eq != null)
|
||||||
|
eq.ChatterBoxSessionAgentListUpdates(
|
||||||
|
GroupID
|
||||||
|
, fromAgentID
|
||||||
|
, client.AgentId
|
||||||
|
, false //canVoiceChat
|
||||||
|
, false //isModerator
|
||||||
|
, false //text mute
|
||||||
|
, false // leave
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case (byte)InstantMessageDialog.SessionSend:
|
case (byte)InstantMessageDialog.SessionSend:
|
||||||
if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID)
|
if (!m_groupData.hasAgentDroppedGroupChatSession(client.AgentId, GroupID))
|
||||||
&& !m_groupData.hasAgentBeenInvitedToGroupChatSession(AgentID, GroupID)
|
{
|
||||||
)
|
if(!m_groupData.hasAgentBeenInvitedToGroupChatSession(client.AgentId, GroupID))
|
||||||
{
|
{
|
||||||
// Agent not in session and hasn't dropped from session
|
|
||||||
// Add them to the session for now, and Invite them
|
|
||||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
|
||||||
|
|
||||||
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
|
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
|
||||||
if (groupInfo != null)
|
if (groupInfo != null)
|
||||||
{
|
{
|
||||||
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Sending chatterbox invite instant message");
|
if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Sending chatterbox invite instant message");
|
||||||
|
|
||||||
// Force? open the group session dialog???
|
if(eq != null)
|
||||||
// and simultanously deliver the message, so we don't need to do a seperate client.SendInstantMessage(msg);
|
{
|
||||||
IEventQueue eq = client.Scene.RequestModuleInterface<IEventQueue>();
|
|
||||||
eq.ChatterboxInvitation(
|
eq.ChatterboxInvitation(
|
||||||
GroupID
|
GroupID
|
||||||
, groupInfo.GroupName
|
, groupInfo.GroupName
|
||||||
, new UUID(msg.fromAgentID)
|
, fromAgentID
|
||||||
, msg.message
|
, msg.message
|
||||||
, new UUID(msg.toAgentID)
|
, client.AgentId
|
||||||
, msg.fromAgentName
|
, msg.fromAgentName
|
||||||
, msg.dialog
|
, msg.dialog
|
||||||
, msg.timestamp
|
, msg.timestamp
|
||||||
|
@ -518,32 +519,32 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
, msg.fromGroup
|
, msg.fromGroup
|
||||||
, Utils.StringToBytes(groupInfo.GroupName)
|
, Utils.StringToBytes(groupInfo.GroupName)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
client.SendInstantMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!m_groupData.hasAgentBeenInvitedToGroupChatSession(fromAgentID, GroupID))
|
||||||
|
{
|
||||||
|
m_groupData.AgentInvitedToGroupChatSession(fromAgentID, GroupID);
|
||||||
eq.ChatterBoxSessionAgentListUpdates(
|
eq.ChatterBoxSessionAgentListUpdates(
|
||||||
new UUID(GroupID)
|
GroupID
|
||||||
, new UUID(msg.fromAgentID)
|
, fromAgentID
|
||||||
, new UUID(msg.toAgentID)
|
, client.AgentId
|
||||||
, false //canVoiceChat
|
, false //canVoiceChat
|
||||||
, false //isModerator
|
, false //isModerator
|
||||||
, false //text mute
|
, false //text mute
|
||||||
, true // enter
|
, true // enter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else if (!m_groupData.hasAgentDroppedGroupChatSession(AgentID, GroupID))
|
|
||||||
{
|
|
||||||
// User hasn't dropped, so they're in the session,
|
|
||||||
// maybe we should deliver it.
|
|
||||||
client.SendInstantMessage(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
client.SendInstantMessage(msg);
|
client.SendInstantMessage(msg);
|
||||||
|
|
||||||
break;;
|
break;;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -560,14 +561,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
DebugGridInstantMessage(im);
|
DebugGridInstantMessage(im);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UUID GroupID = new UUID(im.imSessionID);
|
||||||
|
UUID AgentID = new UUID(im.fromAgentID);
|
||||||
|
|
||||||
// Start group IM session
|
// Start group IM session
|
||||||
if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart))
|
if ((im.dialog == (byte)InstantMessageDialog.SessionGroupStart))
|
||||||
{
|
{
|
||||||
if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
|
if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID);
|
||||||
|
|
||||||
UUID GroupID = new UUID(im.imSessionID);
|
|
||||||
UUID AgentID = new UUID(im.fromAgentID);
|
|
||||||
|
|
||||||
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
|
GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null);
|
||||||
|
|
||||||
if (groupInfo != null)
|
if (groupInfo != null)
|
||||||
|
@ -575,27 +576,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID);
|
||||||
|
|
||||||
ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, GroupID);
|
ChatterBoxSessionStartReplyViaCaps(remoteClient, groupInfo.GroupName, GroupID);
|
||||||
/* this seems wrong
|
|
||||||
IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
|
// we need to send here a list of known participants.
|
||||||
queue.ChatterBoxSessionAgentListUpdates(
|
im.dialog = (byte)InstantMessageDialog.SessionAdd;
|
||||||
GroupID
|
SendMessageToGroup(im, GroupID);
|
||||||
, AgentID
|
|
||||||
, new UUID(im.toAgentID)
|
|
||||||
, false //canVoiceChat
|
|
||||||
, false //isModerator
|
|
||||||
, false //text mute
|
|
||||||
, true
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send a message from locally connected client to a group
|
// Send a message from locally connected client to a group
|
||||||
if ((im.dialog == (byte)InstantMessageDialog.SessionSend))
|
if ((im.dialog == (byte)InstantMessageDialog.SessionSend))
|
||||||
{
|
{
|
||||||
UUID GroupID = new UUID(im.imSessionID);
|
|
||||||
UUID AgentID = new UUID(im.fromAgentID);
|
|
||||||
|
|
||||||
if (m_debugEnabled)
|
if (m_debugEnabled)
|
||||||
m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString());
|
m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString());
|
||||||
|
|
||||||
|
@ -604,6 +594,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
|
|
||||||
SendMessageToGroup(im, GroupID);
|
SendMessageToGroup(im, GroupID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((im.dialog == (byte)InstantMessageDialog.SessionDrop))
|
||||||
|
{
|
||||||
|
if (m_debugEnabled)
|
||||||
|
m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString());
|
||||||
|
|
||||||
|
m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID);
|
||||||
|
|
||||||
|
SendMessageToGroup(im, GroupID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -803,13 +803,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
{
|
{
|
||||||
if (m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
|
if (m_groupsAgentsDroppedFromChatSession.ContainsKey(groupID))
|
||||||
{
|
{
|
||||||
|
if (m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID))
|
||||||
|
m_groupsAgentsInvitedToChatSession[groupID].Remove(agentID);
|
||||||
|
|
||||||
// If not in dropped list, add
|
// If not in dropped list, add
|
||||||
if (!m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
if (!m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
||||||
{
|
|
||||||
m_groupsAgentsDroppedFromChatSession[groupID].Add(agentID);
|
m_groupsAgentsDroppedFromChatSession[groupID].Add(agentID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
public void AgentInvitedToGroupChatSession(UUID agentID, UUID groupID)
|
||||||
{
|
{
|
||||||
|
@ -818,9 +819,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
|
||||||
|
|
||||||
// If nessesary, remove from dropped list
|
// If nessesary, remove from dropped list
|
||||||
if (m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
if (m_groupsAgentsDroppedFromChatSession[groupID].Contains(agentID))
|
||||||
{
|
|
||||||
m_groupsAgentsDroppedFromChatSession[groupID].Remove(agentID);
|
m_groupsAgentsDroppedFromChatSession[groupID].Remove(agentID);
|
||||||
}
|
|
||||||
|
if (!m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID))
|
||||||
|
m_groupsAgentsInvitedToChatSession[groupID].Add(agentID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateGroupChatSessionTracking(UUID groupID)
|
private void CreateGroupChatSessionTracking(UUID groupID)
|
||||||
|
|
Loading…
Reference in New Issue