Skip to content

Commit

Permalink
fix: Queries were inverted, so it was involuntarily working. It's fix…
Browse files Browse the repository at this point in the history
…ed now.
  • Loading branch information
KevinBoulongne committed Mar 4, 2025
1 parent 000a30c commit 9b8458a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ class MessageController @Inject constructor(private val mailboxContentRealm: Rea
val isNotFromPlusMe = "SUBQUERY(${Message::from.name}, \$recipient," +
" \$recipient.${Recipient::email.name} BEGINSWITH '${start}'" +
" AND \$recipient.${Recipient::email.name} ENDSWITH '${end}'" +
").@count > 0"
").@count < 1"

return messages.query("$isNotDraft AND $isNotScheduledDraft AND ($isNotFromRealMe OR $isNotFromPlusMe)").find().lastOrNull()
return messages.query("$isNotDraft AND $isNotScheduledDraft AND $isNotFromRealMe AND $isNotFromPlusMe").find().lastOrNull()
?: messages.query("$isNotDraft AND $isNotScheduledDraft").find().lastOrNull()
?: messages.query(isNotScheduledDraft).find().lastOrNull()
?: messages.last()
Expand Down

0 comments on commit 9b8458a

Please sign in to comment.