From 98a52fd6e7063fec95f6cfcc745a95f4e01e29b6 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Thu, 2 Sep 2010 00:44:18 +0000 Subject: Userfriendly names for Shows. Don't tab-warn on message coming from the ROOM itself --- src/gui.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui.py b/src/gui.py index 471c23ab..42e03954 100644 --- a/src/gui.py +++ b/src/gui.py @@ -55,6 +55,13 @@ ERROR_AND_STATUS_CODES = { '503': 'The maximum number of users has been reached', } +SHOW_NAME = { + 'dnd': _('busy'), + 'away': _('away'), + 'xa': _('not available'), + 'chat': _('chatty'), + '': _('available') + } def doupdate(): curses.doupdate() @@ -292,8 +299,8 @@ class Gui(object): msg += _('affiliation: %s,') % affiliation if role != user.role: msg += _('role: %s,') % role - if show != user.show: - msg += _('show: %s,') % show + if show != user.show and show in SHOW_NAME.keys(): + msg += _('show: %s,') % SHOW_NAME[show] if status != user.status: msg += _('status: %s,') % status msg = msg[:-1] # remove the last "," @@ -617,8 +624,10 @@ class Gui(object): else: delayed = False date = None - nick_from = message['from'].resource + nick_from = message['mucnick'] room_from = message.getMucroom() + if nick_from == room_from: + nick_from = None room = self.get_room_by_name(room_from) if (self.ignores.has_key(room_from)) and (nick_from in self.ignores[room_from]): return @@ -626,8 +635,8 @@ class Gui(object): if not room: self.information(_("message received for a non-existing room: %s") % (room_from)) return - body = message['body']#stanza.getBody() - subject = message['subject']#stanza.getSubject() + body = message['body'] + subject = message['subject'] if subject: if nick_from: self.add_message_to_room(room, _("%(nick)s changed the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}, time=date) -- cgit v1.2.3