Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix verification string computation.
This is a fix for issue legoscia#37. XEP-0115 describes how the presence iq elements presents capabilities. In particular, capabilities are represented by a verification string which consists of a hash of features and form data fields that make up a capability list. See, https://xmpp.org/extensions/xep-0115.html#ver-proc The field list for a form consists of a "var" attribute with an associated <value/> element. It is not entirely clear from the XEP how an empty <value/> element should be treated. Unfortunately jabber.el throws a 'wrong-type-argument for empty <values/>. Here is an example form description sent from Psi+ that contains an empty "os_version" value: ```xml <x type="result" xmlns="jabber:x:data"> <field type="hidden" var="FORM_TYPE"> <value>urn:xmpp:dataforms:softwareinfo</value> </field> <field type="text-single" var="software"> <value>Psi+</value> </field> <field type="text-single" var="software_version"> <value>1.5.1650 (2023-06-10, 526ed0b8)</value> </field> <field type="text-single" var="os"> <value>Debian GNU/Linux 11 (bullseye)</value> </field> <field type="text-single" var="os_version"> <value/> </field> </x> ``` Looking at the psi-plus-snapshots source suggests that an empty value should be treated as an empty string. Experimentation verifies that this yields the same verification string that Psi+ sends with its disco#info response.
- Loading branch information