Reputation: 22556
openfire 4.0.2
https://github.com/igniterealtime/REST-API-Client
I am using the REST API Client to add a user to a room. Looking at the debug information it seems to return success 201. However, the user is not added to the chat room.
1 > POST http://10.10.20.160:9090/plugins/restapi/v1/chatrooms/coffeeroom/members/[email protected]
1 > Authorization: Basic YWRtaW46Zm9ydW0xOA==
1 > Content-Type: application/xml
Apr 06, 2016 12:31:51 AM org.glassfish.jersey.filter.LoggingFilter log
INFO: 1 * Client response received on thread http-nio-8080-exec-2
1 < 201
1 < Access-Control-Allow-Credentials: true
1 < Access-Control-Allow-Headers: origin, content-type, accept, authorization
1 < Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
1 < Access-Control-Allow-Origin: *
1 < Content-Length: 0
1 < Date: Tue, 05 Apr 2016 17:31:51 GMT
1 < Expires: Thu, 01 Jan 1970 00:00:00 GMT
1 < Set-Cookie: JSESSIONID=153sgnfp1oi1x16rjo68kvbwz8;Path=/;HttpOnly
1 < X-Frame-Options: deny
I have successfully created new group chat rooms using the REST API, but can't add any users into them. Using this code.
mRestXmppClient.getRestApiClient().addMember(roomName, username);
Just wondering for this to work do I need to add any particular setting for the users, rooms, roles to add a user into a chat room?
Under Permissions (Room Affiliations)
I have added [email protected] to the members of this room.
However, I am still not able to add a member to the group chat room. Am I missing something here? I am wondering if there is any settings that I need to modify for the room to get this to work. These are the properties of the room I am trying to add a member to.
Any extra help would be grateful.
Upvotes: 4
Views: 1419
Reputation: 1216
I guess you misunderstood the flow/design how it works. By adding a user e.g over REST API to a member/admin/outcast/owner list does NOT mean the user will be placed there as an occupant with this role/affiliation.
It means the user have only follow affiliation (be a normal member or admin etc.). Really good overview about MUC XMPP terms is the XEP: http://xmpp.org/extensions/xep-0045.html#terms-general
If you want to be an occupant, you need to connect to the server and also join the channel. After that you will present as an occupant with probably specific role.
I would recommend you to read more about Multi User Chat here: http://xmpp.org/extensions/xep-0045.html
Upvotes: 6