Skip to content

Commit

Permalink
papylib: lazy check for msn_objects when adding contacts to contact l…
Browse files Browse the repository at this point in the history
…ist. Closes #602 (hopefully)
  • Loading branch information
c10ud committed Jul 27, 2011
1 parent a8bc40a commit 8751ed8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions emesene/e3/papylib/Worker.py
Expand Up @@ -23,7 +23,7 @@
import sys
import time
import Queue
import gobject
import glib
import hashlib
import tempfile
import xml.sax.saxutils
Expand Down Expand Up @@ -118,7 +118,7 @@ def __init__(self, app_name, session, proxy, use_http=False):
def run(self):
'''main method, block waiting for data, process it, and send data back
'''
self._mainloop = gobject.MainLoop(is_running=True)
self._mainloop = glib.MainLoop(is_running=True)
while self._mainloop.is_running():
try:
action = self.session.actions.get(True, 0.1)
Expand Down Expand Up @@ -237,7 +237,15 @@ def _add_contact(self, papycontact):
if 'last' in avatars:
contact.picture = os.path.join(avatars.path, 'last')

glib.timeout_add_seconds(5, lambda *arg:
self._lazy_msnobj_checker(papycontact))

def _lazy_msnobj_checker(self, papycontact):
''' ugly hack because of https://github.com/emesene/emesene/issues/602
aka papyon doesn't tell us msnobjects changed (and if we check
too soon, they're None) '''
self._on_contact_msnobject_changed(papycontact)
return False

def _add_group(self, papygroup):
''' method to add a group to the (gui) contact list '''
Expand Down

0 comments on commit 8751ed8

Please sign in to comment.