mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-14 16:25:29 -04:00
Merge remote-tracking branch 'upstream/release-v1.69'
This commit is contained in:
commit
4b94513ae4
191 changed files with 10356 additions and 2903 deletions
|
@ -49,6 +49,7 @@ class ReceiptRestServlet(RestServlet):
|
|||
ReceiptTypes.READ_PRIVATE,
|
||||
ReceiptTypes.FULLY_READ,
|
||||
}
|
||||
self._msc3771_enabled = hs.config.experimental.msc3771_enabled
|
||||
|
||||
async def on_POST(
|
||||
self, request: SynapseRequest, room_id: str, receipt_type: str, event_id: str
|
||||
|
@ -63,6 +64,16 @@ class ReceiptRestServlet(RestServlet):
|
|||
|
||||
body = parse_json_object_from_request(request, allow_empty_body=False)
|
||||
|
||||
# Pull the thread ID, if one exists.
|
||||
thread_id = None
|
||||
if self._msc3771_enabled:
|
||||
if "thread_id" in body:
|
||||
thread_id = body.get("thread_id")
|
||||
if not thread_id or not isinstance(thread_id, str):
|
||||
raise SynapseError(
|
||||
400, "thread_id field must be a non-empty string"
|
||||
)
|
||||
|
||||
await self.presence_handler.bump_presence_active_time(requester.user)
|
||||
|
||||
if receipt_type == ReceiptTypes.FULLY_READ:
|
||||
|
@ -78,6 +89,7 @@ class ReceiptRestServlet(RestServlet):
|
|||
receipt_type,
|
||||
user_id=requester.user.to_string(),
|
||||
event_id=event_id,
|
||||
thread_id=thread_id,
|
||||
extra_content=body,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue