core: dont save anymore messages to database if there is no "message" data (fix empty records with chat states)

This commit is contained in:
Goffi 2013-11-13 14:01:13 +01:00
commit 2a1b7439b7

View file

@ -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'],