matrix-org / matrix-org/matrix-spec

[idea] Message-subset mention/reply

Open
#893 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

Alternate names;
- Bot-generated bookmarks
- Quotations/references
- Linked data (in JSON)

---

[Chatting with Glue](https://a9.io/glue-comic/) has a lot of interesting (but sporadic and all-over-the-place) ideas, but one thing I want to focus on is [chapter 4](https://a9.io/glue-comic/page-4), which introduces the idea of "replying to specific parts of a message";

![image](https://user-images.githubusercontent.com/22740616/132680286-89a450d3-b459-4117-aeb5-16b9b8cfa105.png)
![image](https://user-images.githubusercontent.com/22740616/132680306-f6185488-15ac-47a7-b36f-ee078c53f0b8.png)

This may be interesting for social reasons, however, the specific thing that sparked me writing down this idea is the amount of current bots that watch out for and react with a message when they see a particular mention of something. Specifically, github bots, most often [go-neb](https://github.com/matrix-org/go-neb) which reacts to messages which mention issue/PR numbers (`#1234`, `example/company#4321`) with a link to the actual issue/PR.

However, in the following case, with the compounding lag and lack of context, it can get verbose;

![image](https://user-images.githubusercontent.com/22740616/132680642-ec440634-8c7e-4fa6-8040-7f8d32de8315.png)

For this, i'd like to give the idea of linking to specific subsets of the message, this'd be a `m.relationship` to an event_id, but then also a selector (something like `.content.formatted_msg[326..387]`) which selects a particular bit of data.

Then the event ID can be much of anything, as mentioned; bookmark, quotation (from in another message), or some form of linked-data format, referencing to a specific field in another event. This'd make those references more machine readable, and easier to generate for bots, which'd then just pick the range that they'd like to add a bookmark to, and clients can decide to render these or not (most likely depending on another state in the room that'd "allow" this).

#### Security

Obviously, someone inserting a link that then (presumably) pops up in the user's original text is a security risk, and so such a privilege should be restricted to a few bots or persons.

However, such a function can also be merely social (such as clarifying a particular bit of info for old readers, by linking to a particular bit of info. This'd also have to happen on an admin or case-by-case basis then.

#### More usages/inspiration

Discourse offers the option to quote/reply/reference multiple sections in multiple messages in a thread, like so;

![image](https://user-images.githubusercontent.com/22740616/132702314-073fca7f-ef07-44a0-882e-7e89b733141d.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are named. Start by reviewing the proposed m.relationship and selector model, including the security and rendering concerns described in the issue; this needs a settled protocol design and acceptance criteria before implementation can be considered done.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.