diff options
author | mathieui <mathieui@mathieui.net> | 2021-03-14 22:31:22 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-02 17:44:36 +0200 |
commit | 4b198be9771594a28824cc082e737fe15ab681ec (patch) | |
tree | 01de648647136734d176ba0fa33e96a61bbafc88 /poezio/contact.py | |
parent | bc4f4f1e0766aedb6b0e9f3df90fee9ea841786c (diff) | |
download | poezio-4b198be9771594a28824cc082e737fe15ab681ec.tar.gz poezio-4b198be9771594a28824cc082e737fe15ab681ec.tar.bz2 poezio-4b198be9771594a28824cc082e737fe15ab681ec.tar.xz poezio-4b198be9771594a28824cc082e737fe15ab681ec.zip |
fix: tons of type errors
Diffstat (limited to 'poezio/contact.py')
-rw-r--r-- | poezio/contact.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/poezio/contact.py b/poezio/contact.py index 063405c9..8359e031 100644 --- a/poezio/contact.py +++ b/poezio/contact.py @@ -45,15 +45,18 @@ class Resource: @property def priority(self) -> int: - return self._data.get('priority') or 0 + try: + return int(self._data.get('priority', 0)) + except Exception: + return 0 @property def presence(self) -> str: - return self._data.get('show') or '' + return str(self._data.get('show')) or '' @property def status(self) -> str: - return self._data.get('status') or '' + return str(self._data.get('status')) or '' def __repr__(self) -> str: return '<%s>' % self._jid |