AnsweredAssumed Answered

Roster listener's presence changed not triggered in Smack 4.1.0

Question asked by Murugaprabu on Jun 29, 2015

Assume there are two XMPP users A and B. Both have presence subscription to each other.

Both the clients are using Smack 4.1.0 XMPP client library. Both the clients have disabled loading the list of rosters at login.

 

SCENARIO

 

1. Both users A and B are online

2. They both are chatting

3. Suddenly user B goes offline

4. User A receives presence packet that user B has gone offline.

 

 

 

<presence from='712345@test.com/Smack' to='18355@test,cin/Smack' xml:lang='en' id='Vt8ne-92' type='unavailable'>
  <c xmlns='http://jabber.org/protocol/caps' 
  hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='Z9EpweQnA2zg066l9xQm5X6h9TE='/>
</presence>

 

 

But the user A's presence changed listener in the Roster listener class isn't getting triggered

 

But, the presence change listener is getting triggered if the Roster is loaded after login.

 

Roster.getInstanceFor(mConnection).reload();

 

QUESTION

 

1. Is it mandatory to load the list of rosters after every login ?

2. Is there any option to trigger presence changed in RosterListener without loading the list of rosters ?

Outcomes