Skip to content

Commit

Permalink
[AND-169] Add an option to show/hide block user action on the Message…
Browse files Browse the repository at this point in the history
…Options (#5512)

* Add an option to show/hide block user action on the MessageOptions

* Update CHANGELOG.md
  • Loading branch information
JcMinarro authored Dec 11, 2024
1 parent f9957d4 commit 4bbea69
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
### ✅ Added
- The `StreamAttachmentFactories.defaultFactories()` method now accepts a `skipTypes` parameter to skip specific factory types. [#5494](https://github.com/GetStream/stream-chat-android/pull/5494)
- Add `ChatTheme.keyboardBehaviour` property to customize different keyboard behaviours. [#5506](https://github.com/GetStream/stream-chat-android/pull/5506)
- Add `MessageOptionItemVisibility.isBlockUserVisible` property to show/hide the block user option. [#5512](https://github.com/GetStream/stream-chat-android/pull/5512)

### ⚠️ Changed

Expand Down
10 changes: 6 additions & 4 deletions stream-chat-android-compose/api/stream-chat-android-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,10 @@ public final class io/getstream/chat/android/compose/ui/components/messageoption
public final class io/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility {
public static final field $stable I
public fun <init> ()V
public fun <init> (ZZZZZZZZZ)V
public synthetic fun <init> (ZZZZZZZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (ZZZZZZZZZZ)V
public synthetic fun <init> (ZZZZZZZZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Z
public final fun component10 ()Z
public final fun component2 ()Z
public final fun component3 ()Z
public final fun component4 ()Z
Expand All @@ -1043,10 +1044,11 @@ public final class io/getstream/chat/android/compose/ui/components/messageoption
public final fun component7 ()Z
public final fun component8 ()Z
public final fun component9 ()Z
public final fun copy (ZZZZZZZZZ)Lio/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility;
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility;ZZZZZZZZZILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility;
public final fun copy (ZZZZZZZZZZ)Lio/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility;
public static synthetic fun copy$default (Lio/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility;ZZZZZZZZZZILjava/lang/Object;)Lio/getstream/chat/android/compose/ui/components/messageoptions/MessageOptionItemVisibility;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public final fun isBlockUserVisible ()Z
public final fun isCopyTextVisible ()Z
public final fun isDeleteMessageVisible ()Z
public final fun isEditMessageVisible ()Z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import io.getstream.chat.android.compose.ui.components.selectedmessage.SelectedM
* @param isFlagMessageVisible Visibility of the flag message option.
* @param isPinMessageVisible Visibility of the pin message to chat option.
* @param isDeleteMessageVisible Visibility of the delete message option.
* @param isBlockUserVisible Visibility of the block user option.
*
* @see [SelectedMessageMenu]
* @see [MessageOptions]
Expand All @@ -45,4 +46,5 @@ public data class MessageOptionItemVisibility(
val isFlagMessageVisible: Boolean = true,
val isPinMessageVisible: Boolean = true,
val isDeleteMessageVisible: Boolean = true,
val isBlockUserVisible: Boolean = true,
)
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public fun defaultMessageOptionsState(
} else {
null
},
if (!isOwnMessage) {
if (visibility.isBlockUserVisible && !isOwnMessage) {
MessageOptionItemState(
title = R.string.stream_compose_block_user,
iconPainter = painterResource(R.drawable.stream_compose_ic_clear),
Expand Down

0 comments on commit 4bbea69

Please sign in to comment.