google-code-export / libjingle

Automatically exported from code.google.com/p/libjingle
1 stars 0 forks source link

Incorrect callback invoked for initial roster updates #353

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Request a roster update:
    roster_module_->RequestRosterUpdate();

2. The ContactsAdded callback is never invoked when the roster module receives 
the response.

3. Looking deeper into the code, the roster module expects its internal 
IqResponse callback to be invoked for a roster update.  However, the 
HandleStanza method is invoked instead.  This method then throws away the 
response from the IQ because it wasn't meant to deal with it.

As a workaround I can fix this by modifying the following line in HandleStanza 
from:

if (!roster_query || stanza->Attr(QN_TYPE) != "set")

to:

if (!roster_query || (stanza->Attr(QN_TYPE) != "set" && stanza->Attr(QN_TYPE) 
!= "result"))

I'd rather not have to hack this, however.  Am I missing something here?  

What is the expected output? What do you see instead?

Expect for the ContactsAdded callback to be invoked.  Instead, it never gets 
invoked.

What version of the product are you using? On what operating system?

libjingle 0.6.19 on Mac OSX

Please provide any additional information below.

Original issue reported on code.google.com by vishal.k...@gmail.com on 24 May 2012 at 1:08