Dear sir:
I write some code to exit login by
val presence = Presence(Presence.Type.unavailable)
mConnection?.disconnect(presence)
and I can see the logout’s log below
2020-08-18 02:28:00.579 4825-5921/com.njdn.smartrailway D/SMACK: SENT (0): <presence id='k4S8L-861' type='unavailable'></presence><a xmlns='urn:xmpp:sm:3' h='8'/>
2020-08-18 02:28:00.692 4825-5922/com.njdn.smartrailway D/SMACK: RECV (0): <presence id="k4S8L-861" type="unavailable" from="liyexin@localhost/Android" to="liyexin@localhost/Android"/></stream:stream>
and then I login again by
mConnection.login(name, password)
something stranged below, and this issue is not 100% but very high, log is
2020-08-18 02:28:15.074 4825-5990/com.njdn.smartrailway D/SMACK: SENT (0): <iq id='k4S8L-855' type='get'><query xmlns='http://jabber.org/protocol/getjoinedrooms'></query></iq><iq to='localhost' id='778-329' type='error'><error type='modify'><not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq><r xmlns='urn:xmpp:sm:3'/><presence id='k4S8L-861' type='unavailable'></presence><iq id='k4S8L-914' type='get'><query xmlns='jabber:iq:roster'></query></iq><presence id='k4S8L-915'><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='NfJ3flI83zSdUDzCEICtbypursw='/></presence>
the unavailable presence is send again! it is the same as the log which I logout!
Also the log is strange that more than one root tag to print and the openfire server can rceive the unavailable presence again, it cause many issues.
Do you know why and how to resolve it? Please reply me if you have the answer, thanks a lot!