Skip to content

basic implementation of an /share?msg=foo endpoint #29874

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

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Draft

Conversation

ara4n
Copy link
Member

@ara4n ara4n commented May 2, 2025

This is a basic PoC to use the ForwardDialog to let users share arbitrary text messages into Matrix, similar to a mobile app's share extension. Needs UTs, but have manually successfully tested:

  • sharing on a logged in user in a new tab
  • sharing on a logged in user in an existing tab
  • sharing on a non-logged in user (which remembered the intent correctly)

As of May 14th I've added sharing markdown & html formatted msgs too.

URI scheme is /#/share?format={format}&msg={msg} where format is optional, can be one of text, html or md but defaults to text if missing.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.

@ara4n ara4n requested a review from a team as a code owner May 2, 2025 19:50
@ara4n ara4n requested review from dbkr and florianduros May 2, 2025 19:50
expect(defaultDispatcher.dispatch).toHaveBeenCalledWith({
action: "share",
msg: "Hello",
format: "B",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for sorting out tests. what's going on with the format: "B" here? shouldn't it be one of the string vals from the SharedFormat enum?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, it is typed so it probably ought to be one of the types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants