agsXMPP, Create muc room "Only occupants are allowed to send messages to the conference"

226 Views Asked by At

I need help with agsXMPP

  1. user ([email protected]) authorization is successful
  2. the user [email protected] created muc room (group chat) [email protected] 3.the user [email protected] send request to invite another user to this room, but server return message
    <message xmlns="jabber:client" from="[email protected]" to="[email protected]/agsXMPP" type="error" xml:lang="en">
       <error type="modify" code="406">
          <not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
          <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Only occupants are allowed to send messages to the conference</text>
       </error>
       <body>Hi everybody...</body>
    </message>

how can the creator of a room become a member of a room and invite another user to this room ?

1

There are 1 best solutions below

0
Badlop On

how can the creator of a room become a member of a room and invite another user to this room ?

No, no need for the user to be a room member , that is an affiliation: https://xmpp.org/extensions/xep-0045.html#affil

What you want is the user to be a room occupant, which means that the user joins/enters the room.

If the user sends a Mediated Invitation, he must be a room occupant when sending the invitation, as mentioned in: https://xmpp.org/extensions/xep-0045.html#invite

So, the user must join/enter the room he created: https://xmpp.org/extensions/xep-0045.html#enter and then he can send the invitation.

And what's the code to implement client joining a room in the library you are using? Sorry, I don't know that library.