[Pidgin] #16188: Jabber capabilities not updated properly when new presence recieved

Pidgin trac at pidgin.im
Sat Apr 12 01:09:56 EDT 2014


#16188: Jabber capabilities not updated properly when new presence recieved
-------------------------+---------------------
 Reporter:  wpettersson  |       Owner:  deryni
     Type:  defect       |      Status:  new
Milestone:               |   Component:  XMPP
  Version:  2.10.9       |  Resolution:
 Keywords:  voice video  |
-------------------------+---------------------

Comment (by wpettersson):

 Problem was down to a difference between jabber_caps_exts_known (which
 determines whether to update capabilities) and
 jabber_resource_has_capability. It seems JabberCapsNodeExts stores, for
 each capability, a GList in the GHashTable *exts (caps.h:65).
 jabber_resource_has_capability only "finds" a capability if there is a
 corresponding GList in the hash table, and if the GList contains the
 string representation of the capability. However, jabber_caps_exts_known
 only checks for the entry in the hash table, it doesn't check whether the
 string is in the corresponding GList.

 As a result, if you ever got to a situation where a capability has an
 entry in the hash table, but the capability does not exist in the
 corresponding GList then for any new presence jabber_caps_exts_known will
 say "We already know about that, and won't update but
 jabber_resource_has_capability will always say "No, don't have that
 capability".

 I've attached a patch which fixes the problem for me by adding the extra
 check to jabber_caps_exts_known.

 A few notes, though.

 caps.h:61 warns against using the hash table. Seeing as it was used
 previously, I wasn't sure if my change was ok. Instead of using
 "jabber_caps_exts_known" to check for whether a capability is known, we
 could just use jabbeer_resource_has_capability on line 1052 of presence.c,
 but then there's that hack mentioned on line 360 of caps.c so I don't know
 how those two would cooperate.

-- 
Ticket URL: <https://developer.pidgin.im/ticket/16188#comment:1>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list