From 75d82185c18943d4a2e35fbcb71d594820033cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kr=C3=BCger?= Date: Wed, 14 Jul 2021 09:26:17 +0200 Subject: [PATCH] Remove media in text message detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method 'TextMatchers#getMessageTypeFromString' suggested MIME types for linked files in text message. Also for links like this not working example: - http://example.local/image.png - image.png In those cases no image can be loaded and that results in empty previews like shown in the issue #1167. So for alignment reasons to spreed and Talk iOS app this media detection is removed and only links will be shown. Resolves: #1167 Signed-off-by: Tim Krüger --- .../java/com/nextcloud/talk/models/json/chat/ChatMessage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.java index 41c5c48c3..700db89ed 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.java @@ -2,6 +2,8 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Tim Krüger + * Copyright (C) 2021 Tim Krüger * Copyright (C) 2017-2018 Mario Danic * * This program is free software: you can redistribute it and/or modify @@ -180,7 +182,7 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image } - return TextMatchers.getMessageTypeFromString(getText()); + return MessageType.REGULAR_TEXT_MESSAGE; } public Map getSelectedIndividualHashMap() {