From 11728561f39816cd754d5d51b8deaf72754d479f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 10 Jul 2018 15:21:14 +0100 Subject: [PATCH] improve domain matches --- synapse/rest/client/v2_alpha/register.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index b4b598a789..97e4891f3f 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -423,9 +423,9 @@ class RegisterRestServlet(RestServlet): parts = address.replace('.', ' ').split('@') org_parts = parts[1].split(' ') - if org_parts[0] == "matrix" and org_parts[1] == "org": + if org_parts[-2] == "matrix" and org_parts[-1] == "org": org = "Tchap Admin" - elif org_parts[-2] == "gouv": + elif org_parts[-2] == "gouv" and org_parts[-1] == "fr": org = org_parts[-3] if len(org_parts) > 2 else org_parts[-2] else: org = org_parts[-2]