-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MUC: Make allow_query_users discoverable #3830
Comments
I guess you mean if the option is set to |
Well, that may be a feature of some clients.
But that would require an additional implementation in the client. I was looking in https://xmpp.org/extensions/xep-0045.html#disco-roominfo and elsewhere that document, and found no standard method to inform in the server (and determine in the client) when that feature is enabled or disabled. If there's no standard method, we can implement one in ejabberd, but obviously client wouldn't support it, and would require implementing it, which probably won't happen if only ejabberd implements it and isn't standarized yet. Maybe other servers inform this option (on an equivalent one) in some way that is a de-facto standard and ejabberd could follow it? Or maybe those clients that query room occupants should be clever enough to query only a few occupants (for example five), and abort the process if all those initial five fail... |
No not only when it is Yes exactly that section you link describes that room config options can be put into the disco info answer, this is well standardized, and ejabberd uses this already, see the disco info of your support muc. See the many What i ask is simply adding one more as it is useful to know before join. other servers add custom config options with clark notation <field type="boolean" var="{xmpp:prosody.im}muc#roomconfig_unaffiliated_media">
<value>1</value>
</field> so i propose something like <field type="boolean" var="{xmpp:ejabberd.im}muc#roomconfig_allow_query_users">
<value>1</value>
</field> Disco Info: ejabberd support room <iq xmlns="jabber:client" xml:lang="en" to="myjid/gajim.5TB7H4TI" from="[email protected]" type="result" id="86ab8abd-a949-4452-8d12-8804065474b2">
<query xmlns="http://jabber.org/protocol/disco#info">
<identity name="ejabberd" 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="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 var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/muc#roominfo</value>
</field>
<field var="muc#roominfo_occupants" type="text-single" label="Number of occupants">
<value>151</value>
</field>
<field var="muc#roomconfig_roomname" type="text-single" label="Natural-Language Room Name">
<value>ejabberd</value>
</field>
<field var="muc#roominfo_description" type="text-single" label="Room description">
<value>ejabberd discussions</value>
</field>
<field var="muc#roominfo_contactjid" type="jid-multi" label="Contact Addresses (normally, room owner or owners)" />
<field var="muc#roominfo_changesubject" type="boolean" label="Occupants May Change the Subject">
<value>0</value>
</field>
<field var="muc#roomconfig_allowinvites" type="boolean" label="Occupants are allowed to invite others">
<value>0</value>
</field>
<field var="muc#roomconfig_allowpm" type="list-single" label="Roles that May Send Private Messages">
<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 var="muc#roominfo_lang" type="text-single" label="Natural Language for Room Discussions">
<value>en</value>
</field>
</x>
</query>
</iq> |
First of all: what client are you using that shows this behaviour?
This is my point:
If you are using an aggressive client that sends queries to all occupants in a room... that same client could be improved to behave more politely: when it joins a room, send a query to one occupant; if that returns error, then don't query the remaining occupants. |
Every client that supports vcard-avatars does show that behavior. If we receive a hash via presence, we query the avatar. Why? Because users want to see avatars. Its fine by me if you break that standard with a non-standard config option. But at least have the courtesy to tell clients about it and not tell them to find out by trial and error themself. XMPP is an extensible protocol, nothing stops you from putting this custom extension into your disco info, you dont need to standardize it. Further its not standardized what "not-allowed" even means when i query a single JID. How would i interpret this as IQ querys in general are not allowed? The next server does only allow certain IQ querys and reacts with the same not-allowed error, which would not mean all IQ querys are forbidden. Either way clients have to implement code here that takes into account that this custom setting exists in ejabberd. Disco info is the place where you tell the world about this object. And not allowing any IQ querys which means, no avatars, no vcards and bunch of other things, is an important information that i want the user to know. It has the same importance like the "allow_pms" settings, which you happily disclose. |
I'll take a look at the feature and hopefully upload here a patch for testing. What ejabberd version, install method, and what client are you able to implement the corresponding client part? |
I would implement it in Gajim. If you tell me upfront the var name, i can implement this and push it in the next version, then you could see for yourself if your patch is working, as i want to display that info to the user. Or you have some testserver i could test it against, would also be ok. I want to avoid compiling ejabberd myself and apply a patch as im not well versed with servers. If i must i would use the debian package or the docker hub install method. |
Ah, ejabberd already provides a lot of custom fields in disco#info. Let's just add another one. For testing, I committed changes in my xmpp and ejabberd forks, and tested with Tkabber to change the room option and checked disco#info shows it. You have installers and deb in https://github.com/badlop/ejabberd/actions/runs/2434116766 But maybe the easiest way is using the container in Docker:
|
Hi, works for me
|
@lovetox: Can you look for this part too? Thanks in advance. |
@badlop humble reminder, i tested this change, as there is no PR attached to this issue, i hope your changes dont get lost. LTGM. |
Is your feature request related to a problem? Please describe.
This is not possible if
allow_query_users
is enabled.If this roomconfig would be announced in the rooms disco info, clients could discover this before join and hence react accordingly (not query a hundred users)
Describe the solution you'd like
Announce the setting on the room disco info
Describe alternatives you've considered
Writing some ugly complex trial and error code to work around this.
The text was updated successfully, but these errors were encountered: