Drop the sender's name from the room list preview of two-person rooms

The room list preview prefixes the sender's name unless the room is a
direct message. A room that was created as a group and later converted to
a direct message is not marked as one by the server, so its preview kept
naming the only other person in it on every message, while iOS did not.

The prefix now depends on how many people are actually in the room rather
than on the direct message flag, which is the behaviour asked for in the
issue: no name while only two people can be talking, the name back as
soon as a third joins.

Part of #1548
This commit is contained in:
hayaksi1
2026-08-25 20:55:38 +03:00
parent a2d3488426
commit 65c2cd8a79
3 changed files with 37 additions and 1 deletions
@@ -14,11 +14,16 @@ import io.element.android.libraries.matrix.api.roomlist.LatestEventValue
class FakeRoomLatestEventFormatter : RoomLatestEventFormatter {
private var result: CharSequence? = null
var lastIsDmRoom: Boolean? = null
private set
override fun format(latestEvent: LatestEventValue.Local, isDmRoom: Boolean): CharSequence? {
lastIsDmRoom = isDmRoom
return result
}
override fun format(latestEvent: LatestEventValue.Remote, isDmRoom: Boolean): CharSequence? {
lastIsDmRoom = isDmRoom
return result
}