Merge pull request #4307 from nextcloud/backport/4306/stable-20.0

[stable-20.0] Bugfix/4276/fix search availability
This commit is contained in:
Marcel Hibbe 2024-10-22 11:29:07 +02:00 committed by GitHub
commit 251778491d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -2059,7 +2059,7 @@ class ChatActivity :
private fun onMessageSearchResult(intent: Intent?) {
val messageId = intent?.getStringExtra(MessageSearchActivity.RESULT_KEY_MESSAGE_ID)
messageId?.let { id ->
scrollToMessageWithId(id)
scrollToAndCenterMessageWithId(id)
}
}
@ -2810,7 +2810,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)
}