Fix issue with "in reply to" link

This commit is contained in:
Benoit Marty 2019-12-20 10:54:48 +01:00
parent c992d32afd
commit 3b0624ea40

View file

@ -46,11 +46,16 @@ class MxLinkTagHandler(private val glideRequests: GlideRequests,
MatrixItem.UserItem(permalinkData.userId, user?.displayName, user?.avatarUrl) MatrixItem.UserItem(permalinkData.userId, user?.displayName, user?.avatarUrl)
} }
is PermalinkData.RoomLink -> { is PermalinkData.RoomLink -> {
val room: RoomSummary? = sessionHolder.getSafeActiveSession()?.getRoomSummary(permalinkData.roomIdOrAlias) // Exclude event link (used in reply event)
if (permalinkData.isRoomAlias) { if (permalinkData.eventId == null) {
MatrixItem.RoomAliasItem(permalinkData.roomIdOrAlias, room?.displayName, room?.avatarUrl) val room: RoomSummary? = sessionHolder.getSafeActiveSession()?.getRoomSummary(permalinkData.roomIdOrAlias)
if (permalinkData.isRoomAlias) {
MatrixItem.RoomAliasItem(permalinkData.roomIdOrAlias, room?.displayName, room?.avatarUrl)
} else {
MatrixItem.RoomItem(permalinkData.roomIdOrAlias, room?.displayName, room?.avatarUrl)
}
} else { } else {
MatrixItem.RoomItem(permalinkData.roomIdOrAlias, room?.displayName, room?.avatarUrl) null
} }
} }
is PermalinkData.GroupLink -> { is PermalinkData.GroupLink -> {