summaryrefslogtreecommitdiff
path: root/poezio/contact.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-03-14 22:31:22 +0100
committermathieui <mathieui@mathieui.net>2021-04-02 17:44:36 +0200
commit4b198be9771594a28824cc082e737fe15ab681ec (patch)
tree01de648647136734d176ba0fa33e96a61bbafc88 /poezio/contact.py
parentbc4f4f1e0766aedb6b0e9f3df90fee9ea841786c (diff)
downloadpoezio-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.py9
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