ejabberd icon indicating copy to clipboard operation
ejabberd copied to clipboard

there is no roominfo_avatarhash in muc disco info

Open Ri0n opened this issue 1 year ago • 2 comments

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

Environment

  • ejabberd version: 24.02
  • Erlang version: 14.2.1
  • OS: Gentoo Linux
  • Installed from: distro package

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="[email protected]" 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="[email protected]" 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="[email protected]" type="get">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>

which looks like this

<iq from="[email protected]" 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.

Ri0n avatar Jun 13 '24 16:06 Ri0n

@prefiks, @badlop: What do you think?

Neustradamus avatar Jun 17 '24 22:06 Neustradamus

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

prefiks avatar Jun 18 '24 07:06 prefiks

I added this in 926f60b2ed6ca4ce2796bcc83ccad62aba12fb99

prefiks avatar Jul 16 '24 16:07 prefiks