Do not render filename of voice message.
This commit is contained in:
committed by
Benoit Marty
parent
7bcbd2181a
commit
533252a44e
@@ -95,7 +95,9 @@ class DefaultPinnedMessagesBannerFormatter @Inject constructor(
|
||||
messageType.bestDescription.prefixWith(CommonStrings.common_audio)
|
||||
}
|
||||
is VoiceMessageType -> {
|
||||
messageType.bestDescription.prefixWith(CommonStrings.common_voice_message)
|
||||
// In this case, do not use bestDescription, because the filename is useless, only use the caption if available.
|
||||
messageType.caption?.prefixWith(sp.getString(CommonStrings.common_voice_message))
|
||||
?: sp.getString(CommonStrings.common_voice_message)
|
||||
}
|
||||
is OtherMessageType -> {
|
||||
messageType.body
|
||||
|
||||
@@ -159,11 +159,11 @@ class DefaultPinnedMessagesBannerFormatterTest {
|
||||
val expectedResult = when (type) {
|
||||
is VideoMessageType,
|
||||
is AudioMessageType,
|
||||
is VoiceMessageType,
|
||||
is ImageMessageType,
|
||||
is StickerMessageType,
|
||||
is FileMessageType,
|
||||
is LocationMessageType -> AnnotatedString::class.java
|
||||
is VoiceMessageType,
|
||||
is EmoteMessageType,
|
||||
is TextMessageType,
|
||||
is NoticeMessageType,
|
||||
@@ -176,7 +176,7 @@ class DefaultPinnedMessagesBannerFormatterTest {
|
||||
val expectedResult = when (type) {
|
||||
is VideoMessageType -> "Video: Shared body"
|
||||
is AudioMessageType -> "Audio: Shared body"
|
||||
is VoiceMessageType -> "Voice message: Shared body"
|
||||
is VoiceMessageType -> "Voice message"
|
||||
is ImageMessageType -> "Image: Shared body"
|
||||
is StickerMessageType -> "Sticker: Shared body"
|
||||
is FileMessageType -> "File: Shared body"
|
||||
|
||||
Reference in New Issue
Block a user