is it possible to determine the order of getting pubsub nodes in xmpp? openfire returns the nodes in a random order. At least i dont see any logic behind it. it’s not sorted by creation date, not by “node” and not by “name” or title. in the database there is a creation date attribute – how do i get it the nodes by the creation date? has maybe this functionality? or woultd it be possible with ejabberd?
Share
The specification does not detail any kind of ordering, so no, you cannot expect any specific ordering in the results. Some servers may have them sorted by some attribute (like name), but you cannot rely on that across servers or even versions of the same server since it is just an implementation detail.
The fact that Openfire stores the creation date is an implementation detail and has nothing to do with the specification.
I would suggest you sort them after retrieving them in the case of sorting by name, but for creation date in Openfire, you could provide your own plugin to retrieve the information in the order you prefer. Of course you are then coding against your plugin instead of the spec at that point.