Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-09 19:34:28 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-07-09 19:34:28 (GMT)
commitf0c8fe19feda8b06747e3b9aa11c4ac84aead723 (patch)
treede489b7e98a1730a0ba59ae72fd71c66b7635ed7 /shell
parentecca1dca0011df7d40f424e89a75f0cc9193b874 (diff)
#1953: Retrieve friends' nicks from the profile.
Diffstat (limited to 'shell')
-rw-r--r--shell/model/BuddyModel.py5
-rw-r--r--shell/model/Friends.py2
2 files changed, 3 insertions, 4 deletions
diff --git a/shell/model/BuddyModel.py b/shell/model/BuddyModel.py
index 75c044a..9f86e57 100644
--- a/shell/model/BuddyModel.py
+++ b/shell/model/BuddyModel.py
@@ -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)
diff --git a/shell/model/Friends.py b/shell/model/Friends.py
index 23ce94a..2b7d6bf 100644
--- a/shell/model/Friends.py
+++ b/shell/model/Friends.py
@@ -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)