@@ -739,22 +739,20 @@ async def _handle_received_pdu(self, origin: str, pdu: EventBase) -> None:
739739
740740 await self .handler .on_receive_pdu (origin , pdu , sent_to_us_directly = True )
741741
742- def __str__ (self ):
742+ def __str__ (self ) -> str :
743743 return "<ReplicationLayer(%s)>" % self .server_name
744744
745745 async def exchange_third_party_invite (
746746 self , sender_user_id : str , target_user_id : str , room_id : str , signed : Dict
747- ):
748- ret = await self .handler .exchange_third_party_invite (
747+ ) -> None :
748+ await self .handler .exchange_third_party_invite (
749749 sender_user_id , target_user_id , room_id , signed
750750 )
751- return ret
752751
753- async def on_exchange_third_party_invite_request (self , event_dict : Dict ):
754- ret = await self .handler .on_exchange_third_party_invite_request (event_dict )
755- return ret
752+ async def on_exchange_third_party_invite_request (self , event_dict : Dict ) -> None :
753+ await self .handler .on_exchange_third_party_invite_request (event_dict )
756754
757- async def check_server_matches_acl (self , server_name : str , room_id : str ):
755+ async def check_server_matches_acl (self , server_name : str , room_id : str ) -> None :
758756 """Check if the given server is allowed by the server ACLs in the room
759757
760758 Args:
@@ -878,7 +876,7 @@ def __init__(self, hs: "HomeServer"):
878876
879877 def register_edu_handler (
880878 self , edu_type : str , handler : Callable [[str , JsonDict ], Awaitable [None ]]
881- ):
879+ ) -> None :
882880 """Sets the handler callable that will be used to handle an incoming
883881 federation EDU of the given type.
884882
@@ -897,7 +895,7 @@ def register_edu_handler(
897895
898896 def register_query_handler (
899897 self , query_type : str , handler : Callable [[dict ], Awaitable [JsonDict ]]
900- ):
898+ ) -> None :
901899 """Sets the handler callable that will be used to handle an incoming
902900 federation query of the given type.
903901
@@ -915,15 +913,17 @@ def register_query_handler(
915913
916914 self .query_handlers [query_type ] = handler
917915
918- def register_instance_for_edu (self , edu_type : str , instance_name : str ):
916+ def register_instance_for_edu (self , edu_type : str , instance_name : str ) -> None :
919917 """Register that the EDU handler is on a different instance than master."""
920918 self ._edu_type_to_instance [edu_type ] = [instance_name ]
921919
922- def register_instances_for_edu (self , edu_type : str , instance_names : List [str ]):
920+ def register_instances_for_edu (
921+ self , edu_type : str , instance_names : List [str ]
922+ ) -> None :
923923 """Register that the EDU handler is on multiple instances."""
924924 self ._edu_type_to_instance [edu_type ] = instance_names
925925
926- async def on_edu (self , edu_type : str , origin : str , content : dict ):
926+ async def on_edu (self , edu_type : str , origin : str , content : dict ) -> None :
927927 if not self .config .use_presence and edu_type == EduTypes .Presence :
928928 return
929929
0 commit comments