mirror of
https://github.com/paul-nameless/tg
synced 2024-11-22 03:43:19 +00:00
Update to TDLib 1.7.10 (#259)
This commit is contained in:
parent
c2f5fca2f1
commit
7f9dd9b829
4 changed files with 6 additions and 6 deletions
|
@ -873,7 +873,7 @@ class Controller:
|
||||||
return
|
return
|
||||||
|
|
||||||
# notify
|
# notify
|
||||||
if self.model.is_me(msg["sender"].get("user_id")):
|
if self.model.is_me(msg["sender_id"].get("user_id")):
|
||||||
return
|
return
|
||||||
user = self.model.users.get_user(msg.sender_id)
|
user = self.model.users.get_user(msg.sender_id)
|
||||||
name = f"{user['first_name']} {user['last_name']}"
|
name = f"{user['first_name']} {user['last_name']}"
|
||||||
|
|
|
@ -175,7 +175,7 @@ class Model:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def can_be_deleted(self, chat_id: int, msg: Dict[str, Any]) -> bool:
|
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:
|
if chat_id == c_id:
|
||||||
return msg["can_be_deleted_only_for_self"]
|
return msg["can_be_deleted_only_for_self"]
|
||||||
return msg["can_be_deleted_for_all_users"]
|
return msg["can_be_deleted_for_all_users"]
|
||||||
|
|
|
@ -220,7 +220,7 @@ class MsgProxy:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def sender_id(self) -> int:
|
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"
|
"chat_id"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,7 @@ class ChatView:
|
||||||
msg = chat.get("last_message")
|
msg = chat.get("last_message")
|
||||||
if (
|
if (
|
||||||
msg
|
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 msg["id"] > chat["last_read_outbox_message_id"]
|
||||||
and not self.model.is_me(chat["id"])
|
and not self.model.is_me(chat["id"])
|
||||||
):
|
):
|
||||||
|
@ -270,7 +270,7 @@ class ChatView:
|
||||||
flags.append("unseen")
|
flags.append("unseen")
|
||||||
elif (
|
elif (
|
||||||
msg
|
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 msg["id"] <= chat["last_read_outbox_message_id"]
|
||||||
):
|
):
|
||||||
flags.append("seen")
|
flags.append("seen")
|
||||||
|
@ -610,7 +610,7 @@ def get_last_msg(
|
||||||
if not last_msg:
|
if not last_msg:
|
||||||
return None, "<No messages yet>"
|
return None, "<No messages yet>"
|
||||||
return (
|
return (
|
||||||
last_msg["sender"].get("user_id"),
|
last_msg["sender_id"].get("user_id"),
|
||||||
parse_content(MsgProxy(last_msg), users),
|
parse_content(MsgProxy(last_msg), users),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue