Don't kick user from portal on logout if chat has relay bot. Fixes #75
This commit is contained in:
@@ -446,11 +446,12 @@ class Portal:
|
||||
except MatrixRequestError:
|
||||
return []
|
||||
authenticated = []
|
||||
has_bot = self.has_bot
|
||||
for member in members:
|
||||
if p.Puppet.get_id_from_mxid(member) or member == self.main_intent.mxid:
|
||||
continue
|
||||
user = await u.User.get_by_mxid(member).ensure_started()
|
||||
if user.has_full_access:
|
||||
if (has_bot and user.whitelisted) or user.has_full_access:
|
||||
authenticated.append(user)
|
||||
return authenticated
|
||||
|
||||
|
||||
@@ -175,6 +175,8 @@ class User(AbstractUser):
|
||||
|
||||
async def log_out(self):
|
||||
for _, portal in self.portals.items():
|
||||
if portal.has_bot:
|
||||
continue
|
||||
try:
|
||||
await portal.main_intent.kick(portal.mxid, self.mxid, "Logged out of Telegram.")
|
||||
except MatrixRequestError:
|
||||
|
||||
Reference in New Issue
Block a user