processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.01k stars 1.5k forks source link

Improve get_roster command result: show groups as a list #4088

Closed badlop closed 9 months ago

badlop commented 9 months ago

This PR improves the get_roster command, and fixes ejabberdctl to fully support that command and other ones like that.

This changes the API, so the release notes should describe it. For example:


Changes in get_roster command

There are some changes in the result output of the get_roster command defined in mod_admin_extra:

For example, let's say that admin@localhost has two contacts: a contact is present in two groups (group1 and group2), the other contact is only present in a group (group3).

The old get_roster command in ejabberd 23.04 and previous versions was like:

$ ejabberdctl get_roster admin localhost
jan@localhost jan   none    subscribe       group1
jan@localhost jan   none    subscribe       group2
tom@localhost tom   none    subscribe       group3

The new get_roster command in ejabberd 23.XX and newer versions returns as result:

$ ejabberdctl get_roster admin localhost
jan@localhost jan   none    subscribe       group1;group2
tom@localhost tom   none    subscribe       group3

Notice that the ejabberdctl command-line tool since now will represent list elements in results separated with ;

coveralls commented 9 months ago

Coverage Status

coverage: 32.774% (-0.005%) from 32.779% when pulling 245c9ae44684d28d3aaa0d7674464031fb173049 on badlop:get-roster-command into 426fd14b117daf9f5c3d46d47fd71f31fccda012 on processone:master.

Neustradamus commented 9 months ago

Excellent!