Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit cbcb0799 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #6486 from thundernest/search_in_recipient_addresses

Add support for search in recipient addresses
parents de891243 77756e56
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -453,6 +453,9 @@ open class MessageList :
            val search = LocalSearch().apply {
                isManualSearch = true
                or(SearchCondition(SearchField.SENDER, SearchSpecification.Attribute.CONTAINS, query))
                or(SearchCondition(SearchField.TO, SearchSpecification.Attribute.CONTAINS, query))
                or(SearchCondition(SearchField.CC, SearchSpecification.Attribute.CONTAINS, query))
                or(SearchCondition(SearchField.BCC, SearchSpecification.Attribute.CONTAINS, query))
                or(SearchCondition(SearchField.SUBJECT, SearchSpecification.Attribute.CONTAINS, query))
                or(SearchCondition(SearchField.MESSAGE_CONTENTS, SearchSpecification.Attribute.CONTAINS, query))
            }
+5 −1
Original line number Diff line number Diff line
@@ -50,7 +50,11 @@ class UidSearchCommandBuilder {
        if (performFullTextSearch) {
            builder.append(" TEXT ").append(encodedQuery);
        } else {
            builder.append(" OR SUBJECT ").append(encodedQuery).append(" FROM ").append(encodedQuery);
            builder.append(" OR OR OR OR SUBJECT ").append(encodedQuery)
                    .append(" FROM ").append(encodedQuery)
                    .append(" TO ").append(encodedQuery)
                    .append(" CC ").append(encodedQuery)
                    .append(" BCC ").append(encodedQuery);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -1066,7 +1066,7 @@ class RealImapFolderTest {

        folder.search("query", emptySet(), emptySet(), false)

        assertCommandIssued("UID SEARCH OR SUBJECT \"query\" FROM \"query\"")
        assertCommandIssued("""UID SEARCH OR OR OR OR SUBJECT "query" FROM "query" TO "query" CC "query" BCC "query"""")
    }

    @Test
+2 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ public class UidSearchCommandBuilderTest {
                .queryString("query")
                .build();

        assertEquals("UID SEARCH OR SUBJECT \"query\" FROM \"query\" NOT DELETED", command);
        assertEquals("UID SEARCH OR OR OR OR SUBJECT \"query\" FROM \"query\" TO \"query\" CC \"query\"" +
                " BCC \"query\" NOT DELETED", command);
    }
}