/** * Returns a roster item if the specified user has a subscription of type FROM to this * user and the susbcription only exists due to some shared groups or otherwise * <tt>null</tt>. This method assumes that this user does not have a subscription to * the contact. In other words, this method will not check if there should be a subscription * of type TO ot BOTH. * * @param user the contact to check if he is subscribed to the presence of this user. * @return a roster item if the specified user has a subscription of type FROM to this * user and the susbcription only exists due to some shared groups or otherwise null. */ private RosterItem getImplicitRosterItem(JID user) { Set<String> invisibleSharedGroups = implicitFrom.get(user.toBareJID()); if (invisibleSharedGroups != null) { RosterItem rosterItem = new RosterItem(user, RosterItem.SUB_FROM, RosterItem.ASK_NONE, RosterItem.RECV_NONE, "", null); rosterItem.setInvisibleSharedGroupsNames(invisibleSharedGroups); return rosterItem; } return null; }
while (rs.next()) { RosterItem item = new RosterItem(rs.getLong(2), new JID(rs.getString(1)), RosterItem.SubType.getTypeFromInt(rs.getInt(3)),
Collection<Group> itemGroups = new ArrayList<>(); String nickname = ""; RosterItem item = new RosterItem(jid, RosterItem.SUB_TO, RosterItem.ASK_NONE, RosterItem.RECV_NONE, nickname, null);
org.xmpp.packet.Roster.Subscription.none, groups); RosterItem rosterItem = new RosterItem(item);
new RosterItem(addedUser, RosterItem.SUB_BOTH, RosterItem.ASK_NONE, RosterItem.RECV_NONE, nickname, null);
new RosterItem(addedUser, RosterItem.SUB_BOTH, RosterItem.ASK_NONE, RosterItem.RECV_NONE, nickname, null);
/** * Returns a roster item if the specified user has a subscription of type FROM to this * user and the susbcription only exists due to some shared groups or otherwise * <tt>null</tt>. This method assumes that this user does not have a subscription to * the contact. In other words, this method will not check if there should be a subscription * of type TO ot BOTH. * * @param user the contact to check if he is subscribed to the presence of this user. * @return a roster item if the specified user has a subscription of type FROM to this * user and the susbcription only exists due to some shared groups or otherwise null. */ private RosterItem getImplicitRosterItem(JID user) { Set<String> invisibleSharedGroups = implicitFrom.get(user.toBareJID()); if (invisibleSharedGroups != null) { RosterItem rosterItem = new RosterItem(user, RosterItem.SUB_FROM, RosterItem.ASK_NONE, RosterItem.RECV_NONE, "", null); rosterItem.setInvisibleSharedGroupsNames(invisibleSharedGroups); return rosterItem; } return null; }
while (rs.next()) { RosterItem item = new RosterItem(rs.getLong(2), new JID(rs.getString(1)), RosterItem.SubType.getTypeFromInt(rs.getInt(3)),
Collection<Group> itemGroups = new ArrayList<>(); String nickname = ""; RosterItem item = new RosterItem(jid, RosterItem.SUB_TO, RosterItem.ASK_NONE, RosterItem.RECV_NONE, nickname, null);
org.xmpp.packet.Roster.Subscription.none, groups); RosterItem rosterItem = new RosterItem(item);
new RosterItem(addedUser, RosterItem.SUB_BOTH, RosterItem.ASK_NONE, RosterItem.RECV_NONE, nickname, null);
new RosterItem(addedUser, RosterItem.SUB_BOTH, RosterItem.ASK_NONE, RosterItem.RECV_NONE, nickname, null);