-
-
Notifications
You must be signed in to change notification settings - Fork 78
MSC4352 (unstable): discover org.matrix.msc4352.permalink_base_url
; share via :permalink; linkify resolver HTTPS to matrix:
on send
#512
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
base: main
Are you sure you want to change the base?
Conversation
- Add discovery of custom permalink base from .well-known/matrix/client - Implement :permalink command for generating room/event permalinks - Add send-time conversion of HTTPS permalinks to matrix: URIs - Support both stable (m.permalink_base_url) and unstable keys - Feature-gated behind IAMB_MSC4352=1 environment variable - Include comprehensive tests and documentation Signed-off-by: Igor Somov <[email protected]>
Is there a reason this PR needs to reimplement existing types like I think it makes more sense to implement most of this in matrix-rust-sdk and maybe just do a string replace in the output of Also I couldn't get this to build (unresolved import |
Signed-off-by: Igor Somov <[email protected]>
Thanks, I fix this:
|
Do you have some local changes you have not pushed or are you using AI to write this code? When I check out your changes locally and run |
Signed-off-by: Igor Somov <[email protected]>
Apologies for the confusion. The issue is that main doesn’t build for me on macOS 26. To get a local build, I’ve been temporarily tweaking build.rs and a few other files, and adding some helper/stub files to work around platform-specific errors. I didn’t commit those local changes, which is why a clean checkout hits the “non-existing functions/attributes” errors you’re seeing. I’ll sort out my macOS setup closer to the weekend, push the minimal required changes (or guard the macOS-specific bits), and re-test with a clean cargo c run. |
Signed-off-by: Igor Somov <[email protected]>
For me |
Signed-off-by: Igor Somov <[email protected]>
9d94a6d
to
88de844
Compare
Now I fix all problems, and add some more tests for this feature :) |
This PR adds an experimental client-side implementation for MSC4352 to help it move through the spec process. It demonstrates:
Discovery: Reads
org.matrix.msc4352.permalink_base_url
(or stablem.permalink_base_url
) from/.well-known/matrix/client
for the user's homeserver domain (HTTPS-only). Also supportsIAMB_MSC4352_PERMALINK_BASE
for local testing.Generation: New command
:permalink
generates HTTPS permalinks for outside-of-Matrix contexts using the matrix.to navigation grammar but with the discovered custom base URL (fallbackhttps://matrix.to
). Supports both room permalinks and event permalinks (:permalink event $eventId
).In-app safety: No in-app links/mentions are rewritten to HTTPS; iamb's in-app navigation remains intact.
Send-time conversion: When a user pastes a resolver-style HTTPS permalink in a message, iamb keeps the visible text but emits
formatted_body
with an equivalentmatrix:
URI (matrix:r/...
,matrix:roomid/.../e/...
, preservingvia=
), ensuring cross-client interoperability.Feature flag
Set
IAMB_MSC4352=1
to enable the feature. You can optionally setIAMB_MSC4352_PERMALINK_BASE
for testing without editing well-known.Testing
https://links.example.org/#/%23room%3Aexample.org/%24event?via=example.org
and send - the message should have an anchor withhref="matrix:r/room:example.org/e/$event?via=example.org"
informatted_body
, whilebody
preserves the original text.:permalink
in a room to get an HTTPS permalink based on discovered or env-provided base.:permalink
falls back tohttps://matrix.to
.Implementation notes
MSC4352.md
This is intentionally a small, low-risk change to qualify MSC4352 with a client implementation.