#1953: Retrieve friends' nicks from the profile.

master
Tomeu Vizoso 17 years ago
parent ecca1dca00
commit f0c8fe19fe

@ -1,3 +1,5 @@
* #1953: Retrieve friends' nicks from the profile. (tomeu)
Snapshot aa6a024368
* #1825: Fix tab label padding. (marco)

@ -36,7 +36,7 @@ class BuddyModel(gobject.GObject):
([gobject.TYPE_PYOBJECT]))
}
def __init__(self, key=None, buddy=None):
def __init__(self, key=None, buddy=None, nick=None):
if (key and buddy) or (not key and not buddy):
raise RuntimeError("Must specify only _one_ of key or buddy.")
@ -51,7 +51,6 @@ class BuddyModel(gobject.GObject):
self._pservice = presenceservice.get_instance()
self._buddy = None
self._nick = None
# If given just a key, try to get the buddy from the PS first
if not buddy:
@ -72,7 +71,7 @@ class BuddyModel(gobject.GObject):
self._key = key
# Set color to 'inactive'/'disconnected'
self._set_color_from_string(_NOT_PRESENT_COLOR)
self._name = "Unknown buddy"
self._nick = nick
def _set_color_from_string(self, color_string):
self._color = XoColor(color_string)

@ -69,7 +69,7 @@ class Friends(gobject.GObject):
# HACK: don't screw up on old friends files
if len(key) < 20:
continue
buddy = BuddyModel(key=key)
buddy = BuddyModel(key=key, nick=cp.get(key, 'nick'))
self.add_friend(buddy)
except Exception, exc:
logging.error("Error parsing friends file: %s" % exc)

Loading…
Cancel
Save