Issue #3070 fixed contact request logic when adding to group
Former-commit-id:5f746c9c56
[formerly17ab4f6184
] [formerly5f746c9c56
[formerly17ab4f6184
] [formerlyf1213c1bda
[formerly 57120491452b36bf15227bd4b6d0236221c71124]]] Former-commit-id:f1213c1bda
Former-commit-id:ed2d66a6fa
[formerlyfe6af8c315
] Former-commit-id:edaaa9a426
This commit is contained in:
parent
e0f4544f94
commit
eb318a9a0d
1 changed files with 10 additions and 19 deletions
|
@ -78,6 +78,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.connection.CollaborationC
|
||||||
* added getSharedDisplayEnabledResource()
|
* added getSharedDisplayEnabledResource()
|
||||||
* Apr 24, 2014 3070 bclement added checks for empty groups, added isContact(),
|
* Apr 24, 2014 3070 bclement added checks for empty groups, added isContact(),
|
||||||
* added sendContactRequest()
|
* added sendContactRequest()
|
||||||
|
* fixed contact request logic in addToGroup()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -201,24 +202,14 @@ public class ContactsManager {
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
group = createGroup(groupName);
|
group = createGroup(groupName);
|
||||||
}
|
}
|
||||||
String id = user.getNormalizedId();
|
RosterEntry entry = getRosterEntry(user);
|
||||||
RosterEntry entry = group.getEntry(id);
|
if (entry != null && isBlocked(entry)) {
|
||||||
if (entry != null) {
|
/* entry is in roster, but we are blocked */
|
||||||
if (isBlocked(entry)) {
|
try {
|
||||||
// entry is in roster, but we aren't subscribed. Request a
|
sendContactRequest(user);
|
||||||
// subscription.
|
} catch (CollaborationException e) {
|
||||||
try {
|
statusHandler.error("Problem subscribing to user", e);
|
||||||
connection.getAccountManager().sendPresence(user,
|
|
||||||
new Presence(Type.subscribe));
|
|
||||||
} catch (CollaborationException e) {
|
|
||||||
statusHandler.error("Problem subscribing to user", e);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
statusHandler
|
|
||||||
.debug("Attempted to add user to group it was already in: "
|
|
||||||
+ id + " in " + groupName);
|
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
addToGroup(group, user);
|
addToGroup(group, user);
|
||||||
|
@ -227,8 +218,8 @@ public class ContactsManager {
|
||||||
}
|
}
|
||||||
} catch (XMPPException e) {
|
} catch (XMPPException e) {
|
||||||
String msg = getGroupModInfo(e);
|
String msg = getGroupModInfo(e);
|
||||||
statusHandler.error("Problem adding user to group: " + id + " to "
|
statusHandler.error("Problem adding user to group: " + user
|
||||||
+ group.getName() + ". " + msg, e);
|
+ " to " + group.getName() + ". " + msg, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue