Skip to content
Snippets Groups Projects
Commit 13b21c84 authored by Pierre Nicolas's avatar Pierre Nicolas :joy: Committed by Adrien Béraud
Browse files

conversation: feature to remove (=edit) one specific interaction (not all)

GitLab: #1236
Change-Id: I9ebca570ef27706640aa2a64bbc9f52fe229f837
parent 65d51c6d
No related branches found
No related tags found
No related merge requests found
......@@ -472,11 +472,22 @@ class ConversationPresenter @Inject constructor(
}
/**
* Remove reaction (emoji)
* Remove the reaction (emoji)
* @param reactionToRemove
*/
fun removeReaction(reactionToRemove: Interaction) {
val conversation = mConversation ?: return
accountService.editConversationMessage(
conversation.accountId, conversation.uri, "", reactionToRemove.messageId!!
)
}
/**
* Remove all reactions (emoji)
* Remove a reaction with git system consists in creating an "edit" interaction with empty body.
* @param interaction to clean from reaction
*/
fun removeReaction(interaction: Interaction) {
fun removeAllReactions(interaction: Interaction) {
val conversation = mConversation ?: return
// User can only remove his reactions.
mCompositeDisposable.add(interaction.reactionObservable
......@@ -484,7 +495,8 @@ class ConversationPresenter @Inject constructor(
.subscribe { interactionList ->
interactionList.filter { it.author == myId }.forEach { interaction ->
accountService.editConversationMessage(
conversation.accountId, conversation.uri, "", interaction.messageId!!
conversation.accountId,
conversation.uri, "", interaction.messageId!!
)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment