diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-07-31 20:54:51 (GMT) |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-07-31 20:54:51 (GMT) |
commit | bc7fc5f02d54299586980471034678381fd099b0 (patch) | |
tree | 86edfc4c3699b15ffdb7a97a4cd1cae90d81496c | |
parent | 6749410238896480bc3af9faae2043007e487197 (diff) |
Cope with arbitrary Unicode in nicknames by making Buddy.props.nick 'object' rather than 'str' and coercing to unicode when set.
See also <http://dev.laptop.org/ticket/2611>
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/buddy.py | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,5 @@ +* Cope with arbitrary Unicode in nicknames, bug#2611 (smcv) + Snapshot ce62f752b2 * Text channel creation minor fixes (smcv) diff --git a/src/buddy.py b/src/buddy.py index acba884..fcd3ba8 100644 --- a/src/buddy.py +++ b/src/buddy.py @@ -148,7 +148,8 @@ class Buddy(ExportedGObject): gobject.PARAM_CONSTRUCT_ONLY | gobject.PARAM_READWRITE), _PROP_ICON : (object, None, None, gobject.PARAM_READABLE), - _PROP_NICK : (str, None, None, None, + # Must be a unicode object or None + _PROP_NICK : (object, None, None, gobject.PARAM_CONSTRUCT_ONLY | gobject.PARAM_READWRITE), _PROP_COLOR : (str, None, None, None, @@ -260,6 +261,8 @@ class Buddy(ExportedGObject): self._icon = str(value) self.IconChanged(self._icon) elif pspec.name == _PROP_NICK: + if value is not None: + value = unicode(value) self._nick = value elif pspec.name == _PROP_COLOR: self._color = value @@ -486,6 +489,8 @@ class Buddy(ExportedGObject): changed_props = {} if _PROP_NICK in properties: nick = properties[_PROP_NICK] + if nick is not None: + nick = unicode(nick) if nick != self._nick: self._nick = nick changed_props[_PROP_NICK] = nick |