Adding isReply extension method for RelationDefaultContent
This commit is contained in:
parent
def74926d7
commit
ab90da0e51
|
@ -33,6 +33,7 @@ import org.matrix.android.sdk.api.session.room.model.message.MessageStickerConte
|
|||
import org.matrix.android.sdk.api.session.room.model.message.MessageType
|
||||
import org.matrix.android.sdk.api.session.room.model.message.asMessageAudioEvent
|
||||
import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent
|
||||
import org.matrix.android.sdk.api.session.room.model.relation.isReply
|
||||
import org.matrix.android.sdk.api.session.room.model.relation.shouldRenderInThread
|
||||
import org.matrix.android.sdk.api.session.room.send.SendState
|
||||
import org.matrix.android.sdk.api.session.threads.ThreadDetails
|
||||
|
@ -420,7 +421,7 @@ fun Event.getRelationContentForType(type: String): RelationDefaultContent? =
|
|||
getRelationContent()?.takeIf { it.type == type }
|
||||
|
||||
fun Event.isReply(): Boolean {
|
||||
return getRelationContent()?.inReplyTo?.eventId != null
|
||||
return getRelationContent().isReply()
|
||||
}
|
||||
|
||||
fun Event.isReplyRenderedInThread(): Boolean {
|
||||
|
|
|
@ -28,3 +28,5 @@ data class RelationDefaultContent(
|
|||
) : RelationContent
|
||||
|
||||
fun RelationDefaultContent.shouldRenderInThread(): Boolean = isFallingBack == false
|
||||
|
||||
fun RelationDefaultContent?.isReply(): Boolean = this?.inReplyTo?.eventId != null
|
||||
|
|
Loading…
Reference in New Issue