Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2019-11-13 17:55:35 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-11-13 17:55:35 +0300
commitf35c67ebd2b14bc7a3cacd3972ce34d779eea344 (patch)
tree7ce4ae5b8ce102b6d1bfbe04645705c1de69ac1b /gajim/common/modules/httpupload.py
parent0e8931976dcc3f9245ea91ea91e0f3702164aa78 (diff)
Increase usage of EventHelper
Diffstat (limited to 'gajim/common/modules/httpupload.py')
-rw-r--r--gajim/common/modules/httpupload.py21
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: