From 78ba616d500633bcc1a31601ddaf378d2bb26318 Mon Sep 17 00:00:00 2001 From: sowjanyakch Date: Mon, 25 Mar 2024 15:52:47 +0100 Subject: [PATCH] Add string message_last_edited_by Signed-off-by: sowjanyakch --- .../talk/ui/dialog/MessageActionsDialog.kt | 17 ++++++++++------- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt index 3b7f509e5..21654118b 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/MessageActionsDialog.kt @@ -51,12 +51,12 @@ import com.nextcloud.talk.models.json.chat.ChatMessage import com.nextcloud.talk.repositories.reactions.ReactionsRepository import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils -import com.nextcloud.talk.utils.SpreedFeatures +import com.nextcloud.talk.utils.CapabilitiesUtil +import com.nextcloud.talk.utils.CapabilitiesUtil.hasSpreedFeatureCapability import com.nextcloud.talk.utils.ConversationUtils import com.nextcloud.talk.utils.DateConstants import com.nextcloud.talk.utils.DateUtils -import com.nextcloud.talk.utils.CapabilitiesUtil -import com.nextcloud.talk.utils.CapabilitiesUtil.hasSpreedFeatureCapability +import com.nextcloud.talk.utils.SpreedFeatures import com.vanniktech.emoji.EmojiPopup import com.vanniktech.emoji.EmojiTextView import com.vanniktech.emoji.installDisableKeyboardInput @@ -386,10 +386,13 @@ class MessageActionsDialog( message.lastEditTimestamp * DateConstants.SECOND_DIVIDER ) - - val editorName = context.getString(R.string.nc_edited_by) + message.lastEditActorDisplayName - dialogMessageActionsBinding.editorName.setText(editorName) - dialogMessageActionsBinding.editedTime.setText(editedTime) + val lastEditorName = message.lastEditActorDisplayName ?: "" + val editorName = String.format( + context.getString(R.string.message_last_edited_by), + lastEditorName + ) + dialogMessageActionsBinding.editorName.text = editorName + dialogMessageActionsBinding.editedTime.text = editedTime } dialogMessageActionsBinding.menuMessageEditedInfo.visibility = getVisibility(showEditorDetails) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f73724ccb..4764b2357 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -798,8 +798,8 @@ How to translate with transifex: Conversation not found Add to Notes Edited by admin - "Edited by" Clear Edit Button Edit Icon Failed to fetch pending invitations + Edited by %1$s