fix(appservices): don't forward events relating to remote users, and forward events relating to remote aliases

This commit is contained in:
Matthias Ahouansou
2024-04-27 20:41:28 +01:00
parent bd5d9a7560
commit df0ad2d07c
2 changed files with 37 additions and 16 deletions

View File

@@ -87,11 +87,13 @@ pub struct RegistrationInfo {
}
impl RegistrationInfo {
/// Checks if a given user ID matches either the users namespace or the localpart specified in the appservice registration
pub fn is_user_match(&self, user_id: &UserId) -> bool {
self.users.is_match(user_id.as_str())
|| self.registration.sender_localpart == user_id.localpart()
}
/// Checks if a given user ID exclusively matches either the users namespace or the localpart specified in the appservice registration
pub fn is_exclusive_user_match(&self, user_id: &UserId) -> bool {
self.users.is_exclusive_match(user_id.as_str())
|| self.registration.sender_localpart == user_id.localpart()