matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Appservice Can't set alias #2009

Open nkitsaini opened 3 years ago

nkitsaini commented 3 years ago

Same as #661 which is closed but I can still reproduce the issue.

Background information

kegsay commented 2 years ago

× AS can make room aliases

In sytest, which is probably why this isn't possible.

nkitsaini commented 2 years ago

I went through the code and found some relevant stuff (I might be wrong as not familiar with go)

When the Room is created

Psuedo Code for fix:

alias_owner = getExclusiveOwner(alias)
if alias_owner == None:
      proceed and create the alias
else:
      if alias_owner != appservice_who_sent_the_request:
           return AliasIsExclusive() # shouldn't create alias
      else:
           proceed and create the alias

(Similar thing should be confirmed for other namespaces, namely user and room_id