Skip to content
1 change: 1 addition & 0 deletions apps/flipcash/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@
<string name="label_edited">Edited</string>
<string name="label_messageDeletedByYou">You deleted this message</string>
<string name="label_messageDeleted">This message was deleted</string>
<string name="label_messageUnsupported">This message isn\'t supported on this version</string>

<!-- Cash link card: the state of the link a message carries, read without claiming it -->
<string name="label_linkCard_cash">Cash</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ sealed interface ChatListItem {
is MessageContent.Media -> "media"
is MessageContent.Reply -> "reply-message"
is MessageContent.System -> "system-message"
is MessageContent.Encrypted -> "encrypted-message"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ private fun MessageContent.previewText(
// reaches here when every message in the chat is deleted — and then there is nothing
// to preview.
is MessageContent.Deleted -> null
is MessageContent.Encrypted -> null

// TODO:
is MessageContent.Media -> null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ fun MessageContent.linkableText(): String? = when (this) {
is MessageContent.Deleted,
is MessageContent.Media,
is MessageContent.System,
is MessageContent.Encrypted,
-> null
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ fun ContentBubble(
is MessageContent.Media -> maxWidth * CASH_BUBBLE_MAX_WIDTH_FRACTION
is MessageContent.Reply -> maxWidth * BUBBLE_MAX_WIDTH_FRACTION
is MessageContent.System -> maxWidth
is MessageContent.Encrypted -> maxWidth * BUBBLE_MAX_WIDTH_FRACTION
}

// A split message's citation goes on its first row and its marker on its last, so the
Expand Down Expand Up @@ -218,6 +219,18 @@ fun ContentBubble(
attention = attention,
)

// Not decoded client-side -- see MessageContent.Encrypted. Rendered as a
// tombstone-style text bubble, the same treatment as a deleted message.
is MessageContent.Encrypted -> TextBubble(
modifier = modifier,
text = stringResource(R.string.label_messageUnsupported),
isFromSelf = item.isFromSelf,
position = position,
maxWidth = bubbleMaxWidth,
isTombstone = true,
attention = attention,
)

// TODO
is MessageContent.Media -> Unit
is MessageContent.System -> Unit
Expand Down
Loading
Loading