Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d3f8213

Browse files
committed
Replace startswith by in
1 parent e226ee3 commit d3f8213

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

synapse/rest/client/v1/pusher.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ async def on_POST(self, request):
110110

111111
# rewrite push url from m.org sygnal to Tchap sygnal
112112
good_sygnal_url = None
113-
if (
114-
content["app_id"].startswith("fr.gouv.btchap")
115-
or content["app_id"].startswith("fr.gouv.rie.tchap")
116-
):
113+
app_id = content["app_id"]
114+
if "fr.gouv.btchap" in app_id or "fr.gouv.rie.tchap" in app_id:
117115
good_sygnal_url = "https://sygnal.preprod.tchap.gouv.fr"
118-
elif content["app_id"].startswith("fr.gouv.tchap"):
116+
elif app_id.startswith("fr.gouv.tchap"):
119117
good_sygnal_url = "https://sygnal.tchap.gouv.fr"
120118

121119
if good_sygnal_url:
122120
parsed_data = json_decoder.decode(content["data"])
123-
parsed_data["url"] = parsed_data["url"].replace("https://matrix.org", good_sygnal_url)
121+
parsed_data["url"] = parsed_data["url"].replace(
122+
"https://matrix.org", good_sygnal_url
123+
)
124124
content["data"] = json_encoder.encode(parsed_data)
125125

126126
append = False

0 commit comments

Comments
 (0)