Skip to content

Commit

Permalink
Fix fallback value for account_threepid_delegates.email (matrix-org#7316
Browse files Browse the repository at this point in the history
)
  • Loading branch information
anoadragon453 authored and phil-flex committed Jun 16, 2020
1 parent 67b4ea1 commit 5cc6e18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/7316.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed backwards compatibility logic of the first value of `trusted_third_party_id_servers` being used for `account_threepid_delegates.email`, which occurs when the former, deprecated option is set and the latter is not.
11 changes: 8 additions & 3 deletions synapse/config/emailconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ def read_config(self, config, **kwargs):
if self.trusted_third_party_id_servers:
# XXX: It's a little confusing that account_threepid_delegate_email is modified
# both in RegistrationConfig and here. We should factor this bit out
self.account_threepid_delegate_email = self.trusted_third_party_id_servers[
0
] # type: Optional[str]

first_trusted_identity_server = self.trusted_third_party_id_servers[0]

# trusted_third_party_id_servers does not contain a scheme whereas
# account_threepid_delegate_email is expected to. Presume https
self.account_threepid_delegate_email = (
"https://" + first_trusted_identity_server
) # type: Optional[str]
self.using_identity_server_from_trusted_list = True
else:
raise ConfigError(
Expand Down

0 comments on commit 5cc6e18

Please sign in to comment.