summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2011-01-09 01:54:36 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2011-01-09 01:54:36 +0000
commit3ef50faf760ef939838e368fbff5ef6ae6c347d3 (patch)
tree402eb49a22b358a9b3711adfe3e604b5a429aca2 /src/core.py
parentcfc33090098ced22e18cfcbcbe25dab17d2b4a70 (diff)
downloadpoezio-3ef50faf760ef939838e368fbff5ef6ae6c347d3.tar.gz
poezio-3ef50faf760ef939838e368fbff5ef6ae6c347d3.tar.bz2
poezio-3ef50faf760ef939838e368fbff5ef6ae6c347d3.tar.xz
poezio-3ef50faf760ef939838e368fbff5ef6ae6c347d3.zip
Handle subject with no nick. And avoid duplicates
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py7
1 files changed, 6 insertions, 1 deletions
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