Get list of subscribed group by user using ejabberd API

I am currently developing chat system for our application using ejabberd API.

I am having a problem on how to retrieve a list of subscribed group by username.

I only can retrieve a list of groups that user occupied, but not subscribed using get_room_users API.

My reference: https://docs.ejabberd.im/developer/ejabberd-api/admin-api/

My question:

  1. How to retrieve list of subscribed group by username?

  2. Do I need to register all subscribers to the group to make use of get_room_users API?

Upvotes: 3

Views: 484

Answers (1)

Badlop
Badlop

Reputation: 4120

  1. How to retrieve list of subscribed group by username?

There is no command to obtain that information.

  1. Do I need to register all subscribers to the group to make use of get_room_users API?

I guess you mean get_room_occupants. Well, if you make the room subscribers also members of the room, then you can use get_room_affiliations, for example:

$ ejabberdctl get_room_affiliations room1 conference.localhost
user2   localhost       member
user1   localhost       owner

Upvotes: 2

Related Questions