Search in sources :

Example 6 with IPresence

use of org.eclipse.ecf.presence.IPresence in project ecf by eclipse.

the class XMPPContainerPresenceHelper method createPresence.

protected Presence createPresence(IPresence ipresence) {
    final Presence newPresence = new Presence(createPresenceType(ipresence), ipresence.getStatus(), 0, createPresenceMode(ipresence));
    ECFConnection.setPropertiesInPacket(newPresence, ipresence.getProperties());
    return newPresence;
}
Also used : IPresence(org.eclipse.ecf.presence.IPresence) Presence(org.jivesoftware.smack.packet.Presence)

Example 7 with IPresence

use of org.eclipse.ecf.presence.IPresence in project ecf by eclipse.

the class XMPPContainerPresenceHelper method handlePresenceEvent.

protected void handlePresenceEvent(PresenceEvent evt) {
    final Presence xmppPresence = evt.getPresence();
    final String from = xmppPresence.getFrom();
    final IPresence newPresence = createIPresence(xmppPresence);
    final XMPPID fromID = createIDFromName(from);
    if (newPresence.getType().equals(IPresence.Type.SUBSCRIBE) || newPresence.getType().equals(IPresence.Type.UNSUBSCRIBE) || newPresence.getType().equals(IPresence.Type.SUBSCRIBED) || newPresence.getType().equals(IPresence.Type.UNSUBSCRIBED)) {
        rosterManager.notifySubscriptionListener(fromID, newPresence);
    } else {
        updatePresence(fromID, newPresence);
        firePresenceListeners(fromID, newPresence);
    }
}
Also used : IPresence(org.eclipse.ecf.presence.IPresence) IPresence(org.eclipse.ecf.presence.IPresence) Presence(org.jivesoftware.smack.packet.Presence) XMPPID(org.eclipse.ecf.provider.xmpp.identity.XMPPID)

Aggregations

IPresence (org.eclipse.ecf.presence.IPresence)7 Presence (org.jivesoftware.smack.packet.Presence)4 XMPPID (org.eclipse.ecf.provider.xmpp.identity.XMPPID)2 ID (org.eclipse.ecf.core.identity.ID)1 XMPPRoomID (org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID)1