Ticket #1749: 1749.patch

File 1749.patch, 2.0 KB (added by sascha_silbe, 11 years ago)

mark legacy clients as valid

  • src/presenceservice.py

    From: Sascha Silbe <sascha-pgp@silbe.org>
    Subject: [PATCH] mark legacy clients as valid (#1749)
    
    According to source comments, validity is supposed to get set "when the buddy
    either has, or has tried and failed to get, a color, a nick and a key".
    We now implement the latter part ("has tried and failed") as well.
    
    Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
    
    ---
     src/presenceservice.py |   10 +++++++---
     1 files changed, 7 insertions(+), 3 deletions(-)
    
    diff --git a/src/presenceservice.py b/src/presenceservice.py
    index 84c3cc2..aea45ae 100644
    a b class PresenceService(ExportedGObject): 
    376376                buddy = self._handles_buddies[tp].get(contact)
    377377                if buddy is not None and buddy is not self._owner:
    378378                    buddy.update_buddy_properties(tp, props)
     379            def get_properties_error(e):
     380                handle_error(e, 'fetching buddy properties')
     381                buddy = self._handles_buddies[tp].get(contact)
     382                if buddy is not None:
     383                    buddy.update_buddy_properties(tp, {})
    379384            def get_properties():
    380385                try:
    381386                    conn[CONN_INTERFACE_BUDDY_INFO].GetProperties(contact,
    382387                        byte_arrays=True, reply_handler=got_properties,
    383                         error_handler=lambda e:
    384                             handle_error(e, 'fetching buddy properties'))
     388                        error_handler=get_properties_error)
    385389                except Exception, e:
    386390                    gobject.idle_add(self._run_contacts_online_queue)
    387                     handle_error(e, 'fetching buddy properties')
     391                    get_properties_error(e)
    388392            def got_current_activity(current_activity, room):
    389393                gobject.idle_add(self._run_contacts_online_queue)
    390394                buddy = self._handles_buddies[tp].get(contact)