diff options
author | wurstsalat <mailtrash@posteo.de> | 2022-10-06 18:20:49 +0300 |
---|---|---|
committer | wurstsalat <mailtrash@posteo.de> | 2022-10-06 18:20:49 +0300 |
commit | da2046d4bb721179bdb1bda04fb9af07cbd786d4 (patch) | |
tree | 68cd19c8610bc60ca2786337ff6f3f277897fec7 | |
parent | 29260fcc6f6eddc17efa3f24f376e5130b9f96c2 (diff) |
[omemo] 2.8.17
-rw-r--r-- | omemo/gtk/config.py | 2 | ||||
-rw-r--r-- | omemo/modules/omemo.py | 23 | ||||
-rw-r--r-- | omemo/plugin-manifest.json | 2 | ||||
-rw-r--r-- | omemo/plugin.py | 11 |
4 files changed, 19 insertions, 19 deletions
diff --git a/omemo/gtk/config.py b/omemo/gtk/config.py index 7336c4c..5543c35 100644 --- a/omemo/gtk/config.py +++ b/omemo/gtk/config.py @@ -137,7 +137,7 @@ class OMEMOConfigDialog(Gtk.ApplicationWindow): def cleardevice_button_clicked_cb(self, button, *args): active = self._ui.account_combobox.get_active() account = self._ui.account_store[active][0] - app.connections[account].get_module('OMEMO').clear_devicelist() + app.get_client(account).get_module('OMEMO').clear_devicelist() self.update_context_list() def refresh_button_clicked_cb(self, button, *args): diff --git a/omemo/modules/omemo.py b/omemo/modules/omemo.py index 6c90e58..548d4af 100644 --- a/omemo/modules/omemo.py +++ b/omemo/modules/omemo.py @@ -85,8 +85,8 @@ class OMEMO(BaseModule): 'request_bundle', ] - def __init__(self, con): - BaseModule.__init__(self, con, plugin=True) + def __init__(self, client): + BaseModule.__init__(self, client, plugin=True) self.handlers = [ StanzaHandler(name='message', @@ -103,7 +103,7 @@ class OMEMO(BaseModule): self.available = True - self._own_jid = self._con.get_own_jid().bare + self._own_jid = self._client.get_own_jid().bare self._backend = self._get_backend() self._omemo_groupchats = set() @@ -114,8 +114,8 @@ class OMEMO(BaseModule): def get_own_jid(self, stripped=False): if stripped: - return self._con.get_own_jid().bare - return self._con.get_own_jid() + return self._client.get_own_jid().bare + return self._client.get_own_jid() @property def backend(self): @@ -138,7 +138,7 @@ class OMEMO(BaseModule): def activate(self): """ Method called when the Plugin is activated in the PluginManager """ - self._con.get_module('Caps').update_caps() + self._client.get_module('Caps').update_caps() if app.account_is_connected(self._account): self._log.info('Announce Support after Plugin Activation') @@ -190,7 +190,7 @@ class OMEMO(BaseModule): transport_message = get_key_transport_message(typ, jid, omemo_message) self._log.info('Send key transport message %s (%s)', jid, devices) - self._con.connection.send(transport_message) + self._client.connection.send(transport_message) def _message_received(self, _con, stanza, properties): if not properties.is_omemo: @@ -259,7 +259,8 @@ class OMEMO(BaseModule): # History Message from MUC return properties.muc_ofrom.bare - contact = self._con.get_module('Contacts').get_contact(properties.jid) + contact = self._client.get_module('Contacts').get_contact( + properties.jid) if contact.real_jid is not None: return contact.real_jid.bare @@ -336,11 +337,11 @@ class OMEMO(BaseModule): if jid == self._own_jid: return True - roster_item = self._con.get_module('Roster').get_item(jid) + roster_item = self._client.get_module('Roster').get_item(jid) if roster_item is None: return False - contact = self._con.get_module('Contacts').get_contact(jid) + contact = self._client.get_module('Contacts').get_contact(jid) return contact.subscription == 'both' def on_muc_disco_update(self, event): @@ -484,7 +485,7 @@ class OMEMO(BaseModule): self._process_devicelist_update(str(properties.jid), devicelist) def _process_devicelist_update(self, jid, devicelist): - own_devices = jid is None or self._con.get_own_jid().bare_match(jid) + own_devices = jid is None or self._client.get_own_jid().bare_match(jid) if own_devices: jid = self._own_jid diff --git a/omemo/plugin-manifest.json b/omemo/plugin-manifest.json index 3be3fc6..f3d65e3 100644 --- a/omemo/plugin-manifest.json +++ b/omemo/plugin-manifest.json @@ -18,5 +18,5 @@ "gajim>=1.5.0" ], "short_name": "omemo", - "version": "2.8.16" + "version": "2.8.17" }
\ No newline at end of file diff --git a/omemo/plugin.py b/omemo/plugin.py index 7a43613..29d28cc 100644 --- a/omemo/plugin.py +++ b/omemo/plugin.py @@ -135,7 +135,7 @@ class OmemoPlugin(GajimPlugin): @staticmethod def get_omemo(account): - return app.connections[account].get_module('OMEMO') + return app.get_client(account).get_module('OMEMO') @staticmethod def _load_css(): @@ -159,7 +159,7 @@ class OmemoPlugin(GajimPlugin): """ Method called when the Plugin is activated in the PluginManager """ - for account in app.connections: + for account in app.settings.get_active_accounts(): if not self._is_enabled_account(account): continue self.get_omemo(account).activate() @@ -168,16 +168,15 @@ class OmemoPlugin(GajimPlugin): """ Method called when the Plugin is deactivated in the PluginManager """ - for account in app.connections: + for account in app.settings.get_active_accounts(): if not self._is_enabled_account(account): continue self.get_omemo(account).deactivate() def _on_signed_in(self, event): - account = event.conn.name - if not self._is_enabled_account(account): + if not self._is_enabled_account(event.account): return - self.get_omemo(account).on_signed_in() + self.get_omemo(event.account).on_signed_in() def _on_muc_disco_update(self, event): if not self._is_enabled_account(event.account): |