changeset 700:ab9620029aa8

core: dont save anymore messages to database if there is no "message" data (fix empty records with chat states)
author Goffi <goffi@goffi.org>
date Wed, 13 Nov 2013 14:01:13 +0100 (2013-11-13)
parents e819630c6737
children 98b2400e17d6
files src/core/sat_main.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/sat_main.py	Wed Nov 13 14:00:07 2013 +0100
+++ b/src/core/sat_main.py	Wed Nov 13 14:01:13 2013 +0100
@@ -533,7 +533,8 @@
             if mess_data["type"] != "groupchat":
                 # we don't add groupchat message to history, as we get them back
                 # and they will be added then
-                self.memory.addToHistory(current_jid, mess_data['to'],
+                if mess_data['message']: # we need a message to save something
+                    self.memory.addToHistory(current_jid, mess_data['to'],
                                          unicode(mess_data["message"]),
                                          unicode(mess_data["type"]),
                                          mess_data['extra'],