Skip to content

Commit

Permalink
Fix trail display (from instead of to for incoming types)
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Apr 22, 2022
1 parent 5f865c1 commit 6fdd37e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GossipingTrailPagedEpoxyController @Inject constructor(
description(
span {
+host.vectorDateFormatter.format(event.ageLocalTs, DateFormatKind.DEFAULT_DATE_AND_TIME)
span("\nfrom: ") {
span("\n${host.senderFromTo(event.type)}: ") {
textStyle = "bold"
}
+"${event.info.userId}|${event.info.deviceId}"
Expand Down Expand Up @@ -101,4 +101,14 @@ class GossipingTrailPagedEpoxyController @Inject constructor(
)
}
}

private fun senderFromTo(type: TrailType): String {
return when (type) {
TrailType.OutgoingKeyWithheld,
TrailType.OutgoingKeyForward -> "to"
TrailType.IncomingKeyRequest,
TrailType.IncomingKeyForward -> "from"
TrailType.Unknown -> ""
}
}
}

0 comments on commit 6fdd37e

Please sign in to comment.