#1953: Retrieve friends' nicks from the profile.
This commit is contained in:
parent
ecca1dca00
commit
f0c8fe19fe
2
NEWS
2
NEWS
@ -1,3 +1,5 @@
|
|||||||
|
* #1953: Retrieve friends' nicks from the profile. (tomeu)
|
||||||
|
|
||||||
Snapshot aa6a024368
|
Snapshot aa6a024368
|
||||||
|
|
||||||
* #1825: Fix tab label padding. (marco)
|
* #1825: Fix tab label padding. (marco)
|
||||||
|
@ -36,7 +36,7 @@ class BuddyModel(gobject.GObject):
|
|||||||
([gobject.TYPE_PYOBJECT]))
|
([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):
|
if (key and buddy) or (not key and not buddy):
|
||||||
raise RuntimeError("Must specify only _one_ of key or 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._pservice = presenceservice.get_instance()
|
||||||
|
|
||||||
self._buddy = None
|
self._buddy = None
|
||||||
self._nick = None
|
|
||||||
|
|
||||||
# If given just a key, try to get the buddy from the PS first
|
# If given just a key, try to get the buddy from the PS first
|
||||||
if not buddy:
|
if not buddy:
|
||||||
@ -72,7 +71,7 @@ class BuddyModel(gobject.GObject):
|
|||||||
self._key = key
|
self._key = key
|
||||||
# Set color to 'inactive'/'disconnected'
|
# Set color to 'inactive'/'disconnected'
|
||||||
self._set_color_from_string(_NOT_PRESENT_COLOR)
|
self._set_color_from_string(_NOT_PRESENT_COLOR)
|
||||||
self._name = "Unknown buddy"
|
self._nick = nick
|
||||||
|
|
||||||
def _set_color_from_string(self, color_string):
|
def _set_color_from_string(self, color_string):
|
||||||
self._color = XoColor(color_string)
|
self._color = XoColor(color_string)
|
||||||
|
@ -69,7 +69,7 @@ class Friends(gobject.GObject):
|
|||||||
# HACK: don't screw up on old friends files
|
# HACK: don't screw up on old friends files
|
||||||
if len(key) < 20:
|
if len(key) < 20:
|
||||||
continue
|
continue
|
||||||
buddy = BuddyModel(key=key)
|
buddy = BuddyModel(key=key, nick=cp.get(key, 'nick'))
|
||||||
self.add_friend(buddy)
|
self.add_friend(buddy)
|
||||||
except Exception, exc:
|
except Exception, exc:
|
||||||
logging.error("Error parsing friends file: %s" % exc)
|
logging.error("Error parsing friends file: %s" % exc)
|
||||||
|
Loading…
Reference in New Issue
Block a user