mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
reformating
This commit is contained in:
parent
70d25653c8
commit
6838e701b5
1 changed files with 7 additions and 7 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue