summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core.py2
-rw-r--r--src/tabs.py12
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 22bc0044..9de53b51 100644
--- a/src/core.py
+++ b/src/core.py
@@ -2885,6 +2885,8 @@ class Core(object):
conversation.nick = remote_nick
self.events.trigger('conversation_msg', message, conversation)
+ if not message['body']:
+ return
body = xhtml.get_body_from_message_stanza(message)
delayed, date = common.find_delayed_tag(message)
diff --git a/src/tabs.py b/src/tabs.py
index 80182a52..e5564aa6 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1240,6 +1240,8 @@ class MucTab(ChatTab):
# This lets a plugin insert \x19xxx} colors, that will
# be converted in xhtml.
self.core.events.trigger('muc_say', msg, self)
+ if not msg['body']:
+ return
if msg['body'].find('\x19') != -1:
msg.enable('html')
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
@@ -1250,6 +1252,8 @@ class MucTab(ChatTab):
msg['replace']['id'] = self.last_sent_message['id']
self.cancel_paused_delay()
self.core.events.trigger('muc_say_after', msg, self)
+ if not msg['body']:
+ return
self.last_sent_message = msg
msg.send()
self.chat_state = needed
@@ -1908,6 +1912,8 @@ class PrivateTab(ChatTab):
# This lets a plugin insert \x19xxx} colors, that will
# be converted in xhtml.
self.core.events.trigger('private_say', msg, self)
+ if not msg['body']:
+ return
user = self.parent_muc.get_user_by_name(self.own_nick)
replaced = False
if correct:
@@ -1938,6 +1944,8 @@ class PrivateTab(ChatTab):
if attention and self.remote_supports_attention:
msg['attention'] = True
self.core.events.trigger('private_say_after', msg, self)
+ if not msg['body']:
+ return
self.last_sent_message = msg
msg.send()
self.cancel_paused_delay()
@@ -3100,6 +3108,8 @@ class ConversationTab(ChatTab):
# This lets a plugin insert \x19xxx} colors, that will
# be converted in xhtml.
self.core.events.trigger('conversation_say', msg, self)
+ if not msg['body']:
+ return
replaced = False
if correct:
msg['replace']['id'] = self.last_sent_message['id']
@@ -3127,6 +3137,8 @@ class ConversationTab(ChatTab):
if attention and self.remote_supports_attention:
msg['attention'] = True
self.core.events.trigger('conversation_say_after', msg, self)
+ if not msg['body']:
+ return
self.last_sent_message = msg
msg.send()
self.cancel_paused_delay()