Skip to content

XEP-0317: Hats, Update and complete the protocol #1437

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edhelas
Copy link
Contributor

@edhelas edhelas commented Apr 30, 2025

As a client developper the current Hats XEP is far from be usable and feature complete.

The goal of those changes is to:

This PR make the following changes:

  • Specify a urn:xmpp:hats:commands:dcreate command to add a hat to the available list
  • Specify a urn:xmpp:hats:commands:ddestroy command to destroy a hat from the list
  • Clarify how the service should broadcast the hat changes when it is edited, assigned, removed or destroyed
  • Specify a way for an entity to get the complete list of hats using a hash in disco#info
  • Add a hue optional parameter allowing entities to assign a color to the hat that can be displayed properly in any conditions on the client (as explained in XEP-0392: Consistent Color Generation)
  • Fix some typos

The HTML generated version of this PR is available here: https://movim.eu/xeps/xep-0317.html

@github-actions github-actions bot added Needs Version Block The change requires a version block, and this is to be done by Editors at merge time. Needs Author The XEP is experimental and the PR was not made by the author. The author needs to acknowledge it. labels Apr 30, 2025
@edhelas edhelas changed the title XEP-0317: Update and complete the protocol XEP-0317: Hats, Update and complete the protocol Apr 30, 2025
@edhelas edhelas force-pushed the master branch 2 times, most recently from 265d78a to 9208423 Compare April 30, 2025 21:44
@lovetox
Copy link

lovetox commented Apr 30, 2025

If we need a notification mechanism, we can use the MUC Status that the config changed. See https://xmpp.org/extensions/xep-0486.html#example-7 for an example.

It does not really matter if the config is really available via MUC Config form.

What client usually do after receiving the status code, is disco the room.

So i would propose to put the full configured list of hats into disco info. That gives us out of the box a way to query the data and receive a notification when something changes. And its in line with other muc configuration which is also available in disco info.

@edhelas
Copy link
Contributor Author

edhelas commented Apr 30, 2025

@lovetox what kind of syntax would you use to list the hats in the disco#info ? 🤔

@lovetox
Copy link

lovetox commented Apr 30, 2025

hm i thought we could include a <reported> form, but seems those have no FORM_TYPE value, and therefore we cannot discover that this form belongs to hats.

Seems we are only allowed to add normal forms to disco, and these tabular data would be quite ugly in a form.

the only other idea i would have is that the room provides a hats hash in disco info. (analog to the avatar hash)
How this hash is generated is up to the server.

whenever this hash changes we know we need to query the hats via adhoc form. Basically doing exactly what we do with avatar hash, just that we dont query vcard and instead executing an adhoc command get-hats or whatever.

@edhelas
Copy link
Contributor Author

edhelas commented May 1, 2025

A hash could work and prevent those disco#info to be very verbose (I anticipate some MUCs to have like 100 hats configured like on some Discord servers).

But I'm still figuring out how you can list all the hats in a form while also integrating all their attributes, basically URI, Title and Hue Color at the moment 🤔

@lovetox
Copy link

lovetox commented May 1, 2025

Ah now i understand because adhoc is also a dataform..

@edhelas edhelas changed the title XEP-0317: Hats, Update and complete the protocol WIP: XEP-0317: Hats, Update and complete the protocol May 1, 2025
@edhelas
Copy link
Contributor Author

edhelas commented May 1, 2025

@lovetox I've updated my PR with a hash + dlist query that returns a form

@edhelas edhelas changed the title WIP: XEP-0317: Hats, Update and complete the protocol XEP-0317: Hats, Update and complete the protocol May 1, 2025
As a client developper the current Hats XEP is far from be usable and feature complete.

The goal of those changes is to:
- Allow clients to develop a nice UI to manage and assign hats, for example like Discord is doing (see https://support.discord.com/hc/en-us/articles/214836687-Discord-Roles-and-Permissions)
- Reconciliate existing implementations and their specificities, see https://docs.ejabberd.im/tutorials/muc-hats/
- Those changes were meant to be backward compatible with the current 0.2.0 version

This PR make the following changes:

- Specify a urn:xmpp:hats:commands:dcreate command to add a hat to the available list
- Specify a urn:xmpp:hats:commands:ddestroy command to destroy a hat from the list
- Clarify how the service should broadcast the hat changes when it is edited, assigned, removed or destroyed
- Specify a way for an entity to get the complete list of hats using a hash in disco#info
- Add a hue optional parameter allowing entities to assign a color to the hat that can be displayed properly in any conditions on the client (as explained in XEP-0392: Consistent Color Generation)
- Fix some typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Author The XEP is experimental and the PR was not made by the author. The author needs to acknowledge it. Needs Version Block The change requires a version block, and this is to be done by Editors at merge time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants