Mercurial > libervia-backend
comparison src/core/sat_main.py @ 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 |
parents | d731ae066158 |
children | c1cd6c0c2c38 |
comparison
equal
deleted
inserted
replaced
699:e819630c6737 | 700:ab9620029aa8 |
---|---|
531 def sendAndStore(mess_data): | 531 def sendAndStore(mess_data): |
532 client.xmlstream.send(mess_data['xml']) | 532 client.xmlstream.send(mess_data['xml']) |
533 if mess_data["type"] != "groupchat": | 533 if mess_data["type"] != "groupchat": |
534 # we don't add groupchat message to history, as we get them back | 534 # we don't add groupchat message to history, as we get them back |
535 # and they will be added then | 535 # and they will be added then |
536 self.memory.addToHistory(current_jid, mess_data['to'], | 536 if mess_data['message']: # we need a message to save something |
537 self.memory.addToHistory(current_jid, mess_data['to'], | |
537 unicode(mess_data["message"]), | 538 unicode(mess_data["message"]), |
538 unicode(mess_data["type"]), | 539 unicode(mess_data["type"]), |
539 mess_data['extra'], | 540 mess_data['extra'], |
540 profile=profile) | 541 profile=profile) |
541 # We send back the message, so all clients are aware of it | 542 # We send back the message, so all clients are aware of it |