public void send(Packet packet) { if (packet == null) { return; } packet.setTo(user.getAddress()); if (session != null && session.getStatus() == Session.STATUS_AUTHENTICATED) { // Send the packet directly to the local user session session.process(packet); } else { router.route(packet); } }
/** * Calculates and sets the extended presence information to add to the presence. The information * to add contains the user's jid, affiliation and role. */ private void calculateExtendedInformation() { ElementUtil.setProperty(extendedInformation, "x.item:jid", user.getAddress().toString()); ElementUtil.setProperty(extendedInformation, "x.item:affiliation", affiliation.toString()); ElementUtil.setProperty(extendedInformation, "x.item:role", role.toString()); }
public JID getUserAddress() { return user.getAddress(); }