Project

General

Profile

muc#roomconfig_roomadmins broken ?

Added by kellogs . 4 months ago

Hello,

downloaded latest nightly build of tigase as of today from http://build.xmpp-test.net/nightlies/dists/latest/tigase-server-dist-max.tar.gz

I have tried setting up a list of admins for an existing MUC room like so:

<iq id='create2'
    to='maglavais@muc.domain.com'
    type='set'>
  <query xmlns='http://jabber.org/protocol/muc#owner'>
    <x xmlns='jabber:x:data' type='submit'>
      <field var='muc#roomconfig_roomadmins'>
        <value>kellogs2@domain.com</value>
      </field>
    </x>
  </query>
</iq>

<iq from="maglavais@muc.domain.com" type="result" to="admin@domain.com/kellogs-PC" id="create2"/>

in the logs I can see:


017-06-19 12:44:04.225 [in_3-muc]         PresenceFiltered.onSetAffiliation()     FINEST:   Modifying affiliation of: kellogs2@domain.com on occupantsPresenceFiltered: [[]]
2017-06-19 12:44:04.225 [in_3-muc]         Room.getAffiliation()                   FINEST:   Getting affiliations for: kellogs2@domain.com from set: {kellogs2@domain.com=admin, admin@domain.co=owner}

However upon joining the room with the newly setup admin user:

<presence from="maglavais@domain.com/kellogs2" to="kellogs2@domain.com/kellogs-PC">
<priority>5</priority>
<c xmlns="http://jabber.org/protocol/caps" node="http://psi-im.org/caps" ver="caps-b75d8d2b25" ext="cs ep-notify-2 html"/>

<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" nick="kellogs2" role="participant"/>
<status code="110"/>
</x>
</presence>

Some more info from the db:

mysql> select * from tig_muc_room_affiliations where room_id=378;
+---------+-----------------------------+------------------------------------------+-------------+
| room_id | jid                         | jid_sha1                                 | affiliation |
+---------+-----------------------------+------------------------------------------+-------------+
|     378 | admin@domain.com            | 4386256acf3c850c061c9c9b2b6910c06a76af62 | owner       |
+---------+-----------------------------+------------------------------------------+-------------+

378 f11c9a4ba7d0cdc36d84836e657c97ec789961ff NULL <x type="form" xmlns="jabber:x:data"><field type="text-single" label="Natural-Language Room Name" var="muc#roomconfig_roomname"><value></value></field><field type="text-single" label="Short Description of Room" var="muc#roomconfig_roomdesc"><value></value></field><field type="boolean" label="Make Room Persistent?" var="muc#roomconfig_persistentroom"><value>true</value></field><field type="boolean" label="Make Room Publicly Searchable?" var="muc#roomconfig_publicroom"><value>true</value></field><field type="boolean" label="Make Room Moderated?" var="muc#roomconfig_moderatedroom"><value>false</value></field><field type="boolean" label="Make Room Members Only?" var="muc#roomconfig_membersonly"><value>false</value></field><field type="boolean" label="Password Required to Enter?" var="muc#roomconfig_passwordprotectedroom"><value>0</value></field><field type="text-single" label="Password" var="muc#roomconfig_roomsecret"><value></value></field><field type="list-single" label="Room anonymity level:" var="muc#roomconfig_anonymity"><value>semianonymous</value><option label="Non-Anonymous Room"><value>nonanonymous</value></option><option label="Semi-Anonymous Room"><value>semianonymous</value></option><option label="Fully-Anonymous Room"><value>fullanonymous</value></option></field><field type="boolean" label="Allow Occupants to Change Subject?" var="muc#roomconfig_changesubject"><value>true</value></field><field type="boolean" label="Enable Public Logging?" var="muc#roomconfig_enablelogging"><value>0</value></field><field type="list-single" label="Logging format:" var="logging_format"><value>html</value><option label="HTML"><value>html</value></option><option label="Plain text"><value>plain</value></option></field><field type="text-single" label="Maximum Number of History Messages Returned by Room" var="muc#maxhistoryfetch"><value>50</value></field><field type="list-single" label="Maximum Number of Occupants" var="muc#roomconfig_maxusers"><value></value><option label="10"><value>10</value></option><option label="20"><value>20</value></option><option label="30"><value>30</value></option><option label="50"><value>50</value></option><option label="100"><value>100</value></option><option label="None"><value/></option></field><field type="list-single" label="Presence delivery logic" var="tigase#presence_delivery_logic"><value>PREFERE_PRIORITY</value><option label="PREFERE_LAST"><value>PREFERE_LAST</value></option><option label="PREFERE_PRIORITY"><value>PREFERE_PRIORITY</value></option></field><field type="boolean" label="Enable filtering of presence (broadcasting presence only between selected groups" var="tigase#presence_filtering"><value>0</value></field><field type="list-multi" label="Affiliations for which presence should be delivered" var="tigase#presence_filtered_affiliations"><option label="admin"><value>admin</value></option><option label="member"><value>member</value></option><option label="none"><value>none</value></option><option label="outcast"><value>outcast</value></option><option label="owner"><value>owner</value></option></field></x> 2017-06-19 12:04:51.169000 NULL NULL NULL

I have also tried setting the jid as an owner with a similar outcome. Am I doing it wrong ?


Replies (2)

RE: muc#roomconfig_roomadmins broken ? - Added by Bartosz Malkowski 4 months ago

Field muc#roomconfig_roomadmins is not stored in database because it is processed in different way (there is separate affiliation storage).
I added tests to cover this problem but tests works. Would you like to check test scenario here
The only thing I added is field muc#roomconfig_roomadmins in room config result.

RE: muc#roomconfig_roomadmins broken ? - Added by kellogs . 4 months ago

Thank you Bartosz, I have spotted the difference between what I was sending and what the linked test scenario sends, namely:

      <field var="FORM_TYPE">

        <value>http://jabber.org/protocol/muc#roomconfig</value>

      </field>

I have included that one and it seems all fine now.

mysql> select * from tig_muc_room_affiliations where room_id=378;
+---------+----------------------------------------------+------------------------------------------+-------------+
| room_id | jid                                          | jid_sha1                                 | affiliation |
+---------+----------------------------------------------+------------------------------------------+-------------+
|     378 | kellogs3@domain.com                          | 1903fba1055b994eb27bf8aa7462dd053553af02 | outcast     |
|     378 | admin@domain.com                             | 4386256acf3c850c061c9c9b2b6910c06a76af62 | owner       |
|     378 | kellogs2@domain.com                          | f8b61a58a40dcb8311a5d011f3bf10004d02cef8 | admin       |
+---------+----------------------------------------------+------------------------------------------+-------------+

Perhaps it would be a good idea to send back to client an <error> stanza instead of the <result> stanza in such scenarios.

    (1-2/2)