Disable presence and read receipt bridging for bots. Fixes #194

This commit is contained in:
Tulir Asokan
2018-07-24 12:46:54 -04:00
parent c5bec37401
commit a22b83de44
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -659,6 +659,8 @@ class Portal:
SetTypingRequest(self.peer, action() if typing else SendMessageCancelAction()))
async def mark_read(self, user, event_id):
if user.is_bot:
return
space = self.tgid if self.peer_type == "channel" else user.tgid
message = DBMessage.query.filter(DBMessage.mxid == event_id,
DBMessage.mx_room == self.mxid,
+2
View File
@@ -190,6 +190,8 @@ class User(AbstractUser):
return super().ensure_started(even_if_no_session)
def set_presence(self, online: bool = True):
if self.is_bot:
return
return self.client(UpdateStatusRequest(offline=not online))
async def update_info(self, info: User = None):