fix(avatar): acknowledge BOXIM messages as read

This commit is contained in:
stefanfeng
2026-08-20 17:10:54 +08:00
parent 64b7680ec4
commit e2b928273c
4 changed files with 90 additions and 1 deletions
@@ -162,6 +162,27 @@ class BoxIMClient:
raise BoxIMError("BOXIM 私聊消息格式不正确")
return [item for item in data if isinstance(item, dict)]
async def mark_private_messages_read(
self,
access_token: str,
friend_id: int | str,
message_id: int | str,
) -> None:
"""Mark one private conversation read through its latest received message."""
friend_id_text = str(friend_id).strip()
message_id_text = str(message_id).strip()
if not friend_id_text.isdigit() or not message_id_text.isdigit():
raise BoxIMError("BOXIM 已读回执参数不正确")
await self._request(
"PUT",
"/message/private/readed",
access_token,
params={
"friendId": int(friend_id_text),
"messageId": int(message_id_text),
},
)
async def send_private_message(
self,
access_token: str,