From 3ef50faf760ef939838e368fbff5ef6ae6c347d3 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Sun, 9 Jan 2011 01:54:36 +0000 Subject: Handle subject with no nick. And avoid duplicates --- src/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index de16bcae..00106157 100644 --- a/src/core.py +++ b/src/core.py @@ -848,7 +848,10 @@ class Core(object): subject = message['subject'] if not subject: return - self.add_message_to_text_buffer(room, _("%(nick)s set the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}, time=None) + if nick_from: + self.add_message_to_text_buffer(room, _("%(nick)s set the subject to: %(subject)s") % {'nick':nick_from, 'subject':subject}, time=None) + else: + self.add_message_to_text_buffer(room, _("The subject is: %(subject)s") % {'subject':subject}, time=None) room.topic = subject.replace('\n', '|') self.refresh_window() @@ -856,6 +859,8 @@ class Core(object): """ Triggered whenever a message is received from a multi-user chat room. """ + if message['subject']: + return delay_tag = message.find('{urn:xmpp:delay}delay') if delay_tag is not None: delayed = True -- cgit v1.2.3