summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-07-26 16:46:53 +0100
committerRichard van der Hoff <richard@matrix.org>2016-07-26 16:46:53 +0100
commiteb359eced44407b1ee9648f10fdf3df63c8d40ad (patch)
treed2067b5f2fbfcc69f7303c3fa567082a5d9469b6 /synapse/handlers/_base.py
parentFix typo (diff)
downloadsynapse-eb359eced44407b1ee9648f10fdf3df63c8d40ad.tar.xz
Add `create_requester` function
Wrap the `Requester` constructor with a function which provides sensible
defaults, and use it throughout
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 6264aa0d9a..11081a0cd5 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -13,14 +13,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import logging
+
 from twisted.internet import defer
 
-from synapse.api.errors import LimitExceededError
+import synapse.types
 from synapse.api.constants import Membership, EventTypes
-from synapse.types import UserID, Requester
-
-
-import logging
+from synapse.api.errors import LimitExceededError
+from synapse.types import UserID
 
 
 logger = logging.getLogger(__name__)
@@ -124,7 +124,8 @@ class BaseHandler(object):
                 # and having homeservers have their own users leave keeps more
                 # of that decision-making and control local to the guest-having
                 # homeserver.
-                requester = Requester(target_user, "", True)
+                requester = synapse.types.create_requester(
+                    target_user, is_guest=True)
                 handler = self.hs.get_handlers().room_member_handler
                 yield handler.update_membership(
                     requester,