diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2021-11-19 15:09:46 +0000 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2021-11-19 15:09:46 +0000 |
commit | f65846b55b24fe98bf99ba5ee0e7a6acd828a35f (patch) | |
tree | bd4343cc8fda25839ff1bc523d5f7f48e0669566 | |
parent | Changelog (diff) | |
download | synapse-f65846b55b24fe98bf99ba5ee0e7a6acd828a35f.tar.xz |
Make msc2409_to_device_messages_enabled private; remove unnecessary check
The second check for self._msc2409_to_device_messages_enabled was not necessary. It's already checked in notify_interested_services_ephemeral earlier.
-rw-r--r-- | synapse/handlers/appservice.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py index 8994313a3e..8d5658f114 100644 --- a/synapse/handlers/appservice.py +++ b/synapse/handlers/appservice.py @@ -55,7 +55,7 @@ class ApplicationServicesHandler: self.clock = hs.get_clock() self.notify_appservices = hs.config.appservice.notify_appservices self.event_sources = hs.get_event_sources() - self.msc2409_to_device_messages_enabled = ( + self._msc2409_to_device_messages_enabled = ( hs.config.experimental.msc2409_to_device_messages_enabled ) @@ -236,7 +236,7 @@ class ApplicationServicesHandler: # Ignore to-device messages if the feature flag is not enabled if ( stream_key == "to_device_key" - and not self.msc2409_to_device_messages_enabled + and not self._msc2409_to_device_messages_enabled ): return @@ -314,10 +314,7 @@ class ApplicationServicesHandler: service, "presence", new_token ) - elif ( - stream_key == "to_device_key" - and self.msc2409_to_device_messages_enabled - ): + elif stream_key == "to_device_key": # Retrieve an iterable of to-device message events, as well as the # maximum stream token of the messages we were able to retrieve. events = await self._handle_to_device(service, new_token, users) |