Project

General

Profile

MUC component: is there a way to call MucDAO when Occupant is removed from the Room?

HaXkil The
Added about 5 years ago

Hello. I'm using own UserRepository implementation for MUC component.

I have the case, when ocupant with role "owner" kicks another ocupant from the room.

Stanza, which is sent by owner looks similar to

 <iq from='fluellen@shakespeare.lit/pda'
    id='kick1'
    to='harfleur@chat.shakespeare.lit'
    type='set'>
  <query xmlns='http://jabber.org/protocol/muc#admin'>
    <item nick='pistol' role='none'>
      <reason>Avaunt, you cullion!</reason>
    </item>
  </query>
</iq>

In order to set role to "none", as defined in stanza method ModeratorModule.processSetRole() is invoked.

It in turn call Room.removeOccupant() which fires Room.fireOnOccupantRemoved()

My issue is that Room object has no RoomOccupantListener s.

So seems like MucDAO doesn't know about this event (when occupant is removed from the room) and is not

able to call my custom UserRepository in order to update occupant's data.

I observed, that InMemoryMucRepository creates listeners in constructor and then setup them to each room it creates.

Is it possible to create RoomOccupantListener in InMemoryMucRepository as well?

Is there another approach to notify UserRepository/MucDAO when occupant role changed?

I'm afraid that I can get to the situation, when user was successfully kicked out, but changes to the room were stored just in-memory.

After server went down and up MUC component had to pick up data using UserRepository/MucDAO and kicked user will appear to be room member again.


Replies (3)

(1)
Avatar?id=6098&size=32x32

Added by Bartosz Małkowski TigaseTeam about 5 years ago

Occupants lists isn't persistent in current architecture. To make it persistent DAO must be informed also about changed Roles, not only about join&exit.

I haven't any plans to implement it.

Added by peirong jiang over 3 years ago

HaXkil The wrote:

Hello. I'm using own UserRepository implementation for MUC component.

I have the case, when ocupant with role "owner" kicks another ocupant from the room.

Stanza, which is sent by owner looks similar to

[...]

In order to set role to "none", as defined in stanza method ModeratorModule.processSetRole() is invoked.

It in turn call Room.removeOccupant() which fires Room.fireOnOccupantRemoved()

My issue is that Room object has no RoomOccupantListener s.

So seems like MucDAO doesn't know about this event (when occupant is removed from the room) and is not

able to call my custom UserRepository in order to update occupant's data.

I observed, that InMemoryMucRepository creates listeners in constructor and then setup them to each room it creates.

Is it possible to create RoomOccupantListener in InMemoryMucRepository as well?

Is there another approach to notify UserRepository/MucDAO when occupant role changed?

I'm afraid that I can get to the situation, when user was successfully kicked out, but changes to the room were stored just in-memory.

After server went down and up MUC component had to pick up data using UserRepository/MucDAO and kicked user will appear to be room member again.

the same requirement

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

As stated above - there hasn't been any plans to implement such functionality.

    (1-3/3)