Ver código fonte

enable to set mention chip for email guests 2

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 8 meses atrás
pai
commit
02d0a65909

+ 2 - 1
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 + "\""
                 }

+ 1 - 1
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"]

+ 1 - 1
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
                 )