summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-10-16 10:43:57 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-10-16 10:45:00 +0200
commitd4590949f7b691e3e1d6eff8fa339e62a44bae51 (patch)
treed4b86f75631d09c069929dab702871fa4561c9f3 /src
parent088c6c6a0b46309d17c4b0ba5939a2dd200c7002 (diff)
downloadpoezio-d4590949f7b691e3e1d6eff8fa339e62a44bae51.tar.gz
poezio-d4590949f7b691e3e1d6eff8fa339e62a44bae51.tar.bz2
poezio-d4590949f7b691e3e1d6eff8fa339e62a44bae51.tar.xz
poezio-d4590949f7b691e3e1d6eff8fa339e62a44bae51.zip
Do not ignore empty topics
Diffstat (limited to 'src')
-rw-r--r--src/core/handlers.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/core/handlers.py b/src/core/handlers.py
index ea67eaa6..75c372bb 100644
--- a/src/core/handlers.py
+++ b/src/core/handlers.py
@@ -960,18 +960,21 @@ def on_groupchat_subject(self, message):
room_from = message.getMucroom()
tab = self.get_tab_by_name(room_from, tabs.MucTab)
subject = message['subject']
- if not subject or not tab:
+ if subject is None or not tab:
return
- if nick_from:
- tab.add_message(_("\x19%(info_col)s}%(nick)s set the subject to: %(subject)s") %
- {'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT), 'nick':nick_from, 'subject':subject},
- time=None,
- typ=2)
- else:
- tab.add_message(_("\x19%(info_col)s}The subject is: %(subject)s") %
- {'subject':subject, 'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT)},
- time=None,
- typ=2)
+ if subject != tab.topic:
+ # Do not display the message if the subject did not change or if we
+ # receive an empty topic when joining the room.
+ if nick_from:
+ tab.add_message(_("\x19%(info_col)s}%(nick)s set the subject to: %(subject)s") %
+ {'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT), 'nick':nick_from, 'subject':subject},
+ time=None,
+ typ=2)
+ else:
+ tab.add_message(_("\x19%(info_col)s}The subject is: %(subject)s") %
+ {'subject':subject, 'info_col': dump_tuple(get_theme().COLOR_INFORMATION_TEXT)},
+ time=None,
+ typ=2)
tab.topic = subject
tab.topic_from = nick_from
if self.get_tab_by_name(room_from, tabs.MucTab) is self.current_tab():