Merge pull request #2414 from nextcloud/bugfix/noid/hidePollCreationForOneToOne

hide poll creation for 1:1 conversations
This commit is contained in:
Tim Krüger 2022-09-23 12:26:56 +02:00 committed by GitHub
commit 009dbaf292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -452,7 +452,7 @@ class ChatController(args: Bundle) :
}
private fun loadAvatarForStatusBar() {
if (inOneToOneCall() && activity != null) {
if (isOneToOneConversation() && activity != null) {
val imageRequest = DisplayUtils.getImageRequestForUrl(
ApiUtils.getUrlForAvatar(
conversationUser?.baseUrl,
@ -493,7 +493,7 @@ class ChatController(args: Bundle) :
}
}
private fun inOneToOneCall() = currentConversation != null && currentConversation?.type != null &&
fun isOneToOneConversation() = currentConversation != null && currentConversation?.type != null &&
currentConversation?.type == Conversation.ConversationType
.ROOM_TYPE_ONE_TO_ONE_CALL
@ -1675,7 +1675,7 @@ class ChatController(args: Bundle) :
val bundle = Bundle()
bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, conversationUser)
bundle.putString(KEY_ROOM_TOKEN, roomToken)
bundle.putBoolean(BundleKeys.KEY_ROOM_ONE_TO_ONE, inOneToOneCall())
bundle.putBoolean(BundleKeys.KEY_ROOM_ONE_TO_ONE, isOneToOneConversation())
router.pushController(
RouterTransaction.with(ConversationInfoController(bundle))
.pushChangeHandler(HorizontalChangeHandler())

View File

@ -79,7 +79,9 @@ class AttachmentDialog(val activity: Activity, var chatController: ChatControlle
dialogAttachmentBinding.menuShareLocation.visibility = View.GONE
}
if (!CapabilitiesUtilNew.hasSpreedFeatureCapability(chatController.conversationUser, "talk-polls")) {
if (!CapabilitiesUtilNew.hasSpreedFeatureCapability(chatController.conversationUser, "talk-polls") ||
chatController.isOneToOneConversation()
) {
dialogAttachmentBinding.menuAttachPoll.visibility = View.GONE
}