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

Question: template-msc number for Reply (not in thread)? #160

Open
Benjamin-Loison opened this issue Nov 22, 2023 · 2 comments
Open

Question: template-msc number for Reply (not in thread)? #160

Benjamin-Loison opened this issue Nov 22, 2023 · 2 comments
Labels
question Further information is requested

Comments

@Benjamin-Loison
Copy link
Contributor

Benjamin-Loison commented Nov 22, 2023

I would like to contribute by adding a template for Reply (not in thread), as suggested:

If you use events not listed here, please file a PR and submit your event
template to this collection so that others can take advantage of it as well.
Thank you! :heart:

While I know how to get the correct JSON payload to send, I do not know how to get its template-msc number, even with matrix-spec-proposals.

Example of such a payload according to Element desktop:

{
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "> <@benjamin_loison:matrix.org> INITIAL_MESSAGE\n\nANSWER_MESSAGE",
    "format": "org.matrix.custom.html",
    "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!CENSORED_0:matrix.org/$CENSORED_1?via=matrix.org\">In reply to</a> <a href=\"https://matrix.to/#/@benjamin_loison:matrix.org\">@benjamin_loison:matrix.org</a><br>INITIAL_MESSAGE</blockquote></mx-reply>nANSWER_MESSAGE",
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$CENSORED_1"
      }
    }
  }
}

Giving me the correct template-msc number and explaining me how you found it would help me to contribute :)

@8go
Copy link
Owner

8go commented May 2, 2024

Here is a list of MSCs https://github.com/matrix-org/matrix-spec-proposals/tree/main/proposals

The name summarizes what the MSC is roughly about: e.g. https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/2676-message-editing.md tells you that MSC 2676 is about message editing.

Inside in the detailed description of an MSC you might find a JSON outline like this:

{
    "type": "m.room.message",
    "content": {
        "body": "* Hello! My name is bar",
        "msgtype": "m.text",
        "m.new_content": {
            "body": "Hello! My name is bar",
            "msgtype": "m.text"
        },
        "m.relates_to": {
            "rel_type": "m.replace",
            "event_id": "$some_event_id"
        }
    }
}

Does this help you a step further ?

You can do searches:

Go to: https://github.com/matrix-org/matrix-spec-proposals/tree/main/proposals

In your example above, there was a JSON field: m.relates_to. You might want to search for m.relates_to.

There is a search box on top right of page: enter search term there.

Full search term is: "repo:matrix-org/matrix-spec-proposals m.relates_to"

It gives you all the MSCs that have that field.

This way you can narrow down which MSC exactly it is and what event you exactly want to create.

Please keep us posted if this helps and what you found out. Cheers.

Thanks for trying to contribute 🚀 👏

@8go 8go added the question Further information is requested label May 2, 2024
@8go 8go changed the title template-msc number for Reply (not in thread)? Question: template-msc number for Reply (not in thread)? May 2, 2024
@Benjamin-Loison
Copy link
Contributor Author

Benjamin-Loison commented May 11, 2024

In fact, according to Element desktop, it seems that my initial event source can be minimized to:

{
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "ANSWER_MESSAGE",
    "format": "org.matrix.custom.html",
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$INITIAL_MESSAGE_ID"
      }
    }
  }
}

It is still unclear what template-msc number would be appropriate:

grep -rwl 'in_reply_to' -m 1
proposals/3952-intentional-mentions.md
proposals/3676-transitioning-away-from-reply-fallbacks.md
proposals/2674-event-relationships.md
proposals/2676-message-editing.md
proposals/3440-threading-via-relations.md

Assuming that matrix-commander/tree/078da5f16c9b94893939ad19a21677f84a8625f9/event-templates are specific to a given proposal, then only the first 3 proposals seem relevant. Based on in_reply_to occurrences, only the second seems quite relevant but in fact it is does not seem to introduce in_reply_to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants