Skip to content

Commit 1010ef4

Browse files
Update set_profile_displayname to use UserID type
This is required as the function was updated to take this explicit type, rather than just the localpart, in matrix-org/synapse#15458 as part of version 1.83. This is stacked atop ma1uta#10 to ensure everything is updated.
1 parent b6bdebb commit 1010ef4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rest_auth_provider.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import time
2727
import synapse
2828
from synapse import module_api
29+
from synapse.types import UserID
2930

3031
logger = logging.getLogger(__name__)
3132

@@ -91,7 +92,9 @@ async def check_password(self, user_id, password):
9192
logger.info("User not authenticated")
9293
return False
9394

95+
types_user_id = UserID.from_string(user_id)
9496
localpart = user_id.split(":", 1)[0][1:]
97+
domain = user_id.split(":", 1)[1][1:]
9598
logger.info("User %s authenticated", user_id)
9699

97100
registration = False
@@ -117,7 +120,7 @@ async def check_password(self, user_id, password):
117120
if "display_name" in profile and ((registration and self.config.setNameOnRegister) or (self.config.setNameOnLogin)):
118121
display_name = profile["display_name"]
119122
logger.info("Setting display name to '%s' based on profile data", display_name)
120-
await store.set_profile_displayname(localpart, display_name)
123+
await store.set_profile_displayname(types_user_id, display_name)
121124
else:
122125
logger.info("Display name was not set because it was not given or policy restricted it")
123126

0 commit comments

Comments
 (0)