mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
fix: ChatId::parent_query(): Don't filter out OutPending and OutFailed messages
The new message for which `parent_query()` is done may assume that it will be received in a context affected by those messages, e.g. they could add new members to a group and the new message will contain them in "To:". Anyway recipients must be prepared to orphaned references.
This commit is contained in:
@@ -1040,7 +1040,7 @@ impl ChatId {
|
|||||||
let sql = &context.sql;
|
let sql = &context.sql;
|
||||||
let query = format!(
|
let query = format!(
|
||||||
"SELECT {fields} \
|
"SELECT {fields} \
|
||||||
FROM msgs WHERE chat_id=? AND state NOT IN (?, ?, ?, ?) AND NOT hidden \
|
FROM msgs WHERE chat_id=? AND state NOT IN (?, ?) AND NOT hidden \
|
||||||
ORDER BY timestamp DESC, id DESC \
|
ORDER BY timestamp DESC, id DESC \
|
||||||
LIMIT 1;"
|
LIMIT 1;"
|
||||||
);
|
);
|
||||||
@@ -1051,8 +1051,11 @@ impl ChatId {
|
|||||||
self,
|
self,
|
||||||
MessageState::OutPreparing,
|
MessageState::OutPreparing,
|
||||||
MessageState::OutDraft,
|
MessageState::OutDraft,
|
||||||
MessageState::OutPending,
|
// We don't filter `OutPending` and `OutFailed` messages because the new message
|
||||||
MessageState::OutFailed,
|
// for which `parent_query()` is done may assume that it will be received in a
|
||||||
|
// context affected by those messages, e.g. they could add new members to a
|
||||||
|
// group and the new message will contain them in "To:". Anyway recipients must
|
||||||
|
// be prepared to orphaned references.
|
||||||
),
|
),
|
||||||
f,
|
f,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user