Merge pull request #4306 from nextcloud/bugfix/4276/fixSearchAvailability

Bugfix/4276/fix search availability
This commit is contained in:
Sowjanya Kota 2024-10-02 17:24:37 +02:00 committed by GitHub
commit 3073279005
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -2070,7 +2070,7 @@ class ChatActivity :
private fun onMessageSearchResult(intent: Intent?) {
val messageId = intent?.getStringExtra(MessageSearchActivity.RESULT_KEY_MESSAGE_ID)
messageId?.let { id ->
scrollToMessageWithId(id)
scrollToAndCenterMessageWithId(id)
}
}
@ -2825,7 +2825,9 @@ class ChatActivity :
}
val searchItem = menu.findItem(R.id.conversation_search)
searchItem.isVisible = CapabilitiesUtil.isUnifiedSearchAvailable(spreedCapabilities)
searchItem.isVisible = CapabilitiesUtil.isUnifiedSearchAvailable(spreedCapabilities) &&
currentConversation!!.remoteServer.isNullOrEmpty()
if (currentConversation!!.remoteServer != null ||
!CapabilitiesUtil.isSharedItemsAvailable(spreedCapabilities)

View file

@ -161,9 +161,6 @@ object CapabilitiesUtil {
}
fun isUnifiedSearchAvailable(spreedCapabilities: SpreedCapability): Boolean {
if (!hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.FEDERATION_V1)) {
return false
}
return hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.UNIFIED_SEARCH)
}