diff sat_frontends/quick_frontend/quick_chat.py @ 2736:df2bc2e704bc

core (xmpp): don't send message without message or subject to bridge (and log a warning in frontends if such a message is received)
author Goffi <goffi@goffi.org>
date Wed, 02 Jan 2019 18:28:30 +0100
parents b4c0a5bec729
children 003b8b4b56a7
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_chat.py	Wed Jan 02 18:25:55 2019 +0100
+++ b/sat_frontends/quick_frontend/quick_chat.py	Wed Jan 02 18:28:30 2019 +0100
@@ -584,6 +584,11 @@
                 profile,
             )
             return
+
+        if not msg and not subject and type_ != C.MESS_TYPE_INFO:
+            log.warning(u"Received an empty message for uid {}".format(uid))
+            return
+
         if self.type == C.CHAT_GROUP:
             if to_jid.resource and type_ != C.MESS_TYPE_GROUPCHAT:
                 # we have a private message, we forward it to a private conversation