org.jivesoftware.smack.PresenceListener Java Examples

The following examples show how to use org.jivesoftware.smack.PresenceListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GroupChatParticipantList.java    From Spark with Apache License 2.0 4 votes vote down vote up
protected PresenceListener getListener() {
    return listener;
}
 
Example #2
Source File: MultiUserChat.java    From Smack with Apache License 2.0 2 votes vote down vote up
/**
 * 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 interceptors may
 * add new extensions to the presence that is going to be sent to the MUC service.
 *
 * @param presenceInterceptor the new stanza interceptor that will intercept presence packets.
 */
public void addPresenceInterceptor(PresenceListener presenceInterceptor) {
    presenceInterceptors.add(presenceInterceptor);
}
 
Example #3
Source File: MultiUserChat.java    From Smack with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a {@link StanzaListener} that was being invoked every time a new presence
 * was being sent by this MultiUserChat to the server. Stanza interceptors may
 * add new extensions to the presence that is going to be sent to the MUC service.
 *
 * @param presenceInterceptor the stanza interceptor to remove.
 */
public void removePresenceInterceptor(PresenceListener presenceInterceptor) {
    presenceInterceptors.remove(presenceInterceptor);
}
 
Example #4
Source File: MultiUserChat.java    From Smack with Apache License 2.0 2 votes vote down vote up
/**
 * Adds a stanza 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 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);
}
 
Example #5
Source File: MultiUserChat.java    From Smack with Apache License 2.0 2 votes vote down vote up
/**
 * Removes a stanza listener that was being notified of any new Presence packets
 * sent to the group chat.
 *
 * @param listener a stanza 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);
}