Skip to content
Snippets Groups Projects
Commit 5cdfad96 authored by Taras's avatar Taras
Browse files

Fix edit media caption

parent fab99a62
No related branches found
No related tags found
No related merge requests found
...@@ -72,11 +72,7 @@ class PreviewPostView( ...@@ -72,11 +72,7 @@ class PreviewPostView(
) )
} }
setOnClickListener { requestFocusOnText() } setOnClickListener { requestFocusOnText() }
binding.ivRemoveImage.setOnClickListener { setTextContent() }
binding.ivRemoveImage.setOnClickListener {
setTextContent()
}
updateContentView() updateContentView()
binding.btnSend.setOnClickListener { listener?.onSendClicked(getPostContent()) } binding.btnSend.setOnClickListener { listener?.onSendClicked(getPostContent()) }
......
package org.futo.circles.core.extensions package org.futo.circles.core.extensions
import org.futo.circles.core.model.PostContentType import org.futo.circles.core.model.PostContentType
import org.matrix.android.sdk.api.session.events.model.EventType
import org.matrix.android.sdk.api.session.events.model.toModel
import org.matrix.android.sdk.api.session.room.model.message.MessageContent
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
import org.matrix.android.sdk.api.session.room.timeline.getLastMessageContent import org.matrix.android.sdk.api.session.room.timeline.getLastMessageContent
fun TimelineEvent.getPostContentType(): PostContentType? { fun TimelineEvent.getPostContentType(): PostContentType? {
val messageType = getLastMessageContent()?.msgType val messageType = if (root.getClearType() == EventType.MESSAGE) root.getClearContent()
.toModel<MessageContent>()?.msgType
else getLastMessageContent()?.msgType
return PostContentType.values().firstOrNull { it.typeKey == messageType } return PostContentType.values().firstOrNull { it.typeKey == messageType }
} }
\ No newline at end of file
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