From 02d0a65909069f0a240dee03bfcab9d74ed5dbd1 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 19 Nov 2024 21:57:05 +0100 Subject: [PATCH] enable to set mention chip for email guests 2 Signed-off-by: Marcel Hibbe --- .../main/java/com/nextcloud/talk/chat/MessageInputFragment.kt | 3 ++- .../main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt | 2 +- app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.kt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt index fcbe494c9..87f7a8fd2 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt @@ -856,7 +856,8 @@ class MessageInputFragment : Fragment() { val shouldQuote = mentionId.contains(" ") || mentionId.contains("@") || mentionId.startsWith("guest/") || - mentionId.startsWith("group/") + mentionId.startsWith("group/") || + mentionId.startsWith("email/") if (shouldQuote) { mentionId = "\"" + mentionId + "\"" } diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt index c8f2da614..6a7a70f31 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatUtils.kt @@ -29,7 +29,7 @@ class ChatUtils { if (individualHashMap != null) { val type = individualHashMap["type"] - resultMessage = if (type == "user" || type == "guest" || type == "call") { + resultMessage = if (type == "user" || type == "guest" || type == "call" || type == "email") { resultMessage?.replace("{$key}", "@" + individualHashMap["name"]) } else if (type == "geo-location") { individualHashMap["name"] diff --git a/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.kt index 532f830bf..cb8268cab 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.kt @@ -176,7 +176,7 @@ object DisplayUtils { chip.setBounds(0, 0, chip.intrinsicWidth, chip.intrinsicHeight) if (!isCallOrGroup) { var url = getUrlForAvatar(conversationUser.baseUrl, id, false) - if ("guests" == type || "guest" == type) { + if ("guests" == type || "guest" == type || "email" == type) { url = getUrlForGuestAvatar( conversationUser.baseUrl, label.toString(), true )