From 2a1b7439b71fc234bd9491b5eead1ec9aea3ec3d Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 13 Nov 2013 14:01:13 +0100 Subject: [PATCH] core: dont save anymore messages to database if there is no "message" data (fix empty records with chat states) --- src/core/sat_main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/sat_main.py b/src/core/sat_main.py index e0df9a51..b9759404 100644 --- a/src/core/sat_main.py +++ b/src/core/sat_main.py @@ -533,7 +533,8 @@ class SAT(service.Service): 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'],