Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Use alt_aliases for pills and autocomplete #4102

Merged
merged 9 commits into from
Feb 24, 2020

Conversation

bwindels
Copy link
Contributor

@bwindels bwindels commented Feb 21, 2020

Requires matrix-org/matrix-js-sdk#1225
Fixes element-hq/element-web#12364

As explained in MSC2432, m.room.aliases are being retired. Moderators can set alt_aliases on the canonical alias event to support more than 1 moderated alias (note that there is no UI for this yet). Clients can query the local aliases of a HS through a new /aliases endpoint but should really not show these by default as they are an abuse vector.

So, this PR:

  • adds alt_aliases in addition to the canonical alias to autocomplete
  • leaves the label of a pill as is
  • always renders room pills inside a grey pill (so no more blue link when the room is not found), albeit without an avatar for local non-moderated aliases (we'd have to query /directory otherwise).

Ideally, we'd also add exact matches for local aliases to the autocomplete, so you would be able to send pills for non-moderated aliases from riot, but that proved a bit harder, so let's defer that until it's obvious we need it.

but don't match on name otherwise you see multiple entries per room
when searching for a room name

Also pass the roomId to the composer autocomplete, so
it's easier to we don't need to loop through all the rooms and
it's also easier accept room with local aliases as well in the future
otherwise, display as the label in the link
@bwindels bwindels merged commit dc85346 into develop Feb 24, 2020
@jsonjuri
Copy link

On localhost, it's working fine but after building and run it on our server we are not able to switch rooms: TypeError: e.getAltAliases is not a function

@t3chguy
Copy link
Member

t3chguy commented Feb 24, 2020

sounds like a stale js-sdk @jsonjuri

@jsonjuri
Copy link

sounds like a stale js-sdk @jsonjuri

That's correct, it is solved now, thanks!

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

Successfully merging this pull request may close these issues.

Pills, autocomplete, etc all don't work without alias events
4 participants