mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 05:42:46 +00:00
support non-exclusive namespaces for AS (#828)
Signed-off-by: MohitKS5 <mohitkumarsingh907@gmail.com> Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com> Co-authored-by: Kegsay <kegan@matrix.org>
This commit is contained in:
parent
1321f8da80
commit
2c43e222bd
2 changed files with 18 additions and 2 deletions
|
@ -98,6 +98,22 @@ func (a *ApplicationService) IsInterestedInUserID(
|
|||
return false
|
||||
}
|
||||
|
||||
// OwnsNamespaceCoveringUserId returns a bool on whether an application service's
|
||||
// namespace is exclusive and includes the given user ID
|
||||
func (a *ApplicationService) OwnsNamespaceCoveringUserId(
|
||||
userID string,
|
||||
) bool {
|
||||
if namespaceSlice, ok := a.NamespaceMap["users"]; ok {
|
||||
for _, namespace := range namespaceSlice {
|
||||
if namespace.Exclusive && namespace.RegexpObject.MatchString(userID) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// IsInterestedInRoomAlias returns a bool on whether an application service's
|
||||
// namespace includes the given room alias
|
||||
func (a *ApplicationService) IsInterestedInRoomAlias(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue