mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
[Message Actions] Add emoji reactions option (#568)
* Add logic to send message reactions * Add emoji library, create EmojiPicker component * Fix bottom sheet behaviors --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
committed by
GitHub
parent
cabedb5f7a
commit
9fa261e393
+2
@@ -81,6 +81,8 @@ interface MatrixRoom : Closeable {
|
||||
|
||||
suspend fun sendFile(file: File, fileInfo: FileInfo): Result<Unit>
|
||||
|
||||
suspend fun sendReaction(emoji: String, eventId: EventId): Result<Unit>
|
||||
|
||||
suspend fun leave(): Result<Unit>
|
||||
|
||||
suspend fun acceptInvitation(): Result<Unit>
|
||||
|
||||
+6
@@ -259,6 +259,12 @@ class RustMatrixRoom(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun sendReaction(emoji: String, eventId: EventId): Result<Unit> = withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
innerRoom.sendReaction(key = emoji, eventId = eventId.value)
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalUnsignedTypes::class)
|
||||
override suspend fun updateAvatar(mimeType: String, data: ByteArray): Result<Unit> =
|
||||
withContext(Dispatchers.IO) {
|
||||
|
||||
+13
@@ -70,10 +70,14 @@ class FakeMatrixRoom(
|
||||
private var setTopicResult = Result.success(Unit)
|
||||
private var updateAvatarResult = Result.success(Unit)
|
||||
private var removeAvatarResult = Result.success(Unit)
|
||||
private var sendReactionResult = Result.success(Unit)
|
||||
|
||||
var sendMediaCount = 0
|
||||
private set
|
||||
|
||||
var sendReactionCount = 0
|
||||
private set
|
||||
|
||||
var isInviteAccepted: Boolean = false
|
||||
private set
|
||||
|
||||
@@ -124,6 +128,11 @@ class FakeMatrixRoom(
|
||||
return Result.success(Unit)
|
||||
}
|
||||
|
||||
override suspend fun sendReaction(emoji: String, eventId: EventId): Result<Unit> {
|
||||
sendReactionCount++
|
||||
return sendReactionResult
|
||||
}
|
||||
|
||||
var editMessageParameter: String? = null
|
||||
private set
|
||||
|
||||
@@ -279,4 +288,8 @@ class FakeMatrixRoom(
|
||||
fun givenSetTopicResult(result: Result<Unit>) {
|
||||
setTopicResult = result
|
||||
}
|
||||
|
||||
fun givenSendReactionResult(result: Result<Unit>) {
|
||||
sendReactionResult = result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user