|
List Info
Thread: Duplicated groups and contacts
|
|
| Duplicated groups and contacts |

|
2006-09-21 20:44:02 |
|
Hi Emil,
after Damian committed the implementation of Jabber two problems
occurred in the GUI. One of them was that some contacts were shown two
times and others not at all. This was a problem of indexing the contact
list in the case when we have contacts that are contained directly in
the root group. I've fixed this problem.
Another problem was that some groups were duplicated. I've debugged the
problem and I found that it comes from the MclStorageManager in the
method processGroupXmlNode. This method should load all contacts and
groups for an account. The problem is that the meta contact group is
created in the beginning before checking if it contains a proto group
for the given account, thus if there are no proto groups for the given
account an empty meta group is created and added in the contact list. I
have fixed that in the following way:
The code was:
//create the meta group
currentMetaGroup = mclServiceImpl
.loadStoredMetaContactGroup(parentGroup
, groupMetaUID
,
groupDisplayName);
//extract and load one by one all proto groups in this meta group.
Node protoGroupsNode = XMLUtils.findChild(
groupNode, PROTO_GROUPS_NODE_NAME);
NodeList protoGroups = protoGroupsNode.getChildNodes();
for (int i = 0; i < protoGroups.getLength(); i++)
{
Node currentProtoGroupNode = protoGroups.item(i);
if (currentProtoGroupNode.getNodeType() !=
Node.ELEMENT_NODE)
continue;
String groupAccountID = XMLUtils.getAttribute(
currentProtoGroupNode, ACCOUNT_ID_ATTR_NAME);
if (!accountID.equals(groupAccountID))
continue;
.....................
And now is:
//extract and load one by one all proto groups in this meta group.
Node protoGroupsNode = XMLUtils.findChild(
groupNode, PROTO_GROUPS_NODE_NAME);
NodeList protoGroups = protoGroupsNode.getChildNodes();
for (int i = 0; i < protoGroups.getLength(); i++)
{
Node currentProtoGroupNode = protoGroups.item(i);
if (currentProtoGroupNode.getNodeType() !=
Node.ELEMENT_NODE)
continue;
String groupAccountID = XMLUtils.getAttribute(
currentProtoGroupNode, ACCOUNT_ID_ATTR_NAME);
| |