diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2015-04-27 17:09:25 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2015-04-27 17:09:25 +0100 |
commit | 38432d8c253fda453cd645491f46ef37714c4f7c (patch) | |
tree | 76d9f0dee077b01038a939f611fbcb4b89aea496 /synapse/rest | |
parent | Also remember to check 'invite' level for changes (diff) | |
parent | Merge pull request #132 from matrix-org/observer_and_locks (diff) | |
download | synapse-38432d8c253fda453cd645491f46ef37714c4f7c.tar.xz |
Merge branch 'develop' into invite_power_level
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/media/v1/base_resource.py | 4 | ||||
-rw-r--r-- | synapse/rest/media/v1/identicon_resource.py | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/base_resource.py b/synapse/rest/media/v1/base_resource.py index edd4f78024..08c8d75af4 100644 --- a/synapse/rest/media/v1/base_resource.py +++ b/synapse/rest/media/v1/base_resource.py @@ -25,6 +25,8 @@ from twisted.internet import defer from twisted.web.resource import Resource from twisted.protocols.basic import FileSender +from synapse.util.async import create_observer + import os import logging @@ -87,7 +89,7 @@ class BaseMediaResource(Resource): def callback(media_info): del self.downloads[key] return media_info - return download + return create_observer(download) @defer.inlineCallbacks def _get_remote_media_impl(self, server_name, media_id): diff --git a/synapse/rest/media/v1/identicon_resource.py b/synapse/rest/media/v1/identicon_resource.py index 912856386a..603859d5d4 100644 --- a/synapse/rest/media/v1/identicon_resource.py +++ b/synapse/rest/media/v1/identicon_resource.py @@ -1,3 +1,17 @@ +# Copyright 2015 OpenMarket Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from pydenticon import Generator from twisted.web.resource import Resource |