diff --git a/synapse/events/spamcheck.py b/synapse/events/spamcheck.py
index 593ca70e92..f3322af499 100644
--- a/synapse/events/spamcheck.py
+++ b/synapse/events/spamcheck.py
@@ -65,7 +65,7 @@ class SpamChecker:
async def user_may_invite(
self,
inviter_userid: str,
- invitee_userid: str,
+ invitee_userid: Optional[str],
third_party_invite: Optional[Dict],
room_id: str,
new_room: bool,
@@ -104,7 +104,8 @@ class SpamChecker:
new_room,
published_room,
)
- ) is False
+ )
+ is False
):
return False
@@ -139,7 +140,8 @@ class SpamChecker:
spam_checker.user_may_create_room(
userid, invite_list, third_party_invite_list, cloning
)
- ) is False
+ )
+ is False
):
return False
diff --git a/synapse/server.py b/synapse/server.py
index 2574f6786e..bd8ee0e34a 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -365,26 +365,6 @@ class HomeServer(metaclass=abc.ABCMeta):
def get_proxied_blacklisted_http_client(self) -> SimpleHttpClient:
"""
An HTTP client that uses configured HTTP(S) proxies and blacklists IPs
- based on the IP range blacklist.
- """
- return SimpleHttpClient(
- self, ip_blacklist=self.config.ip_range_blacklist, use_proxy=True,
- )
-
- @cache_in_self
- def get_federation_http_client(self) -> MatrixFederationHttpClient:
- """
- An HTTP client for federation.
- """
- tls_client_options_factory = context_factory.FederationPolicyForHTTPS(
- self.config
- )
- return MatrixFederationHttpClient(self, tls_client_options_factory)
-
- @cache_in_self
- def get_proxied_blacklisted_http_client(self) -> SimpleHttpClient:
- """
- An HTTP client that uses configured HTTP(S) proxies and blacklists IPs
based on the IP range blacklist/whitelist.
"""
return SimpleHttpClient(
diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index 0535592b60..9c39b140a1 100644
--- a/tests/handlers/test_register.py
+++ b/tests/handlers/test_register.py
@@ -580,7 +580,9 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
# Mock Synapse's http json post method to check for the internal bind call
post_json_get_json = Mock(return_value=make_awaitable(None))
- self.hs.get_identity_handler().http_client.post_json_get_json = post_json_get_json
+ self.hs.get_identity_handler().http_client.post_json_get_json = (
+ post_json_get_json
+ )
# Retrieve a UIA session ID
channel = self.uia_register(
|