mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-04 09:04:10 -04:00
Merge remote-tracking branch 'origin/develop' into dbkr/msisdn_signin
This commit is contained in:
commit
3557cf34dc
41 changed files with 817 additions and 194 deletions
|
@ -87,9 +87,17 @@ class HttpTransactionCache(object):
|
|||
|
||||
deferred = fn(*args, **kwargs)
|
||||
|
||||
# We don't add an errback to the raw deferred, so we ask ObservableDeferred
|
||||
# to swallow the error. This is fine as the error will still be reported
|
||||
# to the observers.
|
||||
# if the request fails with a Twisted failure, remove it
|
||||
# from the transaction map. This is done to ensure that we don't
|
||||
# cache transient errors like rate-limiting errors, etc.
|
||||
def remove_from_map(err):
|
||||
self.transactions.pop(txn_key, None)
|
||||
return err
|
||||
deferred.addErrback(remove_from_map)
|
||||
|
||||
# We don't add any other errbacks to the raw deferred, so we ask
|
||||
# ObservableDeferred to swallow the error. This is fine as the error will
|
||||
# still be reported to the observers.
|
||||
observable = ObservableDeferred(deferred, consumeErrors=True)
|
||||
self.transactions[txn_key] = (observable, self.clock.time_msec())
|
||||
return observable.observe()
|
||||
|
|
|
@ -505,7 +505,6 @@ class RoomEventContext(ClientV1RestServlet):
|
|||
room_id,
|
||||
event_id,
|
||||
limit,
|
||||
requester.is_guest,
|
||||
)
|
||||
|
||||
if not results:
|
||||
|
@ -609,6 +608,10 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
|
|||
raise SynapseError(400, "Missing user_id key.")
|
||||
target = UserID.from_string(content["user_id"])
|
||||
|
||||
event_content = None
|
||||
if 'reason' in content and membership_action in ['kick', 'ban']:
|
||||
event_content = {'reason': content['reason']}
|
||||
|
||||
yield self.handlers.room_member_handler.update_membership(
|
||||
requester=requester,
|
||||
target=target,
|
||||
|
@ -616,6 +619,7 @@ class RoomMembershipRestServlet(ClientV1RestServlet):
|
|||
action=membership_action,
|
||||
txn_id=txn_id,
|
||||
third_party_signed=content.get("third_party_signed", None),
|
||||
content=event_content,
|
||||
)
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
|
|
@ -240,6 +240,9 @@ class MediaRepository(object):
|
|||
if t_method == "crop":
|
||||
t_len = thumbnailer.crop(t_path, t_width, t_height, t_type)
|
||||
elif t_method == "scale":
|
||||
t_width, t_height = thumbnailer.aspect(t_width, t_height)
|
||||
t_width = min(m_width, t_width)
|
||||
t_height = min(m_height, t_height)
|
||||
t_len = thumbnailer.scale(t_path, t_width, t_height, t_type)
|
||||
else:
|
||||
t_len = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue