Commit b362997c authored by Mike McCarthy's avatar Mike McCarthy Committed by michaelcmccarthy

OF-418 - Now the RosterItemProvider is an interface, we should really use that...

OF-418 - Now the RosterItemProvider is an interface, we should really use that provider's returned RosterItem, otherwise the create method may as well be void.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13349 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8042f232
...@@ -145,7 +145,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -145,7 +145,7 @@ public class Roster implements Cacheable, Externalizable {
rosterItems.put(item.getJid().toBareJID(), item); rosterItems.put(item.getJid().toBareJID(), item);
} }
// Add RosterItems that belong only to shared groups // Add RosterItems that belong only to shared groups
Map<JID,List<Group>> sharedUsers = getSharedUsers(sharedGroups); Map<JID, List<Group>> sharedUsers = getSharedUsers(sharedGroups);
for (Map.Entry<JID, List<Group>> entry : sharedUsers.entrySet()) { for (Map.Entry<JID, List<Group>> entry : sharedUsers.entrySet()) {
JID jid = entry.getKey(); JID jid = entry.getKey();
List<Group> groups = entry.getValue(); List<Group> groups = entry.getValue();
...@@ -153,14 +153,13 @@ public class Roster implements Cacheable, Externalizable { ...@@ -153,14 +153,13 @@ public class Roster implements Cacheable, Externalizable {
Collection<Group> itemGroups = new ArrayList<Group>(); Collection<Group> itemGroups = new ArrayList<Group>();
String nickname = ""; String nickname = "";
RosterItem item = new RosterItem(jid, RosterItem.SUB_TO, RosterItem.ASK_NONE, RosterItem item = new RosterItem(jid, RosterItem.SUB_TO, RosterItem.ASK_NONE,
RosterItem.RECV_NONE, nickname , null); RosterItem.RECV_NONE, nickname, null);
// Add the shared groups to the new roster item // Add the shared groups to the new roster item
for (Group group : groups) { for (Group group : groups) {
if (group.isUser(jid)) { if (group.isUser(jid)) {
item.addSharedGroup(group); item.addSharedGroup(group);
itemGroups.add(group); itemGroups.add(group);
} } else {
else {
item.addInvisibleSharedGroup(group); item.addInvisibleSharedGroup(group);
} }
} }
...@@ -168,8 +167,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -168,8 +167,7 @@ public class Roster implements Cacheable, Externalizable {
// that is mutually visible with a shared group of the new roster item // that is mutually visible with a shared group of the new roster item
if (rosterManager.hasMutualVisibility(username, sharedGroups, jid, itemGroups)) { if (rosterManager.hasMutualVisibility(username, sharedGroups, jid, itemGroups)) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} } else {
else {
// Set subscription type to FROM if the contact does not belong to any of // Set subscription type to FROM if the contact does not belong to any of
// the associated shared groups // the associated shared groups
boolean belongsToGroup = false; boolean belongsToGroup = false;
...@@ -191,14 +189,12 @@ public class Roster implements Cacheable, Externalizable { ...@@ -191,14 +189,12 @@ public class Roster implements Cacheable, Externalizable {
if (item.getSubStatus() != RosterItem.SUB_FROM) { if (item.getSubStatus() != RosterItem.SUB_FROM) {
item.setNickname(UserNameManager.getUserName(jid)); item.setNickname(UserNameManager.getUserName(jid));
rosterItems.put(item.getJid().toBareJID(), item); rosterItems.put(item.getJid().toBareJID(), item);
} } else {
else {
// Cache information about shared contacts with subscription status FROM // Cache information about shared contacts with subscription status FROM
implicitFrom implicitFrom
.put(item.getJid().toBareJID(), item.getInvisibleSharedGroupsNames()); .put(item.getJid().toBareJID(), item.getInvisibleSharedGroupsNames());
} }
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
Log.error("Groups (" + groups + ") include non-existent username (" + Log.error("Groups (" + groups + ") include non-existent username (" +
jid.getNode() + jid.getNode() +
")"); ")");
...@@ -350,7 +346,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -350,7 +346,7 @@ public class Roster implements Cacheable, Externalizable {
// Check if we need to make the new roster item persistent // Check if we need to make the new roster item persistent
if (persistent) { if (persistent) {
rosterItemProvider.createItem(username, rosterItem); rosterItem = rosterItemProvider.createItem(username, rosterItem);
} }
if (push) { if (push) {
...@@ -396,8 +392,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -396,8 +392,7 @@ public class Roster implements Cacheable, Externalizable {
String defaultContactName; String defaultContactName;
try { try {
defaultContactName = UserNameManager.getUserName(item.getJid()); defaultContactName = UserNameManager.getUserName(item.getJid());
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
// Cannot update a roster item for a local user that does not exist // Cannot update a roster item for a local user that does not exist
defaultContactName = item.getNickname(); defaultContactName = item.getNickname();
} }
...@@ -407,16 +402,13 @@ public class Roster implements Cacheable, Externalizable { ...@@ -407,16 +402,13 @@ public class Roster implements Cacheable, Externalizable {
} }
try { try {
rosterItemProvider.createItem(username, item); rosterItemProvider.createItem(username, item);
} } catch (UserAlreadyExistsException e) {
catch (UserAlreadyExistsException e) {
// Do nothing. We shouldn't be here. // Do nothing. We shouldn't be here.
} }
} } else {
else {
// Item is not persistent and it does not belong to a shared contact so do nothing // Item is not persistent and it does not belong to a shared contact so do nothing
} }
} } else {
else {
// Update the backend data store // Update the backend data store
rosterItemProvider.updateItem(username, item); rosterItemProvider.updateItem(username, item);
} }
...@@ -490,8 +482,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -490,8 +482,7 @@ public class Roster implements Cacheable, Externalizable {
} }
return item; return item;
} } else {
else {
// Verify if the item being removed is an implicit roster item // Verify if the item being removed is an implicit roster item
// that only exists due to some shared group // that only exists due to some shared group
RosterItem item = getImplicitRosterItem(user); RosterItem item = getImplicitRosterItem(user);
...@@ -549,8 +540,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -549,8 +540,7 @@ public class Roster implements Cacheable, Externalizable {
String displayName = sharedGroup.getProperties().get("sharedRoster.displayName"); String displayName = sharedGroup.getProperties().get("sharedRoster.displayName");
if (displayName != null) { if (displayName != null) {
groups.add(displayName); groups.add(displayName);
} } else {
else {
// Do not add the shared group if it does not have a displayName. // Do not add the shared group if it does not have a displayName.
Log.warn("Found shared group: " + sharedGroup.getName() + Log.warn("Found shared group: " + sharedGroup.getName() +
" with no displayName"); " with no displayName");
...@@ -611,8 +601,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -611,8 +601,7 @@ public class Roster implements Cacheable, Externalizable {
for (JID jid : routingTable.getRoutes(searchNode, null)) { for (JID jid : routingTable.getRoutes(searchNode, null)) {
try { try {
routingTable.routePacket(jid, packet, false); routingTable.routePacket(jid, packet, false);
} } catch (Exception e) {
catch (Exception e) {
// Theoretically only happens if session has been closed. // Theoretically only happens if session has been closed.
Log.debug(e.getMessage(), e); Log.debug(e.getMessage(), e);
} }
...@@ -623,7 +612,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -623,7 +612,7 @@ public class Roster implements Cacheable, Externalizable {
for (String contact : implicitFrom.keySet()) { for (String contact : implicitFrom.keySet()) {
if (contact.contains("@")) { if (contact.contains("@")) {
String node = contact.substring(0, contact.lastIndexOf("@")); String node = contact.substring(0, contact.lastIndexOf("@"));
String domain = contact.substring(contact.lastIndexOf("@")+1); String domain = contact.substring(contact.lastIndexOf("@") + 1);
node = JID.escapeNode(node); node = JID.escapeNode(node);
contact = new JID(node, domain, null).toBareJID(); contact = new JID(node, domain, null).toBareJID();
} }
...@@ -633,11 +622,10 @@ public class Roster implements Cacheable, Externalizable { ...@@ -633,11 +622,10 @@ public class Roster implements Cacheable, Externalizable {
// Outgoing presence notifications are blocked for this contact // Outgoing presence notifications are blocked for this contact
continue; continue;
} }
for (JID jid: routingTable.getRoutes(new JID(contact), null)) { for (JID jid : routingTable.getRoutes(new JID(contact), null)) {
try { try {
routingTable.routePacket(jid, packet, false); routingTable.routePacket(jid, packet, false);
} } catch (Exception e) {
catch (Exception e) {
// Theoretically only happens if session has been closed. // Theoretically only happens if session has been closed.
Log.debug(e.getMessage(), e); Log.debug(e.getMessage(), e);
} }
...@@ -656,10 +644,10 @@ public class Roster implements Cacheable, Externalizable { ...@@ -656,10 +644,10 @@ public class Roster implements Cacheable, Externalizable {
* @param sharedGroups the shared groups of this user. * @param sharedGroups the shared groups of this user.
* @return the list of users that belong ONLY to a shared group of this user. * @return the list of users that belong ONLY to a shared group of this user.
*/ */
private Map<JID,List<Group>> getSharedUsers(Collection<Group> sharedGroups) { private Map<JID, List<Group>> getSharedUsers(Collection<Group> sharedGroups) {
// Get the users to process from the shared groups. Users that belong to different groups // Get the users to process from the shared groups. Users that belong to different groups
// will have one entry in the map associated with all the groups // will have one entry in the map associated with all the groups
Map<JID,List<Group>> sharedGroupUsers = new HashMap<JID,List<Group>>(); Map<JID, List<Group>> sharedGroupUsers = new HashMap<JID, List<Group>>();
for (Group group : sharedGroups) { for (Group group : sharedGroups) {
// Get all the users that should be in this roster // Get all the users that should be in this roster
Collection<JID> users = rosterManager.getSharedUsersForRoster(group, this); Collection<JID> users = rosterManager.getSharedUsersForRoster(group, this);
...@@ -743,7 +731,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -743,7 +731,7 @@ public class Roster implements Cacheable, Externalizable {
size += CacheSizes.sizeOfString(username); // username size += CacheSizes.sizeOfString(username); // username
// implicitFrom // implicitFrom
for(Map.Entry<String, Set<String>> entry : implicitFrom.entrySet()) { for (Map.Entry<String, Set<String>> entry : implicitFrom.entrySet()) {
size += CacheSizes.sizeOfString(entry.getKey()); size += CacheSizes.sizeOfString(entry.getKey());
size += CacheSizes.sizeOfCollection(entry.getValue()); size += CacheSizes.sizeOfCollection(entry.getValue());
} }
...@@ -773,8 +761,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -773,8 +761,7 @@ public class Roster implements Cacheable, Externalizable {
return; return;
} }
newItem = false; newItem = false;
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
try { try {
// Create a new RosterItem for this new user // Create a new RosterItem for this new user
String nickname = UserNameManager.getUserName(addedUser); String nickname = UserNameManager.getUserName(addedUser);
...@@ -784,8 +771,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -784,8 +771,7 @@ public class Roster implements Cacheable, Externalizable {
// Add the new item to the list of items // Add the new item to the list of items
rosterItems.put(item.getJid().toBareJID(), item); rosterItems.put(item.getJid().toBareJID(), item);
newItem = true; newItem = true;
} } catch (UserNotFoundException ex) {
catch (UserNotFoundException ex) {
Log.error("Group (" + group.getName() + ") includes non-existent username (" + Log.error("Group (" + group.getName() + ") includes non-existent username (" +
addedUser + addedUser +
")"); ")");
...@@ -813,16 +799,14 @@ public class Roster implements Cacheable, Externalizable { ...@@ -813,16 +799,14 @@ public class Roster implements Cacheable, Externalizable {
// user and this user // user and this user
else if (group.isUser(addedUser) && !group.isUser(getUsername())) { else if (group.isUser(addedUser) && !group.isUser(getUsername())) {
item.setSubStatus(RosterItem.SUB_TO); item.setSubStatus(RosterItem.SUB_TO);
} } else if (!group.isUser(addedUser) && group.isUser(getUsername())) {
else if (!group.isUser(addedUser) && group.isUser(getUsername())) {
item.setSubStatus(RosterItem.SUB_FROM); item.setSubStatus(RosterItem.SUB_FROM);
} }
// Add the shared group to the list of shared groups // Add the shared group to the list of shared groups
if (item.getSubStatus() != RosterItem.SUB_FROM) { if (item.getSubStatus() != RosterItem.SUB_FROM) {
item.addSharedGroup(group); item.addSharedGroup(group);
} } else {
else {
item.addInvisibleSharedGroup(group); item.addInvisibleSharedGroup(group);
} }
...@@ -832,8 +816,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -832,8 +816,7 @@ public class Roster implements Cacheable, Externalizable {
if (prevSubscription == RosterItem.SUB_TO && if (prevSubscription == RosterItem.SUB_TO &&
item.getSubStatus() == RosterItem.SUB_FROM) { item.getSubStatus() == RosterItem.SUB_FROM) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} } else if (prevSubscription == RosterItem.SUB_FROM &&
else if (prevSubscription == RosterItem.SUB_FROM &&
item.getSubStatus() == RosterItem.SUB_TO) { item.getSubStatus() == RosterItem.SUB_TO) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} }
...@@ -845,8 +828,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -845,8 +828,7 @@ public class Roster implements Cacheable, Externalizable {
rosterItems.remove(item.getJid().toBareJID()); rosterItems.remove(item.getJid().toBareJID());
// Cache information about shared contacts with subscription status FROM // Cache information about shared contacts with subscription status FROM
implicitFrom.put(item.getJid().toBareJID(), item.getInvisibleSharedGroupsNames()); implicitFrom.put(item.getJid().toBareJID(), item.getInvisibleSharedGroupsNames());
} } else {
else {
// Remove from list of shared contacts with status FROM (if any) // Remove from list of shared contacts with status FROM (if any)
implicitFrom.remove(item.getJid().toBareJID()); implicitFrom.remove(item.getJid().toBareJID());
// Ensure that the item is an explicit roster item // Ensure that the item is an explicit roster item
...@@ -862,8 +844,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -862,8 +844,7 @@ public class Roster implements Cacheable, Externalizable {
if (newItem) { if (newItem) {
// Fire event indicating that a roster item has been added // Fire event indicating that a roster item has been added
RosterEventDispatcher.contactAdded(this, item); RosterEventDispatcher.contactAdded(this, item);
} } else {
else {
// Fire event indicating that a roster item has been updated // Fire event indicating that a roster item has been updated
RosterEventDispatcher.contactUpdated(this, item); RosterEventDispatcher.contactUpdated(this, item);
} }
...@@ -884,8 +865,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -884,8 +865,7 @@ public class Roster implements Cacheable, Externalizable {
// Get the RosterItem for the *local* user to add // Get the RosterItem for the *local* user to add
item = getRosterItem(addedUser); item = getRosterItem(addedUser);
newItem = false; newItem = false;
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
try { try {
// Create a new RosterItem for this new user // Create a new RosterItem for this new user
String nickname = UserNameManager.getUserName(addedUser); String nickname = UserNameManager.getUserName(addedUser);
...@@ -895,8 +875,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -895,8 +875,7 @@ public class Roster implements Cacheable, Externalizable {
// Add the new item to the list of items // Add the new item to the list of items
rosterItems.put(item.getJid().toBareJID(), item); rosterItems.put(item.getJid().toBareJID(), item);
newItem = true; newItem = true;
} } catch (UserNotFoundException ex) {
catch (UserNotFoundException ex) {
Log.error("Couldn't find a user with username (" + addedUser + ")"); Log.error("Couldn't find a user with username (" + addedUser + ")");
} }
} }
...@@ -922,8 +901,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -922,8 +901,7 @@ public class Roster implements Cacheable, Externalizable {
item.addInvisibleSharedGroup(group); item.addInvisibleSharedGroup(group);
} }
} }
} } else {
else {
// If an item already exists then take note of the old subscription status // If an item already exists then take note of the old subscription status
RosterItem.SubType prevSubscription = null; RosterItem.SubType prevSubscription = null;
if (!newItem) { if (!newItem) {
...@@ -951,8 +929,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -951,8 +929,7 @@ public class Roster implements Cacheable, Externalizable {
if (prevSubscription == RosterItem.SUB_TO && if (prevSubscription == RosterItem.SUB_TO &&
item.getSubStatus() == RosterItem.SUB_FROM) { item.getSubStatus() == RosterItem.SUB_FROM) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} } else if (prevSubscription == RosterItem.SUB_FROM &&
else if (prevSubscription == RosterItem.SUB_FROM &&
item.getSubStatus() == RosterItem.SUB_TO) { item.getSubStatus() == RosterItem.SUB_TO) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} }
...@@ -964,8 +941,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -964,8 +941,7 @@ public class Roster implements Cacheable, Externalizable {
rosterItems.remove(item.getJid().toBareJID()); rosterItems.remove(item.getJid().toBareJID());
// Cache information about shared contacts with subscription status FROM // Cache information about shared contacts with subscription status FROM
implicitFrom.put(item.getJid().toBareJID(), item.getInvisibleSharedGroupsNames()); implicitFrom.put(item.getJid().toBareJID(), item.getInvisibleSharedGroupsNames());
} } else {
else {
// Remove from list of shared contacts with status FROM (if any) // Remove from list of shared contacts with status FROM (if any)
implicitFrom.remove(item.getJid().toBareJID()); implicitFrom.remove(item.getJid().toBareJID());
// Ensure that the item is an explicit roster item // Ensure that the item is an explicit roster item
...@@ -981,8 +957,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -981,8 +957,7 @@ public class Roster implements Cacheable, Externalizable {
if (newItem) { if (newItem) {
// Fire event indicating that a roster item has been added // Fire event indicating that a roster item has been added
RosterEventDispatcher.contactAdded(this, item); RosterEventDispatcher.contactAdded(this, item);
} } else {
else {
// Fire event indicating that a roster item has been updated // Fire event indicating that a roster item has been updated
RosterEventDispatcher.contactUpdated(this, item); RosterEventDispatcher.contactUpdated(this, item);
} }
...@@ -1012,8 +987,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -1012,8 +987,7 @@ public class Roster implements Cacheable, Externalizable {
// Delete the roster item from the roster since it exists only because of this // Delete the roster item from the roster since it exists only because of this
// group which is being removed // group which is being removed
deleteRosterItem(deletedUser, false); deleteRosterItem(deletedUser, false);
} } else {
else {
// Remove the removed shared group from the list of shared groups // Remove the removed shared group from the list of shared groups
item.removeSharedGroup(sharedGroup); item.removeSharedGroup(sharedGroup);
// Update the subscription of the item based on the remaining groups // Update the subscription of the item based on the remaining groups
...@@ -1027,23 +1001,19 @@ public class Roster implements Cacheable, Externalizable { ...@@ -1027,23 +1001,19 @@ public class Roster implements Cacheable, Externalizable {
if (rosterManager.hasMutualVisibility(getUsername(), userGroups, deletedUser, if (rosterManager.hasMutualVisibility(getUsername(), userGroups, deletedUser,
sharedGroups)) { sharedGroups)) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} } else if (item.getSharedGroups().isEmpty() &&
else if (item.getSharedGroups().isEmpty() &&
!item.getInvisibleSharedGroups().isEmpty()) { !item.getInvisibleSharedGroups().isEmpty()) {
item.setSubStatus(RosterItem.SUB_FROM); item.setSubStatus(RosterItem.SUB_FROM);
} } else {
else {
item.setSubStatus(RosterItem.SUB_TO); item.setSubStatus(RosterItem.SUB_TO);
} }
} }
// Brodcast to all the user resources of the updated roster item // Brodcast to all the user resources of the updated roster item
broadcast(item, false); broadcast(item, false);
} }
} } catch (SharedGroupException e) {
catch (SharedGroupException e) {
// Do nothing. Checkings are disabled so this exception should never happen. // Do nothing. Checkings are disabled so this exception should never happen.
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
// Do nothing since the contact does not exist in the user's roster. (strange case!) // Do nothing since the contact does not exist in the user's roster. (strange case!)
} }
} }
...@@ -1061,8 +1031,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -1061,8 +1031,7 @@ public class Roster implements Cacheable, Externalizable {
// Delete the roster item from the roster since it exists only because of this // Delete the roster item from the roster since it exists only because of this
// group which is being removed // group which is being removed
deleteRosterItem(deletedUser, false); deleteRosterItem(deletedUser, false);
} } else {
else {
// Remove the shared group from the item if deletedUser does not belong to a // Remove the shared group from the item if deletedUser does not belong to a
// public group // public group
if (!(deletedGroup.isUser(deletedUser) && if (!(deletedGroup.isUser(deletedUser) &&
...@@ -1088,8 +1057,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -1088,8 +1057,7 @@ public class Roster implements Cacheable, Externalizable {
if (rosterManager if (rosterManager
.hasMutualVisibility(getUsername(), userGroups, deletedUser, groups)) { .hasMutualVisibility(getUsername(), userGroups, deletedUser, groups)) {
item.setSubStatus(RosterItem.SUB_BOTH); item.setSubStatus(RosterItem.SUB_BOTH);
} } else {
else {
// Assume by default that the contact has subscribed from the presence of // Assume by default that the contact has subscribed from the presence of
// this user // this user
item.setSubStatus(RosterItem.SUB_FROM); item.setSubStatus(RosterItem.SUB_FROM);
...@@ -1104,11 +1072,9 @@ public class Roster implements Cacheable, Externalizable { ...@@ -1104,11 +1072,9 @@ public class Roster implements Cacheable, Externalizable {
// Brodcast to all the user resources of the updated roster item // Brodcast to all the user resources of the updated roster item
broadcast(item, false); broadcast(item, false);
} }
} } catch (SharedGroupException e) {
catch (SharedGroupException e) {
// Do nothing. Checkings are disabled so this exception should never happen. // Do nothing. Checkings are disabled so this exception should never happen.
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
// Do nothing since the contact does not exist in the user's roster. (strange case!) // Do nothing since the contact does not exist in the user's roster. (strange case!)
} }
} }
...@@ -1131,8 +1097,7 @@ public class Roster implements Cacheable, Externalizable { ...@@ -1131,8 +1097,7 @@ public class Roster implements Cacheable, Externalizable {
item = getRosterItem(user); item = getRosterItem(user);
// Brodcast to all the user resources of the updated roster item // Brodcast to all the user resources of the updated roster item
broadcast(item, true); broadcast(item, true);
} } catch (UserNotFoundException e) {
catch (UserNotFoundException e) {
// Do nothing since the contact does not exist in the user's roster. (strange case!) // Do nothing since the contact does not exist in the user's roster. (strange case!)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment