Skip to content

Commit

Permalink
Fix stickers display text on room summary (#3221)
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Antonio Alvarez <[email protected]>
  • Loading branch information
surakin authored Jul 19, 2024
1 parent 344e07b commit 3a9830f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
}
}
is StickerContent -> {
content.body
prefixIfNeeded(sp.getString(CommonStrings.common_sticker) + " (" + content.body + ")", senderDisambiguatedDisplayName, isDmRoom)
}
is UnableToDecryptContent -> {
val message = sp.getString(CommonStrings.common_waiting_for_decryption_key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ class DefaultRoomLastMessageFormatterTest {
@Test
@Config(qualifiers = "en")
fun `Sticker content`() {
val body = "body"
val body = "a sticker body"
val info = ImageInfo(null, null, null, null, null, null, null)
val message = createRoomEvent(false, null, StickerContent(body, info, aMediaSource(url = "url")))
val result = formatter.format(message, false)
assertThat(result).isEqualTo(body)
val expectedBody = someoneElseId.toString() + ": Sticker (a sticker body)"
assertThat(result.toString()).isEqualTo(expectedBody)
}

@Test
Expand Down

0 comments on commit 3a9830f

Please sign in to comment.