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

Add an MXCUri class for representing media uri's in matrix #29

Merged
merged 5 commits into from
Sep 12, 2022

Conversation

anoadragon453
Copy link
Member

Split off from matrix-org/synapse#13162 to allow other projects to use the same class.

This PR:

  • Adds an MXCUri class (under a new types module) which is used to represent MXC URIs in Matrix. The class is mostly useful for validating URIs as well as providing methods for converting from a str and back.
  • Adds tests for said class.

As noted in matrix-org/synapse#13162 (comment), the validation here is quite loose, as the exact grammar for mxc uri's is still not set in stone (see matrix-org/matrix-spec#503).

@anoadragon453 anoadragon453 requested a review from a team as a code owner July 18, 2022 12:48
tests/types/test_mxc_uri.py Outdated Show resolved Hide resolved
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants