XMPP: Disco info IQ for chatrooms #36

Open
opened 2024-03-24 23:15:10 +00:00 by nikita · 0 comments
Owner

Right now IQ of namespace http://jabber.org/protocol/disco#items to rooms returns this:

<iq type="result" from="kek@rooms.localhost" id="d42c8a92-7e04-4d30-b5e5-d3d5f54b3c83">
    <query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>

A correct result looks like this:

<iq type="result" xml:lang="en" to="a@localhost/kek" from="mam@conference.localhost" id="a7064425-c2e9-4605-9a99-4cae0b78a9a1">
    <query xmlns="http://jabber.org/protocol/disco#info">
        <identity type="text" category="conference"/>
        <feature var="vcard-temp"/>
        <feature var="http://jabber.org/protocol/muc"/>
        <feature var="http://jabber.org/protocol/disco#info"/>
        <feature var="http://jabber.org/protocol/disco#items"/>
        <feature var="http://jabber.org/protocol/commands"/>
        <feature var="muc_public"/>
        <feature var="muc_persistent"/>
        <feature var="muc_open"/>
        <feature var="muc_semianonymous"/>
        <feature var="muc_moderated"/>
        <feature var="muc_unsecured"/>
        <feature var="urn:xmpp:mam:tmp"/>
        <feature var="urn:xmpp:mam:0"/>
        <feature var="urn:xmpp:mam:1"/>
        <feature var="urn:xmpp:mam:2"/>
        <feature var="urn:xmpp:sid:0"/>
        <x xmlns="jabber:x:data" type="result">
            <field type="hidden" var="FORM_TYPE">
                <value>http://jabber.org/protocol/muc#roominfo</value>
            </field>
            <field type="text-single" label="Number of occupants" var="muc#roominfo_occupants">
                <value>0</value>
            </field>
            <field type="text-single" label="Natural-Language Room Name" var="muc#roomconfig_roomname"/>
            <field type="text-single" label="Room description" var="muc#roominfo_description"/>
            <field type="boolean" label="Occupants May Change the Subject" var="muc#roominfo_changesubject">
                <value>1</value>
            </field>
            <field type="boolean" label="Occupants are allowed to invite others" var="muc#roomconfig_allowinvites">
                <value>0</value>
            </field>
            <field type="list-single" label="Roles that May Send Private Messages" var="muc#roomconfig_allowpm">
                <value>anyone</value>
                <option label="Anyone">
                    <value>anyone</value>
                </option>
                <option label="Anyone with Voice">
                    <value>participants</value>
                </option>
                <option label="Moderators Only">
                    <value>moderators</value>
                </option>
                <option label="Nobody">
                    <value>none</value>
                </option>
            </field>
            <field type="text-single" label="Natural Language for Room Discussions" var="muc#roominfo_lang">
                <value>en</value>
            </field>
        </x>
    </query>
</iq>

The most important element is <identity type="text" category="conference"/>, others likely should be omitted for now.

Right now IQ of namespace `http://jabber.org/protocol/disco#items` to rooms returns this: ```xml <iq type="result" from="kek@rooms.localhost" id="d42c8a92-7e04-4d30-b5e5-d3d5f54b3c83"> <query xmlns="http://jabber.org/protocol/disco#items"/> </iq> ``` A correct result looks like this: ```xml <iq type="result" xml:lang="en" to="a@localhost/kek" from="mam@conference.localhost" id="a7064425-c2e9-4605-9a99-4cae0b78a9a1"> <query xmlns="http://jabber.org/protocol/disco#info"> <identity type="text" category="conference"/> <feature var="vcard-temp"/> <feature var="http://jabber.org/protocol/muc"/> <feature var="http://jabber.org/protocol/disco#info"/> <feature var="http://jabber.org/protocol/disco#items"/> <feature var="http://jabber.org/protocol/commands"/> <feature var="muc_public"/> <feature var="muc_persistent"/> <feature var="muc_open"/> <feature var="muc_semianonymous"/> <feature var="muc_moderated"/> <feature var="muc_unsecured"/> <feature var="urn:xmpp:mam:tmp"/> <feature var="urn:xmpp:mam:0"/> <feature var="urn:xmpp:mam:1"/> <feature var="urn:xmpp:mam:2"/> <feature var="urn:xmpp:sid:0"/> <x xmlns="jabber:x:data" type="result"> <field type="hidden" var="FORM_TYPE"> <value>http://jabber.org/protocol/muc#roominfo</value> </field> <field type="text-single" label="Number of occupants" var="muc#roominfo_occupants"> <value>0</value> </field> <field type="text-single" label="Natural-Language Room Name" var="muc#roomconfig_roomname"/> <field type="text-single" label="Room description" var="muc#roominfo_description"/> <field type="boolean" label="Occupants May Change the Subject" var="muc#roominfo_changesubject"> <value>1</value> </field> <field type="boolean" label="Occupants are allowed to invite others" var="muc#roomconfig_allowinvites"> <value>0</value> </field> <field type="list-single" label="Roles that May Send Private Messages" var="muc#roomconfig_allowpm"> <value>anyone</value> <option label="Anyone"> <value>anyone</value> </option> <option label="Anyone with Voice"> <value>participants</value> </option> <option label="Moderators Only"> <value>moderators</value> </option> <option label="Nobody"> <value>none</value> </option> </field> <field type="text-single" label="Natural Language for Room Discussions" var="muc#roominfo_lang"> <value>en</value> </field> </x> </query> </iq> ``` The most important element is `<identity type="text" category="conference"/>`, others likely should be omitted for now.
nikita added the
bug
label 2024-03-24 23:15:44 +00:00
nikita added the
xmpp
label 2024-03-25 09:16:27 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lavina/lavina#36
No description provided.