Explorar o código

Remove media in text message detection

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 <t@timkrueger.me>
Tim Krüger %!s(int64=3) %!d(string=hai) anos
pai
achega
4c4c583923

+ 3 - 1
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 <t@timkrueger.me>
  * Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
  *
  * 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<String, String> getSelectedIndividualHashMap() {