Skip to content
Snippets Groups Projects
Commit f83768dd authored by Pierre Nicolas's avatar Pierre Nicolas :joy:
Browse files

conversation: cleanup

removeAllReactions is not used anymore

Change-Id: Ie87876122769c716f9244048fd2b99c9aa553ce2
parent 939f6c20
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,6 @@ class ConversationPresenter @Inject constructor(
}
private val mConversationSubject: Subject<Conversation> = BehaviorSubject.create()
private var searchQuerySubject: Subject<String>? = null
private var myId: String? = null
fun init(conversationUri: Uri, accountId: String) {
if (conversationUri == mConversationUri) return
......@@ -66,7 +65,6 @@ class ConversationPresenter @Inject constructor(
mConversationUri = conversationUri
mCompositeDisposable.add(conversationFacade.getAccountSubject(accountId)
.flatMap { a: Account ->
myId = a.username
conversationFacade.loadConversationHistory(a, conversationUri)
.observeOn(uiScheduler)
.doOnSuccess { c: Conversation -> setConversation(a, c) }
......@@ -499,27 +497,6 @@ class ConversationPresenter @Inject constructor(
)
}
/**
* 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 removeAllReactions(interaction: Interaction) {
val conversation = mConversation ?: return
// User can only remove his reactions.
mCompositeDisposable.add(interaction.reactionObservable
.firstOrError()
.subscribe { interactionList ->
interactionList.filter { it.author == myId }.forEach { interaction ->
accountService.editConversationMessage(
conversation.accountId,
conversation.uri, "", interaction.messageId!!
)
}
}
)
}
fun editMessage(accountId: String, conversationUri: Uri, messageId: String, newMessage: String) {
val message = mConversation?.getMessage(messageId)
if (message?.body != newMessage)
......
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