don't update roster, on each getRoster request
This commit is contained in:
parent
661d0d6550
commit
f2f911c91e
1 changed files with 5 additions and 3 deletions
|
@ -2,7 +2,7 @@ from common.zeroconf import zeroconf
|
||||||
|
|
||||||
class Roster:
|
class Roster:
|
||||||
def __init__(self, zeroconf):
|
def __init__(self, zeroconf):
|
||||||
self._data = {}
|
self._data = None
|
||||||
self.zeroconf = zeroconf # our zeroconf instance
|
self.zeroconf = zeroconf # our zeroconf instance
|
||||||
|
|
||||||
def update_roster(self):
|
def update_roster(self):
|
||||||
|
@ -11,7 +11,9 @@ class Roster:
|
||||||
|
|
||||||
def getRoster(self):
|
def getRoster(self):
|
||||||
#print 'roster_zeroconf.py: getRoster'
|
#print 'roster_zeroconf.py: getRoster'
|
||||||
self.update_roster()
|
if self._data is None:
|
||||||
|
self._data = {}
|
||||||
|
self.update_roster()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def getDiffs(self):
|
def getDiffs(self):
|
||||||
|
@ -25,7 +27,7 @@ class Roster:
|
||||||
if self._data.has_key(key):
|
if self._data.has_key(key):
|
||||||
if old_data[key] != self._data[key]:
|
if old_data[key] != self._data[key]:
|
||||||
diffs[key] = self._data[key]['status']
|
diffs[key] = self._data[key]['status']
|
||||||
#print 'roster_zeroconf.py: diffs:' + diffs
|
#print 'roster_zeroconf.py: diffs:' + str(diffs)
|
||||||
return diffs
|
return diffs
|
||||||
|
|
||||||
def setItem(self, jid, name = '', groups = ''):
|
def setItem(self, jid, name = '', groups = ''):
|
||||||
|
|
Loading…
Add table
Reference in a new issue