feat: impersonated ack event
the matrix client-server spec actually doesn't say anything about passing user_id as param: https://spec.matrix.org/latest/client-server-api/#post_matrixclientv3roomsroomidreceiptreceipttypeeventid however matrix-bot-sdk inside its "doRequest" method adds it as query parameter nonetheless:4fb43f174e/src/MatrixClient.ts (L2005)
4fb43f174e/src/MatrixClient.ts (L1201)
maybe it just works on some servers?
This commit is contained in:
parent
d134faa17e
commit
6f7ddbbc9e
1 changed files with 2 additions and 1 deletions
|
@ -226,11 +226,12 @@ class AppService:
|
|||
self.logger.debug("sent message %s to %s as %s : %s", text, room, mxid, doc)
|
||||
return doc["event_id"]
|
||||
|
||||
async def ack_event(self, room: str, event: str) -> None:
|
||||
async def ack_event(self, room: str, event: str, mxid: str | None = None) -> None:
|
||||
async with self._client.request(
|
||||
method="POST",
|
||||
url=f"{self.client_api}/rooms/{room}/receipt/m.read/{event}",
|
||||
headers=self.api_headers,
|
||||
params={"user_id": mxid} if mxid else {},
|
||||
) as res:
|
||||
res.raise_for_status()
|
||||
|
||||
|
|
Loading…
Reference in a new issue