Change Group Chat Administrators via Code or Api

Hi
i have a requirement to Update Group Chat Administrators via code. Please see the screenshot. I have also looked into table called “openfire.ofMucServiceProp” with row.
# serviceID, name, propValue
1 sysadmin.jid

When Group Chat administrators are saved from UI database gets updated , however if i directly change from database and refresh the page Jids are not updated unless done from Web interface. Is there any way i can achieve this. Thank you.

Changing the database values directly is not a good idea. Openfire will have database content cached, and can overwrite or invalidate your changes. Openfire is not designed in a way that it expects other processes to modify its database.

To change the role of users in a chatroom, which is what you’re trying to do, I can think of two solutions:

  1. Do this through XMPP, using the protocol as defined in XEP-0045.
  2. Use the REST API plugin for Openfire, which has an endpoint that allows you to do this.

I hope this helps!

Right can you please clarify one point. Isn’t admins added to MUC Service(conference service) and admins added to room are different things. Admins added to public conference are allowed send chat message in all rooms which is what i want, other way is add each admin individually to each room which requires more logic if we have many rooms. Is there is a way or api to admin to conference service at runtime or what you suggested above is the only way.

Ah, sorry, I missed that. What I suggested indeed works on the room level, not on the service level.

I have little experience with doing that. Maybe you can work around the issue by assigning a group to be the administrator of the service, and then dynamically adding/removing people from that group.