From 6838e701b57925b3fa60193b7348e284212eb766 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 23 Nov 2021 18:22:47 +0000 Subject: [PATCH] reformating --- .../detail/composer/MessageComposerViewModel.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt index 6940fb58db..7ccee0220c 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/MessageComposerViewModel.kt @@ -405,7 +405,7 @@ class MessageComposerViewModel @AssistedInject constructor( _viewEvents.post(MessageComposerViewEvents.MessageSent) popDraft() } - is SendMode.Quote -> { + is SendMode.Quote -> { val messageContent = state.sendMode.timelineEvent.getLastMessageContent() val textMsg = messageContent?.body @@ -426,7 +426,7 @@ class MessageComposerViewModel @AssistedInject constructor( _viewEvents.post(MessageComposerViewEvents.MessageSent) popDraft() } - is SendMode.Reply -> { + is SendMode.Reply -> { state.sendMode.timelineEvent.let { room.replyToMessage(it, action.text.toString(), action.autoMarkdown) _viewEvents.post(MessageComposerViewEvents.MessageSent) @@ -457,22 +457,22 @@ class MessageComposerViewModel @AssistedInject constructor( // Create a sendMode from a draft and retrieve the TimelineEvent sendMode = when (currentDraft) { is UserDraft.Regular -> SendMode.Regular(currentDraft.text, false) - is UserDraft.Quote -> { + is UserDraft.Quote -> { room.getTimeLineEvent(currentDraft.linkedEventId)?.let { timelineEvent -> SendMode.Quote(timelineEvent, currentDraft.text) } } - is UserDraft.Reply -> { + is UserDraft.Reply -> { room.getTimeLineEvent(currentDraft.linkedEventId)?.let { timelineEvent -> SendMode.Reply(timelineEvent, currentDraft.text) } } - is UserDraft.Edit -> { + is UserDraft.Edit -> { room.getTimeLineEvent(currentDraft.linkedEventId)?.let { timelineEvent -> SendMode.Edit(timelineEvent, currentDraft.text) } } - else -> null + else -> null } ?: SendMode.Regular("", fromSharing = false) ) } @@ -691,7 +691,7 @@ class MessageComposerViewModel @AssistedInject constructor( setState { copy(sendMode = it.sendMode.copy(text = action.draft)) } room.saveDraft(UserDraft.Quote(it.sendMode.timelineEvent.root.eventId!!, action.draft)) } - it.sendMode is SendMode.Edit -> { + it.sendMode is SendMode.Edit -> { setState { copy(sendMode = it.sendMode.copy(text = action.draft)) } room.saveDraft(UserDraft.Edit(it.sendMode.timelineEvent.root.eventId!!, action.draft)) }