From 7a485ef4d0d74313bff8c9c7b2ee2dcb5c4a75e9 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 6 Aug 2012 15:38:09 +0200 Subject: Add a common.safeJID function, and use it everywhere --- src/windows.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/windows.py') diff --git a/src/windows.py b/src/windows.py index c2a77411..6e1fd9ec 100644 --- a/src/windows.py +++ b/src/windows.py @@ -29,6 +29,7 @@ from roster import RosterGroup from poopt import cut_text from sleekxmpp import JID +from common import safeJID import core import wcwidth @@ -431,7 +432,7 @@ class PrivateInfoWin(InfoWin): self._refresh() def write_room_name(self, name): - jid = JID(name) + jid = safeJID(name) room_name, nick = jid.bare, jid.resource self.addstr(nick, to_curses_attr(get_theme().COLOR_PRIVATE_NAME)) txt = ' from room %s' % room_name @@ -464,7 +465,7 @@ class ConversationInfoWin(InfoWin): # from someone not in our roster. In this case, we display # only the maximum information from the message we can get. log.debug('Refresh: %s',self.__class__.__name__) - jid = JID(jid) + jid = safeJID(jid) if contact: if jid.resource: resource = contact[jid.full] @@ -539,7 +540,7 @@ class ConversationStatusMessageWin(InfoWin): def refresh(self, jid, contact): log.debug('Refresh: %s',self.__class__.__name__) - jid = JID(jid) + jid = safeJID(jid) if contact: if jid.resource: resource = contact[jid.full] -- cgit v1.2.3