summary refs log tree commit diff
path: root/synapse/rest/client/receipts.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-12-08 12:26:29 -0500
committerGitHub <noreply@github.com>2021-12-08 12:26:29 -0500
commitd93362d87fbbf4941da06ade65eaf5df1672bccb (patch)
treec357e1655faa4e6c286b0ed3493ffc69ae9a529c /synapse/rest/client/receipts.py
parentClean up `synapse.rest.admin` (#11535) (diff)
downloadsynapse-d93362d87fbbf4941da06ade65eaf5df1672bccb.tar.xz
Add a constant for receipt types (m.read). (#11531)
And expand some type hints in the receipts storage module.
Diffstat (limited to 'synapse/rest/client/receipts.py')
-rw-r--r--synapse/rest/client/receipts.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/client/receipts.py b/synapse/rest/client/receipts.py

index 2b25b9aad6..b24ad2d1be 100644 --- a/synapse/rest/client/receipts.py +++ b/synapse/rest/client/receipts.py
@@ -16,7 +16,7 @@ import logging import re from typing import TYPE_CHECKING, Tuple -from synapse.api.constants import ReadReceiptEventFields +from synapse.api.constants import ReadReceiptEventFields, ReceiptTypes from synapse.api.errors import Codes, SynapseError from synapse.http import get_request_user_agent from synapse.http.server import HttpServer @@ -53,7 +53,7 @@ class ReceiptRestServlet(RestServlet): ) -> Tuple[int, JsonDict]: requester = await self.auth.get_user_by_req(request) - if receipt_type != "m.read": + if receipt_type != ReceiptTypes.READ: raise SynapseError(400, "Receipt type must be 'm.read'") # Do not allow older SchildiChat and Element Android clients (prior to Element/1.[012].x) to send an empty body.