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:
əlemi 2024-02-03 17:12:54 +01:00
parent d134faa17e
commit 6f7ddbbc9e
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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()