diff options
author | Philipp Hörist <philipp@hoerist.com> | 2019-11-13 17:55:35 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2019-11-13 17:55:35 +0300 |
commit | f35c67ebd2b14bc7a3cacd3972ce34d779eea344 (patch) | |
tree | 7ce4ae5b8ce102b6d1bfbe04645705c1de69ac1b /gajim/common/modules/httpupload.py | |
parent | 0e8931976dcc3f9245ea91ea91e0f3702164aa78 (diff) |
Increase usage of EventHelper
Diffstat (limited to 'gajim/common/modules/httpupload.py')
-rw-r--r-- | gajim/common/modules/httpupload.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/gajim/common/modules/httpupload.py b/gajim/common/modules/httpupload.py index 99b8151fe..e5a82baa7 100644 --- a/gajim/common/modules/httpupload.py +++ b/gajim/common/modules/httpupload.py @@ -53,23 +53,14 @@ class HTTPUpload(BaseModule): self.httpupload_namespace = None self._allowed_headers = ['Authorization', 'Cookie', 'Expires'] self.max_file_size = None # maximum file size in bytes - - app.ged.register_event_handler('stanza-message-outgoing', - ged.OUT_PREGUI, - self.handle_outgoing_stanza) - app.ged.register_event_handler('gc-stanza-message-outgoing', - ged.OUT_PREGUI, - self.handle_outgoing_stanza) - self.messages = [] - def cleanup(self): - app.ged.remove_event_handler('stanza-message-outgoing', - ged.OUT_PREGUI, - self.handle_outgoing_stanza) - app.ged.remove_event_handler('gc-stanza-message-outgoing', - ged.OUT_PREGUI, - self.handle_outgoing_stanza) + # pylint: disable=line-too-long + self.register_events([ + ('stanza-message-outgoing', ged.OUT_PREGUI, self.handle_outgoing_stanza), + ('gc-stanza-message-outgoing', ged.OUT_PREGUI, self.handle_outgoing_stanza), + ]) + # pylint: enable=line-too-long def pass_disco(self, info): if NS_HTTPUPLOAD_0 in info.features: |