質問

I'm currently using asmack against an XMPP server which has XEP-0198 enabled.

I'm trying to enable this feature from the asmack library but I could not find any info on how to do this, so following http://xmpp.org/extensions/xep-0198.html I know I have to enable this feature by sending:

<enable xmlns='urn:xmpp:sm:3'/>

But I have no idea on how to do this, since this is not a stanza. Any help is appreciated.

EDIT: As dant3 has pointed out XEP-0198 is not supported in Smack but I still want to enable it by sending that simple XML through Smack, I just have no idea how to do that.

役に立ちましたか?

解決

It looks like smack do not have XEP-0198 implementation. So, you can't enable it.

It would be nice if you contribute it for smack (and thus - for asmack).

EDIT:

Smack 4.1.0 having now support of XEP-0198 stream management. See this wiki page for details.

他のヒント

I solved it by creating my own type of Package:

public class MyPacket extends Packet
{
    private String content = "";

    public MyPacket(String content)
    {
        this.content = content;
    }
    @Override
    public String toXML()
    {
        return this.content;
    }
}

I pass the xml in the constructor and then off it goes:

MyPacket p = new MyPacket("<enable xmlns='urn:xmpp:sm:3'/>");
this.connection.sendPacket(p);

Definitely not the best code in the world but it works.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top