How can "member"-affiliation occupant invite others to members-only room?

HaXkil The
Added over 4 years ago

Hi guys!

I have a situation, where:

  1. User A creates room

  2. User A invites B to the room

  3. User B tries to invite user C to this room and fails

I checked topic Mediated invitations to members-only MUC rooms but haven't found an answer.

I also went through the code of MediatedInvitationModule and cannot figure out how can I address my issue.

Could you suggest any approach?

Thank you!

Replies (4)


Added by Bartosz Malkowski TigaseTeam over 4 years ago

What kind of error you receive?


Added by HaXkil The over 4 years ago

MediatedInvitationModule produces initial exception on the check of affiliation to edit members list.

I've put comments in code:

    private void doInvite(Element invite, Room room, BareJID roomJID, JID senderJID, Role senderRole,
            Affiliation senderAffiliation) throws RepositoryException, TigaseStringprepException, MUCException {

        if (room == null)
            throw new MUCException(Authorization.ITEM_NOT_FOUND);

        if (!senderRole.isInviteOtherUsers())
            throw new MUCException(Authorization.NOT_ALLOWED);

        if (room.getConfig().isRoomMembersOnly() && !senderAffiliation.isEditMemberList())  // This check is not passed, because room is members-only and 
                                                                                           // sender's affiliation is "member", so this affiliation does not allow to edit members list. 
            throw new MUCException(Authorization.FORBIDDEN);  

Finally I'm getting authorization forbidden exception.

Added by HaXkil The about 4 years ago

Hi guys. Are there any updates on it? This is pretty major issue in our system. Is there any workaround?


Added by Bartosz Malkowski TigaseTeam about 4 years ago

Only moderator is allowed to invite others.