/** * Adds a new {@link StanzaListener} that will be invoked every time a new presence * is going to be sent by this MultiUserChat to the server. Stanza(/Packet) interceptors may * add new extensions to the presence that is going to be sent to the MUC service. * * @param presenceInterceptor the new stanza(/packet) interceptor that will intercept presence packets. */ public void addPresenceInterceptor(PresenceListener presenceInterceptor) { presenceInterceptors.add(presenceInterceptor); }
/** * Adds a stanza(/packet) listener that will be notified of any new Presence packets * sent to the group chat. Using a listener is a suitable way to know when the list * of occupants should be re-loaded due to any changes. * * @param listener a stanza(/packet) listener that will be notified of any presence packets * sent to the group chat. * @return true if the listener was not already added. */ public boolean addParticipantListener(PresenceListener listener) { return presenceListeners.add(listener); }
/** * Removes a stanza(/packet) listener that was being notified of any new Presence packets * sent to the group chat. * * @param listener a stanza(/packet) listener that was being notified of any presence packets * sent to the group chat. * @return true if the listener was removed, otherwise the listener was not added previously. */ public boolean removeParticipantListener(PresenceListener listener) { return presenceListeners.remove(listener); }