processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6k stars 1.5k forks source link

there is no roominfo_avatarhash in muc disco info #4234

Open Ri0n opened 3 weeks ago

Ri0n commented 3 weeks ago

Before creating a ticket, please consider if this should fit the discussion forum better.

Environment

Errors from error.log/crash.log

No errors

Bug description

It's about XEP-0486 implementation. after setting vcard-temp for muc it sends back two stanzas

<presence from="test@conference.localhost" id="16055317580281355378" to="rion@localhost/rionpc">
<x xmlns="vcard-temp:x:update">
<photo>17761ab7de422f048f1cd449bd4f003925dbc4c0</photo>
</x>
<c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.process-one.net/en/ejabberd/" ver="ug2PblIAwfYUkiKIGxaVMDGKD/4="/>
</presence>

<message from="test@conference.localhost" id="724870792862519450" to="rion@localhost/rionpc" type="groupchat">
<x xmlns="http://jabber.org/protocol/muc#user">
<status code="104"/>
</x>
</message>

this triggers my code to query disco#info

<iq id="b481ab5f-5311-4829-984d-80899c9c2a48" to="test@conference.localhost" type="get">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>

which looks like this

<iq from="test@conference.localhost" id="b481ab5f-5311-4829-984d-80899c9c2a48" to="rion@localhost/rionpc" type="result" xml:lang="en">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity category="conference" type="text"/>
<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="urn:xmpp:message-moderate:0"/>
<feature var="urn:xmpp:message-retract:1"/>
<feature var="muc_public"/>
<feature var="muc_temporary"/>
<feature var="muc_open"/>
<feature var="muc_semianonymous"/>
<feature var="muc_moderated"/>
<feature var="muc_unsecured"/>
<feature var="jabber:iq:register"/>
<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 label="Number of occupants" type="text-single" var="muc#roominfo_occupants">
<value>1</value>
</field>
<field label="Natural-Language Room Name" type="text-single" var="muc#roomconfig_roomname"/>
<field label="Room description" type="text-single" var="muc#roominfo_description"/>
<field label="Occupants May Change the Subject" type="boolean" var="muc#roomconfig_changesubject">
<value>1</value>
</field>
<field label="Occupants are allowed to invite others" type="boolean" var="muc#roomconfig_allowinvites">
<value>0</value>
</field>
<field label="Occupants are allowed to query others" type="boolean" var="muc#roomconfig_allow_query_users">
<value>1</value>
</field>
<field label="Roles that May Send Private Messages" type="list-single" 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 label="Natural Language for Room Discussions" type="text-single" var="muc#roominfo_lang">
<value>en</value>
</field>
</x>
</query>
</iq>

According to XEP-0486 there has to be roominfo_avatarhash in disco result, and if it's not there that means avatar is not set. So my code relies on this and removes this muc's avatar from its cache. But in fact ejabberd still has it avatar.

I believe something has to be fixed. the xep or ejabberd.

Neustradamus commented 2 weeks ago

@prefiks, @badlop: What do you think?

prefiks commented 2 weeks ago

Looks like this is was added in later revision of this xep, than what ejabberd implements. I will see what can be done about it