feat: web UI chat render, panels, presence + analytics
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from pyrogram import Client, raw
|
||||
from pyrogram.types import User
|
||||
from pyrogram.types import Chat, User
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -54,3 +54,18 @@ def snapshot_from_high_level(
|
||||
is_deleted_account=bool(user.is_deleted),
|
||||
)
|
||||
return fields, photo_file_id, photo_unique_id
|
||||
|
||||
|
||||
def snapshot_from_chat(chat: Chat) -> tuple[ProfileFields, str | None, str | None]:
|
||||
photo = chat.photo
|
||||
photo_unique_id = photo.big_photo_unique_id if photo else None
|
||||
photo_file_id = photo.big_file_id if photo else None
|
||||
fields = ProfileFields(
|
||||
first_name=chat.first_name,
|
||||
last_name=chat.last_name,
|
||||
username=chat.username,
|
||||
phone=None,
|
||||
photo_unique_id=photo_unique_id,
|
||||
is_deleted_account=False,
|
||||
)
|
||||
return fields, photo_file_id, photo_unique_id
|
||||
|
||||
Reference in New Issue
Block a user