Update to TDLib 1.7.10 (#259)

This commit is contained in:
Andrey Androsov 2022-04-20 16:04:04 +03:00 committed by GitHub
parent c2f5fca2f1
commit 7f9dd9b829
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -873,7 +873,7 @@ class Controller:
return
# notify
if self.model.is_me(msg["sender"].get("user_id")):
if self.model.is_me(msg["sender_id"].get("user_id")):
return
user = self.model.users.get_user(msg.sender_id)
name = f"{user['first_name']} {user['last_name']}"

View file

@ -175,7 +175,7 @@ class Model:
return False
def can_be_deleted(self, chat_id: int, msg: Dict[str, Any]) -> bool:
c_id = msg["sender"].get("chat_id") or msg["sender"].get("user_id")
c_id = msg["sender_id"].get("chat_id") or msg["sender_id"].get("user_id")
if chat_id == c_id:
return msg["can_be_deleted_only_for_self"]
return msg["can_be_deleted_for_all_users"]

View file

@ -220,7 +220,7 @@ class MsgProxy:
@property
def sender_id(self) -> int:
return self.msg["sender"].get("user_id") or self.msg["sender"].get(
return self.msg["sender_id"].get("user_id") or self.msg["sender_id"].get(
"chat_id"
)

View file

@ -262,7 +262,7 @@ class ChatView:
msg = chat.get("last_message")
if (
msg
and self.model.is_me(msg["sender"].get("user_id"))
and self.model.is_me(msg["sender_id"].get("user_id"))
and msg["id"] > chat["last_read_outbox_message_id"]
and not self.model.is_me(chat["id"])
):
@ -270,7 +270,7 @@ class ChatView:
flags.append("unseen")
elif (
msg
and self.model.is_me(msg["sender"].get("user_id"))
and self.model.is_me(msg["sender_id"].get("user_id"))
and msg["id"] <= chat["last_read_outbox_message_id"]
):
flags.append("seen")
@ -610,7 +610,7 @@ def get_last_msg(
if not last_msg:
return None, "<No messages yet>"
return (
last_msg["sender"].get("user_id"),
last_msg["sender_id"].get("user_id"),
parse_content(MsgProxy(last_msg), users),
)