aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/xmpp/iqversion/IqVersionPacket.java
blob: a3cecdac7ef793fb3c9d218bfe225365d04b5dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package de.thedevstack.conversationsplus.xmpp.iqversion;

import android.os.Build;

import de.thedevstack.conversationsplus.ConversationsPlusApplication;
import de.thedevstack.conversationsplus.xml.Element;
import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket;

/**
 * Representation of an software version packet as defined in XEP-0092.
 * @see <a href="http://xmpp.org/extensions/xep-0092.html">http://xmpp.org/extensions/xep-0092.html</a>
 */
public class IqVersionPacket extends IqPacket {
    public static final String NAMESPACE = "jabber:iq:version";

    IqVersionPacket() {
        super(IqPacket.TYPE.RESULT);
        Element query = this.addChild("query", NAMESPACE);
        query.addChild("name").setContent(ConversationsPlusApplication.getName());
        query.addChild("version").setContent(ConversationsPlusApplication.getVersion());
        query.addChild("os").setContent("Android " + Build.VERSION.RELEASE);
    }
}