Skip to content

Commit

Permalink
Show poll question in timeline replies (#1857)
Browse files Browse the repository at this point in the history
Forgot to add this bit to: #1848
  • Loading branch information
Marco Romano authored Nov 22, 2023
1 parent e269303 commit bc5c02c
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,14 @@ private fun attachmentThumbnailInfoForInReplyTo(inReplyTo: InReplyTo.Ready): Att

@Composable
private fun textForInReplyTo(inReplyTo: InReplyTo.Ready): String {
val messageContent = inReplyTo.content as? MessageContent ?: return ""
return when (messageContent.type) {
is LocationMessageType -> stringResource(CommonStrings.common_shared_location)
is VoiceMessageType -> stringResource(CommonStrings.common_voice_message)
else -> messageContent.body
return when (val eventContent = inReplyTo.content) {
is MessageContent -> when (eventContent.type) {
is LocationMessageType -> stringResource(CommonStrings.common_shared_location)
is VoiceMessageType -> stringResource(CommonStrings.common_voice_message)
else -> eventContent.body
}
is PollContent -> eventContent.question
else -> ""
}
}

Expand Down

0 comments on commit bc5c02c

Please sign in to comment.