Skip to content

Commit

Permalink
Fixed subject issue.| #74
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Dec 2, 2024
1 parent 74f0edb commit addb6cc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ fun Thread.hasPgp(): Boolean {

fun Thread.extractSubject(context: Context, receiverEmail: String): String {
return messages?.getOrNull(0)?.takeIf { message ->
message.getRecipients("From").any { internetAddress ->
(message.getRecipients("From").any { internetAddress ->
internetAddress.address.equals(receiverEmail, true)
} || (messages?.size ?: 0) == 1
} || (messages?.size ?: 0) == 1) && !message.isDraft()
}?.getSubject()
?: messages.firstOrNull { message ->
message.getRecipients("From").any { internetAddress ->
internetAddress.address.equals(receiverEmail, true)
}
} && !message.isDraft()
}?.getSubject()
?: messages?.getOrNull(0)?.getSubject()
?: context.getString(R.string.no_subject)
Expand Down

0 comments on commit addb6cc

Please sign in to comment.