Skip to content
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

Support for custom ephemeral event types (SPEC-376) #169

Open
matrixbot opened this issue Mar 28, 2016 · 4 comments
Open

Support for custom ephemeral event types (SPEC-376) #169

matrixbot opened this issue Mar 28, 2016 · 4 comments
Labels
A-Client-Server Issues affecting the CS API feature Suggestion for a significant extension which needs considerable consideration

Comments

@matrixbot
Copy link
Member

Submitted by @​matthew:matrix.org
To stop TimePath from abusing typing notifications as a discovery mechanism for in-game lobby rooms

(Imported from https://matrix.org/jira/browse/SPEC-376)

@matrixbot matrixbot changed the title Support for custom ephemeral event types Support for custom ephemeral event types (SPEC-376) Oct 31, 2016
@matrixbot matrixbot added spec-bug Something which is in the spec, but is wrong feature Suggestion for a significant extension which needs considerable consideration and removed spec-bug Something which is in the spec, but is wrong labels Nov 7, 2016
@turt2live turt2live added the A-Client-Server Issues affecting the CS API label Feb 6, 2019
@avasconcelos114
Copy link

avasconcelos114 commented May 3, 2019

Is there any particular way this could be done?
I'm still fairly new to Matrix and I've been looking at the Specs for a way to use EDUs to constantly send positional data of several users (as there's no point is storing massive amounts of XYZ coordinates in each HomeServer)

I figured this could be implemented in the client-server API as either:

  1. A completely new endpoint of the ephemeral type
    PUT /_matrix/client/r0/rooms/{roomId}/ephemeral/{eventType}
PUT  /_matrix/client/r0/rooms/%21636q39766251%3Aexample.com/ephemeral/my-custom-event

{
    "content": {
        "foo": "bar"
    } 
}
  1. Adding a new room event m.room.ephemeral and require appropriate data to be sent over / handled
    PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType} (already existing endpoint)
[PUT] /_matrix/client/r0/rooms/%21636q39766251%3Aexample.com/state/m.room.ephemeral

{
    "edu_type": "my-custom-event",
    "content": {
        "foo": "bar"
    } 
}

I'm still not 100% clear on how to implement EDUs properly but I'm up for spending some time studying how m.typing / m.receipt and handled so that custom ones can function similarly

Advice on how to implement this would be greatly appreciated as this would be my first contribution and I've only gone as far as setting a local synapse server and read the CONTRIBUTING file

@uhoreg
Copy link
Member

uhoreg commented May 3, 2019

I think one of the issues here is that different EDUs have different semantics (e.g. typing notifications are handled differently from device list updates), so in order to support custom EDUs, you'd need some way of specifying how it should be handled.

@avasconcelos114
Copy link

avasconcelos114 commented May 4, 2019

Ah, I initially thought the scope of this issue was limited to simplistic use-cases where people just want non-persistent data shared across domains using build_and_send_edu and register_edu_handler to create a general-purpose handler

But if more complex functionality needs to be supported I imagine we would need to either:

  1. Add a method for developers to add their own handlers to Synapse (does not seem likely)
  2. Set up a few general use-cases on what types of EDUs would developers need if they decide to send a custom EDU, and perhaps set a few sub-types that are each handled differently

As my personal use-case only really requires a simple one-time transfer of EDU data, I'd probably need some insight on what other common use-cases would also need to be considered

@Sorunome
Copy link
Contributor

There's an MSC for this by now: matrix-org/matrix-spec-proposals#2477

@richvdh richvdh transferred this issue from matrix-org/matrix-spec-proposals Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Client-Server Issues affecting the CS API feature Suggestion for a significant extension which needs considerable consideration
Projects
None yet
Development

No branches or pull requests

5 participants