converse.js icon indicating copy to clipboard operation
converse.js copied to clipboard

xhr_user_search_url, JSON encoded list of objects mismatch attribute name

Open rheman opened this issue 3 years ago • 0 comments

To Reproduce Steps to reproduce the behavior:

  1. Enable autocomplete_add_contact: true
  2. Set the xhr_user_search_url
  3. Search a contact from "XMPP Address" field. Nothing will happen
  4. Search a contact from "Nickname" field. Matching contact will be displayed

Expected behavior 1- When the xhr_user_search_url returns the following JSON encoded list of objects, the search does not work. [{"jid": "[email protected]", "**fullname**": "Marty McFly"}, {"jid": "[email protected]", "fullname": "Doc Brown"}] 2- When the xhr_user_search_url returns the following JSON encoded list of objects, the search works. [{"jid": "[email protected]", "**name**": "Marty McFly"}, {"jid": "[email protected]", "name": "Doc Brown"}]

The difference between the above two JSON encoded list of objects.

  • The first one contains the attribute "fullname"
  • In the second one I replaced the attribute "fullname" by "name"

The search does not work when we perform the search from the "XMPP Address" field. It only works when we perform the search from the "Nickname" field. Moreover, when we perform search from the "Nickname" field and select a user, the Nickname field is filled by the "XMPP Address".

Environment (please complete the following information):

  • Desktop or Mobile?
  • Browser Chrome, Firefox, Edge
  • Converse.js 9.1.1 [e.g. 4.2.0]

Regards,

rheman avatar Jul 04 '22 00:07 rheman