Delete messages more thoroughly (and at all) (#2114)

- Make sure delete_expired_messages and housekeeping runs once a day
- delete more info about messages when putting them to trash (esp. also
delete txt_raw, from_id and to_id as we don't need those anymore, so
they are data that was unnecessarily kept)

fix #1926, fix #2090

Also:

* Nicer test_utils: add send_text() and print_chat()

* Adapt ephemeral messages for testing (make them accurate to the second)

* Add test for ephemeral messages

* Make pop_sent_msg() really pop the last sent message
This commit is contained in:
Hocuri
2020-12-26 18:29:43 +01:00
committed by GitHub
parent 86a8767d94
commit 78fd0c285b
7 changed files with 212 additions and 15 deletions

View File

@@ -110,7 +110,7 @@ impl MsgId {
context
.sql
.execute(
"UPDATE msgs SET chat_id=?, txt='', txt_raw='' WHERE id=?",
"UPDATE msgs SET chat_id=?, txt='', txt_raw='', from_id=0, to_id=0, param='' WHERE id=?",
paramsv![chat_id, self],
)
.await?;