mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-05 19:52:34 +02:00
Caching channel info JSON parse in NoteCompose.
This commit is contained in:
@@ -246,30 +246,32 @@ fun ChatroomMessageCompose(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
val event = note.event
|
val event = note.event
|
||||||
if (event is ChannelCreateEvent) {
|
if (event is ChannelCreateEvent) {
|
||||||
|
val channelInfo = event.channelInfo()
|
||||||
Text(
|
Text(
|
||||||
text = note.author?.toBestDisplayName()
|
text = note.author?.toBestDisplayName()
|
||||||
.toString() + " ${stringResource(R.string.created)} " + (
|
.toString() + " ${stringResource(R.string.created)} " + (
|
||||||
event.channelInfo().name
|
channelInfo.name
|
||||||
?: ""
|
?: ""
|
||||||
) + " ${stringResource(R.string.with_description_of)} '" + (
|
) + " ${stringResource(R.string.with_description_of)} '" + (
|
||||||
event.channelInfo().about
|
channelInfo.about
|
||||||
?: ""
|
?: ""
|
||||||
) + "', ${stringResource(R.string.and_picture)} '" + (
|
) + "', ${stringResource(R.string.and_picture)} '" + (
|
||||||
event.channelInfo().picture
|
channelInfo.picture
|
||||||
?: ""
|
?: ""
|
||||||
) + "'"
|
) + "'"
|
||||||
)
|
)
|
||||||
} else if (event is ChannelMetadataEvent) {
|
} else if (event is ChannelMetadataEvent) {
|
||||||
|
val channelInfo = event.channelInfo()
|
||||||
Text(
|
Text(
|
||||||
text = note.author?.toBestDisplayName()
|
text = note.author?.toBestDisplayName()
|
||||||
.toString() + " ${stringResource(R.string.changed_chat_name_to)} '" + (
|
.toString() + " ${stringResource(R.string.changed_chat_name_to)} '" + (
|
||||||
event.channelInfo().name
|
channelInfo.name
|
||||||
?: ""
|
?: ""
|
||||||
) + "$', {stringResource(R.string.description_to)} '" + (
|
) + "$', {stringResource(R.string.description_to)} '" + (
|
||||||
event.channelInfo().about
|
channelInfo.about
|
||||||
?: ""
|
?: ""
|
||||||
) + "', ${stringResource(R.string.and_picture_to)} '" + (
|
) + "', ${stringResource(R.string.and_picture_to)} '" + (
|
||||||
event.channelInfo().picture
|
channelInfo.picture
|
||||||
?: ""
|
?: ""
|
||||||
) + "'"
|
) + "'"
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user