mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Fixes #661.
This commit is contained in:
parent
7edf197ecc
commit
f8463063ac
1 changed files with 10 additions and 6 deletions
|
@ -117,6 +117,9 @@ func SetLocalAlias(
|
||||||
// 1. The new method for checking for things matching an AS's namespace
|
// 1. The new method for checking for things matching an AS's namespace
|
||||||
// 2. Using an overall Regex object for all AS's just like we did for usernames
|
// 2. Using an overall Regex object for all AS's just like we did for usernames
|
||||||
for _, appservice := range cfg.Derived.ApplicationServices {
|
for _, appservice := range cfg.Derived.ApplicationServices {
|
||||||
|
// Don't prevent AS from creating aliases in its own namespace
|
||||||
|
// Note that Dendrite uses SenderLocalpart as UserID for AS users
|
||||||
|
if device.UserID != appservice.SenderLocalpart {
|
||||||
if aliasNamespaces, ok := appservice.NamespaceMap["aliases"]; ok {
|
if aliasNamespaces, ok := appservice.NamespaceMap["aliases"]; ok {
|
||||||
for _, namespace := range aliasNamespaces {
|
for _, namespace := range aliasNamespaces {
|
||||||
if namespace.Exclusive && namespace.RegexpObject.MatchString(alias) {
|
if namespace.Exclusive && namespace.RegexpObject.MatchString(alias) {
|
||||||
|
@ -128,6 +131,7 @@ func SetLocalAlias(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var r struct {
|
var r struct {
|
||||||
RoomID string `json:"room_id"`
|
RoomID string `json:"room_id"`
|
||||||
|
|
Loading…
Reference in a new issue