mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Remove existing chat message reaction instead of trying to send it again
This commit is contained in:
parent
1d328f98e3
commit
83df46ca8b
1 changed files with 9 additions and 3 deletions
|
|
@ -286,9 +286,15 @@ class MessageModel @WorkerThread constructor(
|
|||
@UiThread
|
||||
fun sendReaction(emoji: String) {
|
||||
coreContext.postOnCoreThread {
|
||||
Log.i("$TAG Sending reaction [$emoji] to message with ID [$id]")
|
||||
val reaction = chatMessage.createReaction(emoji)
|
||||
reaction.send()
|
||||
if (chatMessage.ownReaction?.body == emoji) {
|
||||
Log.i("$TAG Removing our existing reaction [$emoji] to message with ID [$id]")
|
||||
val reaction = chatMessage.createReaction("")
|
||||
reaction.send()
|
||||
} else {
|
||||
Log.i("$TAG Sending reaction [$emoji] to message with ID [$id]")
|
||||
val reaction = chatMessage.createReaction(emoji)
|
||||
reaction.send()
|
||||
}
|
||||
dismissLongPressMenuEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue