-
Notifications
You must be signed in to change notification settings - Fork 4
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
Canonical alias #174
base: main
Are you sure you want to change the base?
Canonical alias #174
Conversation
// as of now spaces need a canonical alias and be listed in the room direcotry in order to be joinable via federation | ||
// we create the alias with the title of the item seperated by dashes and in lower case. | ||
// @TODO sanitise for special characters which might be allowed in room name but not for the alias | ||
const alias = '#' + space.name.replace(/\s+/g, '-').toLowerCase() + '-' + localStorage.getItem('mx_user_id').substring(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add a random 4-digit number or so in case someone adds two content items with the very same name?
if (config.medienhaus.createCanonicalAliasOnPublish) { | ||
// as of now spaces need a canonical alias and be listed in the room direcotry in order to be joinable via federation | ||
// we create the alias with the title of the item seperated by dashes and in lower case. | ||
// @TODO sanitise for special characters which might be allowed in room name but not for the alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (config.medienhaus.createCanonicalAliasOnPublish) { | ||
await matrixClient.setRoomDirectoryVisibility(roomId, 'private') | ||
.catch(console.debug) | ||
await matrixClient.deleteAlias('#' + space.rooms[0].name.replace(/\s+/g, '-').toLowerCase() + '-' + localStorage.getItem('mx_user_id').substring(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add canonical alias when publishing an item.
As of now it looks like this is needed to be able to join a space from a different server.