diff options
-rw-r--r-- | anti_spam/modules/anti_spam.py | 2 | ||||
-rw-r--r-- | length_notifier/length_notifier.py | 4 | ||||
-rw-r--r-- | omemo/modules/omemo.py | 24 | ||||
-rw-r--r-- | openpgp/backend/pygpg.py | 2 | ||||
-rw-r--r-- | openpgp/modules/openpgp.py | 10 | ||||
-rw-r--r-- | pgp/backend/store.py | 2 | ||||
-rw-r--r-- | pgp/modules/pgp_legacy.py | 4 | ||||
-rw-r--r-- | tictactoe/plugin.py | 2 |
8 files changed, 25 insertions, 25 deletions
diff --git a/anti_spam/modules/anti_spam.py b/anti_spam/modules/anti_spam.py index 5453d32..f210db8 100644 --- a/anti_spam/modules/anti_spam.py +++ b/anti_spam/modules/anti_spam.py @@ -106,7 +106,7 @@ class AntiSpam(BaseModule): properties.is_mam_message): return False - msg_from = properties.jid if is_muc_pm else properties.jid.getBare() + msg_from = properties.jid if is_muc_pm else properties.jid.bare if msg_from in self._contacted_jids: return False diff --git a/length_notifier/length_notifier.py b/length_notifier/length_notifier.py index a7cc9ec..ae35266 100644 --- a/length_notifier/length_notifier.py +++ b/length_notifier/length_notifier.py @@ -98,8 +98,8 @@ class LengthNotifierPlugin(GajimPlugin): except Exception as error: log.debug('Error parsing JID: %s (%s)' % (error, allowed_jid)) continue - if address.isDomain: - if current_jid.getDomain() == address: + if address.is_domain: + if current_jid.domain == address: log.debug('Add counter for Domain %s' % address) return True if current_jid == address: diff --git a/omemo/modules/omemo.py b/omemo/modules/omemo.py index a755b91..320b469 100644 --- a/omemo/modules/omemo.py +++ b/omemo/modules/omemo.py @@ -103,7 +103,7 @@ class OMEMO(BaseModule): self.available = True - self._own_jid = self._con.get_own_jid().getStripped() + self._own_jid = self._con.get_own_jid().bare self._backend = self._get_backend() self._omemo_groupchats = set() @@ -114,7 +114,7 @@ class OMEMO(BaseModule): def get_own_jid(self, stripped=False): if stripped: - return self._con.get_own_jid().getStripped() + return self._con.get_own_jid().bare return self._con.get_own_jid() @property @@ -211,7 +211,7 @@ class OMEMO(BaseModule): from_jid = self._process_muc_message(properties) else: - from_jid = properties.jid.getBare() + from_jid = properties.jid.bare if from_jid is None: return @@ -259,15 +259,15 @@ class OMEMO(BaseModule): 'trust': GajimTrust[trust.name]}) def _process_muc_message(self, properties): - room_jid = properties.jid.getBare() - resource = properties.jid.getResource() + room_jid = properties.jid.bare + resource = properties.jid.resource() if properties.muc_ofrom is not None: # History Message from MUC - return properties.muc_ofrom.getBare() + return properties.muc_ofrom.bare contact = app.contacts.get_gc_contact(self._account, room_jid, resource) if contact is not None: - return JID(contact.jid).getBare() + return JID(contact.jid).bare self._log.info('Groupchat: Last resort trying to find SID in DB') from_jid = self.backend.storage.getJidFromDevice(properties.omemo.sid) @@ -284,8 +284,8 @@ class OMEMO(BaseModule): self._log.warning('Received MAM Message which can ' 'not be mapped to a real jid') return - return properties.muc_user.jid.getBare() - return properties.from_.getBare() + return properties.muc_user.jid.bare + return properties.from_.bare def _on_muc_user_presence(self, _con, _stanza, properties): if properties.type == PresenceType.ERROR: @@ -294,13 +294,13 @@ class OMEMO(BaseModule): if properties.is_muc_destroyed: return - room = properties.jid.getBare() + room = properties.jid.bare if properties.muc_user is None or properties.muc_user.jid is None: # No real jid found return - jid = properties.muc_user.jid.getBare() + jid = properties.muc_user.jid.bare if properties.muc_user.affiliation in (Affiliation.OUTCAST, Affiliation.NONE): self.backend.remove_muc_member(room, jid) @@ -486,7 +486,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().bareMatch(jid) + own_devices = jid is None or self._con.get_own_jid().bare_match(jid) if own_devices: jid = self._own_jid diff --git a/openpgp/backend/pygpg.py b/openpgp/backend/pygpg.py index 85d824c..e6850c1 100644 --- a/openpgp/backend/pygpg.py +++ b/openpgp/backend/pygpg.py @@ -35,7 +35,7 @@ class PythonGnuPG(gnupg.GPG): def __init__(self, jid, gnupghome): gnupg.GPG.__init__(self, gpgbinary='gpg', gnupghome=str(gnupghome)) - self._jid = jid.getBare() + self._jid = jid.bare self._own_fingerprint = None @staticmethod diff --git a/openpgp/modules/openpgp.py b/openpgp/modules/openpgp.py index 7a6a59c..5b530cd 100644 --- a/openpgp/modules/openpgp.py +++ b/openpgp/modules/openpgp.py @@ -86,7 +86,7 @@ class OpenPGP(BaseModule): self.own_jid = self._con.get_own_jid() - own_bare_jid = self.own_jid.getBare() + own_bare_jid = self.own_jid.bare path = Path(configpaths.get('MY_DATA')) / 'openpgp' / own_bare_jid if not path.exists(): path.mkdir(mode=0o700, parents=True) @@ -168,7 +168,7 @@ class OpenPGP(BaseModule): except (StanzaError, MalformedStanzaError) as error: log.error('%s => Keylist query failed: %s', self._account, error) - if self.own_jid.bareMatch(jid) and self._fingerprint is not None: + if self.own_jid.bare_match(jid) and self._fingerprint is not None: self.set_keylist() return @@ -180,11 +180,11 @@ class OpenPGP(BaseModule): log.warning('%s => Empty keylist received from %s', self._account, from_jid) self._contacts.process_keylist(self.own_jid, keylist) - if self.own_jid.bareMatch(from_jid) and self._fingerprint is not None: + if self.own_jid.bare_match(from_jid) and self._fingerprint is not None: self.set_keylist() return - if self.own_jid.bareMatch(from_jid): + if self.own_jid.bare_match(from_jid): log.info('Received own keylist') for key in keylist: log.info(key.fingerprint) @@ -226,7 +226,7 @@ class OpenPGP(BaseModule): log.warning(payload) return - if not any(map(self.own_jid.bareMatch, recipients)): + if not any(map(self.own_jid.bare_match, recipients)): log.warning('to attr not valid') log.warning(signcrypt) return diff --git a/pgp/backend/store.py b/pgp/backend/store.py index 822f53c..0a484ba 100644 --- a/pgp/backend/store.py +++ b/pgp/backend/store.py @@ -33,7 +33,7 @@ class KeyStore: self._log = log self._account = account - own_bare_jid = own_jid.getBare() + own_bare_jid = own_jid.bare path = Path(configpaths.get('PLUGINS_DATA')) / 'pgplegacy' / own_bare_jid if not path.exists(): path.mkdir(parents=True) diff --git a/pgp/modules/pgp_legacy.py b/pgp/modules/pgp_legacy.py index 8710ebc..4588e92 100644 --- a/pgp/modules/pgp_legacy.py +++ b/pgp/modules/pgp_legacy.py @@ -114,7 +114,7 @@ class PGPLegacy(BaseModule): def _on_presence_received(self, _con, _stanza, properties): if properties.signed is None: return - jid = properties.jid.getBare() + jid = properties.jid.bare fingerprint = self._pgp.verify(properties.status, properties.signed) if fingerprint is None: @@ -142,7 +142,7 @@ class PGPLegacy(BaseModule): if not properties.is_pgp_legacy or properties.from_muc: return - from_jid = properties.jid.getBare() + from_jid = properties.jid.bare self._log.info('Message received from: %s', from_jid) payload = self._pgp.decrypt(properties.pgp_legacy) diff --git a/tictactoe/plugin.py b/tictactoe/plugin.py index 066943f..112bb3e 100644 --- a/tictactoe/plugin.py +++ b/tictactoe/plugin.py @@ -254,7 +254,7 @@ class TicTacToeSession(): self.conn = conn self.jid = jid self.type_ = type_ - self.resource = jid.getResource() + self.resource = jid.resource() if thread_id: self.received_thread_id = True |