Skip to content

Commit 9b8458a

Browse files
fix: Queries were inverted, so it was involuntarily working. It's fixed now.
1 parent 000a30c commit 9b8458a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/MessageController.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class MessageController @Inject constructor(private val mailboxContentRealm: Rea
6868
val isNotFromPlusMe = "SUBQUERY(${Message::from.name}, \$recipient," +
6969
" \$recipient.${Recipient::email.name} BEGINSWITH '${start}'" +
7070
" AND \$recipient.${Recipient::email.name} ENDSWITH '${end}'" +
71-
").@count > 0"
71+
").@count < 1"
7272

73-
return messages.query("$isNotDraft AND $isNotScheduledDraft AND ($isNotFromRealMe OR $isNotFromPlusMe)").find().lastOrNull()
73+
return messages.query("$isNotDraft AND $isNotScheduledDraft AND $isNotFromRealMe AND $isNotFromPlusMe").find().lastOrNull()
7474
?: messages.query("$isNotDraft AND $isNotScheduledDraft").find().lastOrNull()
7575
?: messages.query(isNotScheduledDraft).find().lastOrNull()
7676
?: messages.last()

0 commit comments

Comments
 (0)