Trash location.kml messages

Assign location.kml message parts to the trash chat,
but return non-trash chat_id so locations are assigned
to the correct chat.

Due to a bug introduced in
7968f55191
previously location.kml messages resulted in
empty message bubbles on the receiver.
This commit is contained in:
link2xt
2022-04-24 19:43:59 +00:00
parent 43e3f8f08b
commit aae4f0bb7b
3 changed files with 68 additions and 2 deletions

View File

@@ -1103,11 +1103,11 @@ INSERT INTO msgs
// If you change which information is skipped if the message is trashed,
// also change `MsgId::trash()` and `delete_expired_messages()`
let trash = chat_id.is_trash();
let trash = chat_id.is_trash() || (location_kml_is && msg.is_empty());
stmt.execute(paramsv![
rfc724_mid,
chat_id,
if trash { DC_CHAT_ID_TRASH } else { chat_id },
if trash { ContactId::UNDEFINED } else { from_id },
if trash { ContactId::UNDEFINED } else { to_id },
sort_timestamp,