Add option to allow anyone to use timestamp massaging

This commit is contained in:
Tulir Asokan 2021-01-06 14:44:28 +02:00
parent 39fa6cc01d
commit f279a43dc8
3 changed files with 15 additions and 3 deletions

View file

@ -213,6 +213,7 @@ class RoomSendEventRestServlet(TransactionRestServlet):
super().__init__(hs)
self.event_creation_handler = hs.get_event_creation_handler()
self.auth = hs.get_auth()
self.hs = hs
def register(self, http_server):
# /rooms/$roomid/send/$event_type[/$txn_id]
@ -230,8 +231,10 @@ class RoomSendEventRestServlet(TransactionRestServlet):
"sender": requester.user.to_string(),
}
if b"ts" in request.args and requester.app_service:
event_dict["origin_server_ts"] = parse_integer(request, "ts", 0)
if b"ts" in request.args:
if (requester.app_service
or requester.user.to_string() in self.hs.config.meow.timestamp_override):
event_dict["origin_server_ts"] = parse_integer(request, "ts", 0)
try:
(