mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 04:44:56 -04:00
Re-implement unread counts (#7736)
This commit is contained in:
parent
2184f61fae
commit
8dff4a1242
11 changed files with 339 additions and 18 deletions
|
@ -143,6 +143,26 @@ class RestHelper(object):
|
|||
|
||||
return channel.json_body
|
||||
|
||||
def redact(self, room_id, event_id, txn_id=None, tok=None, expect_code=200):
|
||||
if txn_id is None:
|
||||
txn_id = "m%s" % (str(time.time()))
|
||||
|
||||
path = "/_matrix/client/r0/rooms/%s/redact/%s/%s" % (room_id, event_id, txn_id)
|
||||
if tok:
|
||||
path = path + "?access_token=%s" % tok
|
||||
|
||||
request, channel = make_request(
|
||||
self.hs.get_reactor(), "PUT", path, json.dumps({}).encode("utf8")
|
||||
)
|
||||
render(request, self.resource, self.hs.get_reactor())
|
||||
|
||||
assert int(channel.result["code"]) == expect_code, (
|
||||
"Expected: %d, got: %d, resp: %r"
|
||||
% (expect_code, int(channel.result["code"]), channel.result["body"])
|
||||
)
|
||||
|
||||
return channel.json_body
|
||||
|
||||
def _read_write_state(
|
||||
self,
|
||||
room_id: str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue