mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-31 03:22:03 +00:00
extract checks to separate methods
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
c3dd263b3f
commit
5a76f3a3d3
@ -76,10 +76,8 @@ class MessageActionsDialog(
|
||||
initMenuReplyToMessage(message.replyable)
|
||||
initMenuReplyPrivately(
|
||||
message.replyable &&
|
||||
user?.userId?.isNotEmpty() == true &&
|
||||
user?.userId != "?" &&
|
||||
message.user.id.startsWith("users/") &&
|
||||
message.user.id.substring(ACTOR_LENGTH) != currentConversation?.actorId &&
|
||||
hasUserId(user) &&
|
||||
hasUserActorId(message) &&
|
||||
currentConversation?.type != Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||
)
|
||||
initMenuDeleteMessage(showMessageDeletionButton)
|
||||
@ -101,6 +99,15 @@ class MessageActionsDialog(
|
||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
}
|
||||
|
||||
private fun hasUserId(user: UserEntity?): Boolean {
|
||||
return user?.userId?.isNotEmpty() == true && user?.userId != "?"
|
||||
}
|
||||
|
||||
private fun hasUserActorId(message: ChatMessage): Boolean {
|
||||
return message.user.id.startsWith("users/") &&
|
||||
message.user.id.substring(ACTOR_LENGTH) != currentConversation?.actorId
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private fun initEmojiMore() {
|
||||
dialogMessageActionsBinding.emojiMore.setOnTouchListener { v, event ->
|
||||
|
Loading…
Reference in New Issue
Block a user