Ticket #643 (closed task: worksforme)

Opened 5 years ago

Last modified 4 years ago

Patch for more flexible IQ packets that don't use a query child element

Reported by: travis@… Owned by: asterix
Priority: normal Milestone:
Component: chat Version: 0.5.1
Severity: major Keywords:
Cc: Blocked By:
OS: Blocking:

Description

This patch adds support for iq stanzas that do not use a 'query' child element. Many newer protocols use a child of a different name to contain the query information. Patched against svn 2767.

Attachments

iq.diff (5.6 KB) - added by travis@… 5 years ago.
Patch

Change History

Changed 5 years ago by travis@…

Patch

Changed 5 years ago by snakeru

I will not accept this. I do not see any reason to make methods like "setQueryNS" operate on child other than "query". It makes it's name unlogical. I think that these methods can be dropped completely in favor of new syntax like tag.N.query.setNamespace(NS_DISCO)

Changed 5 years ago by travis@…

The 'q' in 'iq' stands for query in the abstract sense. But many (most) newer protocol JEPs don't use a child element named 'query', thus nearly every method in the Iq class is useless since they all operate on a child with the name query. See JEP-0060 (publish/Subscribe) for one example, but there are _many_ others.

Changed 5 years ago by snakeru

Again. I propose dropping all these methods. I.e. instead of iq.getQueryNS() use iq.T.query.getNamespace() it is a little longer but more obvious - you have not to keep in mind that iq method operates on one of its child. In case of your patch is make not only operates on child but worse - operate on child with unknown (set somewhere previously) name. BTW. Currently .T. notation creates new child if it doesn't exist. This is BAD. I'll change this so .T. will always access only and .NT. always create only.

Changed 5 years ago by snakru

Done. newtag=tag.T.newtag now do not creates new tag but only returns existing one (if possible).

Changed 5 years ago by nk

  • status changed from new to closed
  • resolution set to worksforme

it would be good if anyone knew what is the .T. way..

I close anyways

Add/Change #643 (Patch for more flexible IQ packets that don't use a query child element)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Next status will be 'needinfo'
 
Note: See TracTickets for help on using tickets.