[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/extensions/geolocation/GeolocationPresence.java

emcho at dev.java.net emcho at dev.java.net
Mon May 14 16:10:35 CEST 2007


User: emcho   
Date: 2007-05-14 14:10:35+0000
Log:
 Committing geolocation for Jabber from Guillaume Schreiner - Louis Pasteur University, France
 
 a geolocation oriented extension of a smack xmpp message.

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/extensions/geolocation/
=======================================================================================================

File [added]: GeolocationPresence.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/protocol/jabber/extensions/geolocation/GeolocationPresence.java?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 59
---------------
/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.impl.protocol.jabber.extensions.geolocation;

import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.jabberconstants.*;

import org.jivesoftware.smack.packet.*;
import net.java.sip.communicator.impl.protocol.jabber.*;

/**
 * This class represents a Jabber presence message includin a Geolocation
 * Extension.
 *
 * @author Guillaume Schreiner
 */
public class GeolocationPresence
{

    /**
     * the presence message to send via a XMPPConnection
     */
    private Presence prez = null;

    /**
     *
     * @param persistentPresence OperationSetPresence
     */
    public GeolocationPresence(OperationSetPresence persistentPresence)
    {
        this.prez = new Presence(Presence.Type.available);

        // set the custom status message
        this.prez.setStatus(persistentPresence
                            .getCurrentStatusMessage());

        // set the presence mode (available, NA, free for chat)
        this.prez.setMode(
            OperationSetPersistentPresenceJabberImpl.presenceStatusToJabberMode(
                (JabberStatusEnum) persistentPresence
                .getPresenceStatus()));
    }

    public void setGeolocationExtention(GeolocationPacketExtension ext)
    {
        this.prez.addExtension(ext);
    }

    public Presence getGeolocPresence()
    {
        return this.prez;
    }

}





---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator.dev.java.net





More information about the commits mailing list