mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Replace hs.parse_userid with UserID.from_string
This commit is contained in:
parent
7dfd99f163
commit
5759bec43c
31 changed files with 145 additions and 133 deletions
|
@ -20,6 +20,7 @@ from base import RestServlet, client_path_pattern
|
|||
from synapse.api.errors import SynapseError, Codes
|
||||
from synapse.streams.config import PaginationConfig
|
||||
from synapse.api.constants import EventTypes, Membership
|
||||
from synapse.types import UserID
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
@ -289,7 +290,7 @@ class RoomMemberListRestServlet(RestServlet):
|
|||
|
||||
for event in members["chunk"]:
|
||||
# FIXME: should probably be state_key here, not user_id
|
||||
target_user = self.hs.parse_userid(event["user_id"])
|
||||
target_user = UserID.from_string(event["user_id"])
|
||||
# Presence is an optional cache; don't fail if we can't fetch it
|
||||
try:
|
||||
presence_handler = self.handlers.presence_handler
|
||||
|
@ -478,7 +479,7 @@ class RoomTypingRestServlet(RestServlet):
|
|||
auth_user = yield self.auth.get_user_by_req(request)
|
||||
|
||||
room_id = urllib.unquote(room_id)
|
||||
target_user = self.hs.parse_userid(urllib.unquote(user_id))
|
||||
target_user = UserID.from_string(urllib.unquote(user_id))
|
||||
|
||||
content = _parse_json(request)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue