mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Use "Shared live location" in formatter
This commit is contained in:
+5
-1
@@ -289,7 +289,11 @@ private fun MessageSummary(
|
|||||||
is TimelineItemRedactedContent,
|
is TimelineItemRedactedContent,
|
||||||
is TimelineItemUnknownContent -> content = { ContentForBody(textContent) }
|
is TimelineItemUnknownContent -> content = { ContentForBody(textContent) }
|
||||||
is TimelineItemLocationContent -> {
|
is TimelineItemLocationContent -> {
|
||||||
content = { ContentForBody(stringResource(CommonStrings.common_shared_location)) }
|
val body = when(event.content.mode) {
|
||||||
|
is TimelineItemLocationContent.Mode.Live -> stringResource(CommonStrings.common_shared_live_location)
|
||||||
|
is TimelineItemLocationContent.Mode.Static -> stringResource(CommonStrings.common_shared_location)
|
||||||
|
}
|
||||||
|
content = { ContentForBody(body) }
|
||||||
}
|
}
|
||||||
is TimelineItemImageContent -> {
|
is TimelineItemImageContent -> {
|
||||||
content = { ContentForBody(event.content.bestDescription) }
|
content = { ContentForBody(event.content.bestDescription) }
|
||||||
|
|||||||
+4
-1
@@ -41,7 +41,10 @@ class DefaultMessageSummaryFormatter(
|
|||||||
is TimelineItemTextBasedContent -> content.plainText
|
is TimelineItemTextBasedContent -> content.plainText
|
||||||
is TimelineItemProfileChangeContent -> content.body
|
is TimelineItemProfileChangeContent -> content.body
|
||||||
is TimelineItemStateContent -> content.body
|
is TimelineItemStateContent -> content.body
|
||||||
is TimelineItemLocationContent -> context.getString(CommonStrings.common_shared_location)
|
is TimelineItemLocationContent -> when(content.mode) {
|
||||||
|
is TimelineItemLocationContent.Mode.Live -> context.getString(CommonStrings.common_shared_live_location)
|
||||||
|
is TimelineItemLocationContent.Mode.Static -> context.getString(CommonStrings.common_shared_location)
|
||||||
|
}
|
||||||
is TimelineItemEncryptedContent -> context.getString(CommonStrings.common_unable_to_decrypt)
|
is TimelineItemEncryptedContent -> context.getString(CommonStrings.common_unable_to_decrypt)
|
||||||
is TimelineItemRedactedContent -> context.getString(CommonStrings.common_message_removed)
|
is TimelineItemRedactedContent -> context.getString(CommonStrings.common_message_removed)
|
||||||
is TimelineItemPollContent -> content.question
|
is TimelineItemPollContent -> content.question
|
||||||
|
|||||||
+1
-1
@@ -117,7 +117,7 @@ class DefaultRoomLatestEventFormatter(
|
|||||||
message.prefixIfNeeded(senderDisambiguatedDisplayName, isDmRoom, isOutgoing)
|
message.prefixIfNeeded(senderDisambiguatedDisplayName, isDmRoom, isOutgoing)
|
||||||
}
|
}
|
||||||
is LiveLocationContent -> {
|
is LiveLocationContent -> {
|
||||||
val message = sp.getString(CommonStrings.common_shared_location)
|
val message = sp.getString(CommonStrings.common_shared_live_location)
|
||||||
message.prefixIfNeeded(senderDisambiguatedDisplayName, isDmRoom, isOutgoing)
|
message.prefixIfNeeded(senderDisambiguatedDisplayName, isDmRoom, isOutgoing)
|
||||||
}
|
}
|
||||||
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_unsupported_call)
|
is LegacyCallInviteContent -> sp.getString(CommonStrings.common_unsupported_call)
|
||||||
|
|||||||
Reference in New Issue
Block a user