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

Commit a09cf6a7 authored by Ashley's avatar Ashley
Browse files

Narrow Search intent usage

Only run search if coming from the search component

spotless

detekt

spotless

pr comment
parent d76fd96b
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -407,10 +407,15 @@ open class MessageList :
            }
            }
        }
        }
    }
    }

    private fun decodeExtras(intent: Intent): Boolean {
    private fun decodeExtras(intent: Intent): Boolean {
        val launchData = decodeExtrasToLaunchData(intent)
        if (intent.action === Intent.ACTION_SEARCH && !intent.component?.className.equals(
                Search::class.java.name,
            )
        ) {
            finish()
        }


        val launchData = decodeExtrasToLaunchData(intent)
        // If Unified Inbox was disabled show default account instead
        // If Unified Inbox was disabled show default account instead
        val search = if (launchData.search.isUnifiedInbox && !K9.isShowUnifiedInbox) {
        val search = if (launchData.search.isUnifiedInbox && !K9.isShowUnifiedInbox) {
            createDefaultLocalSearch()
            createDefaultLocalSearch()
@@ -1186,7 +1191,6 @@ open class MessageList :
        expandSearchView()
        expandSearchView()
        return true
        return true
    }
    }

    override fun startSearch(query: String, account: LegacyAccount?, folderId: Long?): Boolean {
    override fun startSearch(query: String, account: LegacyAccount?, folderId: Long?): Boolean {
        // If this search was started from a MessageList of a single folder, pass along that folder info
        // If this search was started from a MessageList of a single folder, pass along that folder info
        // so that we can enable remote search.
        // so that we can enable remote search.