mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
Merge pull request #3736 from nextcloud/feature/noid/hideItemsForFederatedRooms
Feature/noid/hide items for federated rooms
This commit is contained in:
commit
e76166987f
@ -199,7 +199,7 @@ class ConversationInfoActivity :
|
|||||||
if (databaseStorageModule == null) {
|
if (databaseStorageModule == null) {
|
||||||
databaseStorageModule = DatabaseStorageModule(conversationUser, conversationToken)
|
databaseStorageModule = DatabaseStorageModule(conversationUser, conversationToken)
|
||||||
}
|
}
|
||||||
setUpNotificationSettings(databaseStorageModule!!)
|
|
||||||
binding.deleteConversationAction.setOnClickListener { showDeleteConversationDialog() }
|
binding.deleteConversationAction.setOnClickListener { showDeleteConversationDialog() }
|
||||||
binding.leaveConversationAction.setOnClickListener { leaveConversation() }
|
binding.leaveConversationAction.setOnClickListener { leaveConversation() }
|
||||||
binding.clearConversationHistory.setOnClickListener { showClearHistoryDialog() }
|
binding.clearConversationHistory.setOnClickListener { showClearHistoryDialog() }
|
||||||
@ -690,7 +690,11 @@ class ConversationInfoActivity :
|
|||||||
private fun handleConversation() {
|
private fun handleConversation() {
|
||||||
val conversationCopy = conversation!!
|
val conversationCopy = conversation!!
|
||||||
|
|
||||||
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.RICH_OBJECT_LIST_MEDIA)) {
|
setUpNotificationSettings(databaseStorageModule!!)
|
||||||
|
|
||||||
|
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.RICH_OBJECT_LIST_MEDIA) &&
|
||||||
|
conversationCopy.remoteServer.isNullOrEmpty()
|
||||||
|
) {
|
||||||
binding.sharedItemsButton.setOnClickListener { showSharedItems() }
|
binding.sharedItemsButton.setOnClickListener { showSharedItems() }
|
||||||
} else {
|
} else {
|
||||||
binding.sharedItems.visibility = GONE
|
binding.sharedItems.visibility = GONE
|
||||||
@ -1345,8 +1349,13 @@ class ConversationInfoActivity :
|
|||||||
binding.notificationSettingsView.importantConversationSwitch.isChecked = module
|
binding.notificationSettingsView.importantConversationSwitch.isChecked = module
|
||||||
.getBoolean("important_conversation_switch", false)
|
.getBoolean("important_conversation_switch", false)
|
||||||
|
|
||||||
binding.notificationSettingsView.callNotificationsSwitch.isChecked = module
|
if (conversation!!.remoteServer.isNullOrEmpty()) {
|
||||||
.getBoolean("call_notifications_switch", true)
|
binding.notificationSettingsView.notificationSettingsCallNotifications.visibility = VISIBLE
|
||||||
|
binding.notificationSettingsView.callNotificationsSwitch.isChecked = module
|
||||||
|
.getBoolean("call_notifications_switch", true)
|
||||||
|
} else {
|
||||||
|
binding.notificationSettingsView.notificationSettingsCallNotifications.visibility = GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -188,15 +188,20 @@ class SharedItemsRepositoryImpl @Inject constructor(private val ncApi: NcApi, pr
|
|||||||
1
|
1
|
||||||
).map {
|
).map {
|
||||||
val types = mutableSetOf<SharedItemType>()
|
val types = mutableSetOf<SharedItemType>()
|
||||||
val typeMap = it.body()!!.ocs!!.data!!
|
|
||||||
for (t in typeMap) {
|
if (it.code() == HTTP_OK) {
|
||||||
if (t.value.isNotEmpty()) {
|
val typeMap = it.body()!!.ocs!!.data!!
|
||||||
try {
|
for (t in typeMap) {
|
||||||
types += SharedItemType.typeFor(t.key)
|
if (t.value.isNotEmpty()) {
|
||||||
} catch (e: IllegalArgumentException) {
|
try {
|
||||||
Log.w(TAG, "Server responds an unknown shared item type: ${t.key}")
|
types += SharedItemType.typeFor(t.key)
|
||||||
|
} catch (e: IllegalArgumentException) {
|
||||||
|
Log.w(TAG, "Server responds an unknown shared item type: ${t.key}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "Failed to getSharedItemsOverview")
|
||||||
}
|
}
|
||||||
|
|
||||||
types.toSet()
|
types.toSet()
|
||||||
@ -213,6 +218,7 @@ class SharedItemsRepositoryImpl @Inject constructor(private val ncApi: NcApi, pr
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val BATCH_SIZE: Int = 28
|
const val BATCH_SIZE: Int = 28
|
||||||
|
private const val HTTP_OK: Int = 200
|
||||||
private val TAG = SharedItemsRepositoryImpl::class.simpleName
|
private val TAG = SharedItemsRepositoryImpl::class.simpleName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ class SharedItemsViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
Log.d(TAG, "An error occurred: $e")
|
Log.e(TAG, "An error occurred when loading available types", e)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {
|
override fun onComplete() {
|
||||||
|
@ -73,6 +73,15 @@ class AttachmentDialog(val activity: Activity, var chatActivity: ChatActivity) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun initItemsVisibility() {
|
private fun initItemsVisibility() {
|
||||||
|
if (!chatActivity.currentConversation!!.remoteServer.isNullOrEmpty()) {
|
||||||
|
dialogAttachmentBinding.menuAttachContact.visibility = View.GONE
|
||||||
|
dialogAttachmentBinding.menuShareLocation.visibility = View.GONE
|
||||||
|
dialogAttachmentBinding.menuAttachPictureFromCam.visibility = View.GONE
|
||||||
|
dialogAttachmentBinding.menuAttachVideoFromCam.visibility = View.GONE
|
||||||
|
dialogAttachmentBinding.menuAttachFileFromLocal.visibility = View.GONE
|
||||||
|
dialogAttachmentBinding.menuAttachFileFromCloud.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
if (!CapabilitiesUtil.hasSpreedFeatureCapability(
|
if (!CapabilitiesUtil.hasSpreedFeatureCapability(
|
||||||
chatActivity.spreedCapabilities,
|
chatActivity.spreedCapabilities,
|
||||||
SpreedFeatures.GEO_LOCATION_SHARING
|
SpreedFeatures.GEO_LOCATION_SHARING
|
||||||
|
Loading…
Reference in New Issue
Block a user