Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

badlop
Copy link
Member

@badlop badlop commented Sep 21, 2023

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:

  • ask is renamed to pending
  • group is renamed to groups
  • the new groups is a list with all the group names
  • a contact that is in several groups is now listed only once, and the groups are properly listed.

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 ;

When formatting the results of a command:
- If the top of the result is a list, split elements with newline as usual
- If it's a list in one of the resulting lines, split elements with ;
@coveralls
Copy link

Coverage Status

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

@badlop badlop added this to the ejabberd 23.xx milestone Sep 21, 2023
@Neustradamus
Copy link
Contributor

Excellent!

@badlop badlop merged commit b33d660 into processone:master Sep 25, 2023
6 checks passed
@badlop badlop deleted the get-roster-command branch October 4, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants