Skip to content

Commit

Permalink
chore: quoted messages for location
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Dec 15, 2023
1 parent fecddaa commit 763a5da
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ sealed class MessageContent {
val assetMimeType: String
) : Content

data class Location(val locationName: String?) : Content

data object Deleted : Content

data object Invalid : Content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,12 @@ private fun quotedContentFromEntity(it: MessageEntityContent.Text.QuotedMessage)
)
}

it.contentType == MessageEntity.ContentType.LOCATION -> {
MessageContent.QuotedMessageDetails.Location(
locationName = it.locationName,
)
}

// If a new content type can be replied to (Pings, for example), fallback to Invalid
else -> MessageContent.QuotedMessageDetails.Invalid
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ sealed class MessageEntityContent {
val textBody: String?,
val assetMimeType: String?,
val assetName: String?,
val locationName: String?,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ object MessageMapper {
textBody = quotedTextBody,
assetMimeType = quotedAssetMimeType,
assetName = quotedAssetName,
locationName = locationName
)
},
)
Expand Down Expand Up @@ -576,6 +577,7 @@ object MessageMapper {
textBody = quotedTextBody,
assetMimeType = quotedAssetMimeType,
assetName = quotedAssetName,
locationName = locationName
)
},
)
Expand Down

0 comments on commit 763a5da

Please sign in to comment.