Project

General

Profile

how to leave the room permanently?

wince jay
Added almost 3 years ago

From the xep-0045(http://xmpp.org/extensions/xep-0045.html),i see that the occupant can exit from a room via sending an unavailable presence to room jid,and actually it is just exit the session.

But my question is how can i(the occupant) exit from the room permanently?


Replies (7)

(1)

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

You cannot "exit more" - it's simply impossible.

I think you are mixing terms "occupant" and "member", and while entering/exiting applies to the former, you (as a simple user, non-admin) can't change list of members - this is defined in the linked specification.

Added by wince jay almost 3 years ago

Yes,sorry for the mistake for "how can i(the occupant) exit from the room permanently?",I mean the "member" instead of "occupant";

Situation 1

============

I entered the room C (members-only room)*,and the user *A can destroy the room if the A*'s affiliation is owner while the user *B can "exit" the room if the B's affiliation is not the room onwer,right?

The question is :

(despite of entering the room)If the user B wanna exit from the room C ,the user B send the xmpp stanza as shown below to tigase:

<iq from='B@im.exmple.com'
id='member1'
to='test-13@muc.im.example.com'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='outcast'
jid='B@im.example.com'>
</item>
</query>
</iq>

The tigase server response

and the user B's affiliation is changed to "outcast";

Can i remove the room from user B's room list according the response result?(Maintain the one's room list on another server)

And the user B will no longer enter the room C successfully ?

Situation 2

===========

User F(affiliation=member) change User B(affiliation=member)'s affiliation to none.

<iq from='F@im.example.com'
id='member2'
to='test-13@muc.im.example.com'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='outcast'
jid='F@im.example.com>
</item>
</query>
</iq>

Tigase response

<iq from="test-13@muc.im.example.com" type="result" to="F@im.example.com/psi" id="member2"/>

<iq from='F@im.example.com
id='member3'
to='test-13@muc.im.example.com'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='none'
jid='B@im.example.com'>
</item>
</query>
</iq>

Tigase response

<iq from="test-13@muc.im.example.com" type="result" to="F@im.example.com/psi" id="member3"/>

The question : Does any member can change any member's/himself affiliation ?

(1)

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

Priviliges of the affiliations are described in: MUC - Affiliations and Tigase follows those.

(1)

Added by wince jay almost 3 years ago

prerequisite

user F's affiliation: member

user B's affiliation: member

I should figure out that the user F can change user B*'s affiliation happens only when *user F didn't enter the room C.

If the user F enter the room C first,the user F will receive the "not-allowed" error.

(1)

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

No, user with member affiliation can't change affiliation. If it enters the room first (thus creating the room) it automatically becomes owner hence having ability to change the affiliation of other participants.

Added by wince jay almost 3 years ago

There is still some doubts for me.

"If it enters the room first (thus creating the room)" ,i think the user enters the room by sending a presence stanza with nickname,but not sure be to create the room.

"If the room does not yet exist, the service SHOULD create the room (subject to local policies regarding room creation), assign the bare JID of the requesting user as the owner, add the owner to the room, and acknowledge successful creation of the room by sending a presence stanza of the following form" (http://xmpp.org/extensions/xep-0045.html). In my situation,the room C is exsit now.

I check the tigase-muc code: ModeratorModule#processSetAffiliation ->ModeratorModule#checkitem

It does skip the checking if there is no occupants in the room C.

(1)

Added by Wojciech Kapcia TigaseTeam over 2 years ago

wince jay wrote:

In my situation,the room C is exsit now.

It will exists when you enter the room. You can check whether the room exists before joining the room in either service discovery or in the database.

I check the tigase-muc code: ModeratorModule#processSetAffiliation ->ModeratorModule#checkitem

It does skip the checking if there is no occupants in the room C.

It's impossible to arrive in such condition - if you issue a stanza to change the occupant list then you must be in the room therefore there is at list one occupant in the room.

    (1-7/7)