Search in sources :

Example 1 with PresenceMode

use of jetbrains.communicator.core.users.PresenceMode in project intellij-plugins by JetBrains.

the class JabberFacadeImpl method setOnlinePresence.

public void setOnlinePresence(UserPresence userPresence) {
    final Presence.Mode mode;
    String status = "";
    PresenceMode presenceMode = userPresence.getPresenceMode();
    switch(presenceMode) {
        case AWAY:
            mode = Presence.Mode.away;
            break;
        case EXTENDED_AWAY:
            mode = Presence.Mode.xa;
            break;
        case DND:
            mode = Presence.Mode.dnd;
            break;
        default:
            mode = Presence.Mode.available;
    }
    Presence presence = new Presence(Presence.Type.available, status, 0, mode);
    myConnection.sendPacket(presence);
}
Also used : PresenceMode(jetbrains.communicator.core.users.PresenceMode) Presence(org.jivesoftware.smack.packet.Presence) UserPresence(jetbrains.communicator.core.users.UserPresence)

Aggregations

PresenceMode (jetbrains.communicator.core.users.PresenceMode)1 UserPresence (jetbrains.communicator.core.users.UserPresence)1 Presence (org.jivesoftware.smack.packet.Presence)1