summaryrefslogtreecommitdiff
path: root/src/roster.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-09-23 20:28:09 +0200
committermathieui <mathieui@mathieui.net>2015-09-23 20:29:56 +0200
commit99d5e25f9bb9a6cbe51973d8409691ad8e5482a1 (patch)
tree7e1d986fc532a91940570eac349ff861b4152f28 /src/roster.py
parent06217c4a0cde140eed1ca92aa8903890206451bc (diff)
downloadpoezio-99d5e25f9bb9a6cbe51973d8409691ad8e5482a1.tar.gz
poezio-99d5e25f9bb9a6cbe51973d8409691ad8e5482a1.tar.bz2
poezio-99d5e25f9bb9a6cbe51973d8409691ad8e5482a1.tar.xz
poezio-99d5e25f9bb9a6cbe51973d8409691ad8e5482a1.zip
Fix various roster count issues
disconnections not clearing the number of connected contacts, leading to an ever-increasing count, and roster count not always being setup
Diffstat (limited to 'src/roster.py')
-rw-r--r--src/roster.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/roster.py b/src/roster.py
index 7866655f..ba7da63e 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -149,9 +149,14 @@ class Roster(object):
contact = self.get_and_set(key)
if key != self.jid and (contact and self.exists(contact)):
l.append(key)
- self.length = len(l)
+ self.update_size(l)
return l
+ def update_size(self, jids=None):
+ if jids is None:
+ jids = self.jids()
+ self.length = len(jids)
+
def get_contacts(self):
"""
Return a list of all the contacts