What command helps to do that via ejabberd rest-api? From xmpp-client log such command sending:
<iq id="60fe7dd6-82c3-49de-a5a1-f1f71bce6e92" to="[email protected]" type="set">
<query xmlns="http://jabber.org/protocol/muc#admin">
<item nick="[email protected]" role="visitor"/>
</query>
</iq>
Ejabberd version is 20.xx. And i want to say this opportunity works great at swift client connected to our ejabberd service. Just click 'revoke voice' and that user becomes 'visitor' and can't send messages. But I can't do that even via xmpp client smack sdk:
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setXmppAddressAndPassword(JidCreate.entityBareFrom("[email protected]"), "123")
.setHost("example.com")
.setPort(5222)
.build();
AbstractXMPPConnection connection = new XMPPTCPConnection(config);
connection.connect();
connection.login();
MultiUserChatManager mucManager = MultiUserChatManager.getInstanceFor(connection);
MultiUserChat muc = mucManager.getMultiUserChat(JidCreate.entityBareFrom("[email protected]"));
muc.revokeVoice(Resourcepart.from("User2"));
an Exception after trying:
org.jivesoftware.smack.XMPPException$XMPPErrorException: XMPP error reply received from [email protected]: XMPPError: not-allowed - cancel [Changing role/affiliation is not allowed]
But '[email protected]' has admin permission and room '[email protected]' has 'moderated' option in true.
Does anyone know how to do that via api for example via send_stanza?