AnsweredAssumed Answered

Smack 4.1.0 Presence type

Question asked by Leos on May 7, 2015
Latest reply on May 7, 2015 by Flow

Hi, I'm using Smack 4.1.0 on Android.

 

The XMPP server returns presence type 'online' instead of 'available' and because of that I'm getting IllegalArgumentException and Smack disconnect me from the server.

Stack trace:

 

Connection closed with error

    java.lang.IllegalArgumentException: online is not a constant in org.jivesoftware.smack.packet.Presence$Type

            at java.lang.Enum.valueOf(Enum.java:200)

            at org.jivesoftware.smack.packet.Presence$Type.valueOf(Presence.java:269)

            at org.jivesoftware.smack.packet.Presence$Type.fromString(Presence.java:323)

            at org.jivesoftware.smack.util.PacketParserUtils.parsePresence(PacketParserUtils.j ava:527)

            at org.jivesoftware.smack.util.PacketParserUtils.parseStanza(PacketParserUtils.jav a:155)

            at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMP PConnection.java:947)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$400(XMPPTCPConnection.java: 139)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:982)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:937)

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:952)

            at java.lang.Thread.run(Thread.java:818)

 

I know that the 'online' is correct way, but I'm not able to change it on the server side. Is there any way to handle it? Maybe disable parsing Presence stanzas would help.

Outcomes