Fix stickers display text on room summary (#3221)
Signed-off-by: Marco Antonio Alvarez <surakin@gmail.com>
This commit is contained in:
parent
bc87ff01cf
commit
cdcaace227
2 changed files with 4 additions and 3 deletions
|
|
@ -85,7 +85,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is StickerContent -> {
|
is StickerContent -> {
|
||||||
content.body
|
prefixIfNeeded(sp.getString(CommonStrings.common_sticker) + " (" + content.body + ")", senderDisambiguatedDisplayName, isDmRoom)
|
||||||
}
|
}
|
||||||
is UnableToDecryptContent -> {
|
is UnableToDecryptContent -> {
|
||||||
val message = sp.getString(CommonStrings.common_waiting_for_decryption_key)
|
val message = sp.getString(CommonStrings.common_waiting_for_decryption_key)
|
||||||
|
|
|
||||||
|
|
@ -105,11 +105,12 @@ class DefaultRoomLastMessageFormatterTest {
|
||||||
@Test
|
@Test
|
||||||
@Config(qualifiers = "en")
|
@Config(qualifiers = "en")
|
||||||
fun `Sticker content`() {
|
fun `Sticker content`() {
|
||||||
val body = "body"
|
val body = "a sticker body"
|
||||||
val info = ImageInfo(null, null, null, null, null, null, null)
|
val info = ImageInfo(null, null, null, null, null, null, null)
|
||||||
val message = createRoomEvent(false, null, StickerContent(body, info, aMediaSource(url = "url")))
|
val message = createRoomEvent(false, null, StickerContent(body, info, aMediaSource(url = "url")))
|
||||||
val result = formatter.format(message, false)
|
val result = formatter.format(message, false)
|
||||||
assertThat(result).isEqualTo(body)
|
val expectedBody = someoneElseId.toString() + ": Sticker (a sticker body)"
|
||||||
|
assertThat(result.toString()).isEqualTo(expectedBody)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue