diff --git a/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt b/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt index 63e35c1c0f..dbef4c7ef8 100644 --- a/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt +++ b/vector/src/main/java/im/vector/app/core/extensions/TimelineEvent.kt @@ -21,6 +21,7 @@ import org.matrix.android.sdk.api.session.room.send.SendState import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent fun TimelineEvent.canReact(): Boolean { - // Only event of type Event.EVENT_TYPE_MESSAGE are supported for the moment - return root.getClearType() == EventType.MESSAGE && root.sendState == SendState.SYNCED && !root.isRedacted() + // Only event of type Event.EVENT_TYPE_MESSAGE and EventType.STICKER are supported for the moment + val clearType = root.getClearType() + return (clearType == EventType.MESSAGE || clearType == EventType.STICKER) && root.sendState == SendState.SYNCED && !root.isRedacted() } diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt index b5d3102f46..4c495a0ba3 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt @@ -393,9 +393,11 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted } private fun canReply(event: TimelineEvent, messageContent: MessageContent?, actionPermissions: ActionPermissions): Boolean { - // Only event of type Event.EVENT_TYPE_MESSAGE are supported for the moment - if (event.root.getClearType() != EventType.MESSAGE) return false if (!actionPermissions.canSendMessage) return false + // Only event of type Event.EVENT_TYPE_MESSAGE and EventType.STICKER are supported for the moment + val clearType = event.root.getClearType() + if (clearType == EventType.STICKER) return true + if (clearType != EventType.MESSAGE) return false return when (messageContent?.msgType) { MessageType.MSGTYPE_TEXT, MessageType.MSGTYPE_NOTICE, @@ -424,8 +426,9 @@ class MessageActionsViewModel @AssistedInject constructor(@Assisted } private fun canRedact(event: TimelineEvent, actionPermissions: ActionPermissions): Boolean { - // Only event of type Event.EVENT_TYPE_MESSAGE are supported for the moment - if (event.root.getClearType() != EventType.MESSAGE) return false + // Only event of type Event.EVENT_TYPE_MESSAGE and EventType.STICKER are supported for the moment + val clearType = event.root.getClearType() + if (clearType != EventType.MESSAGE && clearType != EventType.STICKER) return false // Message sent by the current user can always be redacted if (event.root.senderId == session.myUserId) return true // Check permission for messages sent by other users