diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConversationFragment.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index ae0b1781e..2379afad2 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -2247,8 +2247,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke final boolean doNotAppend = extras.getBoolean(ConversationsActivity.EXTRA_DO_NOT_APPEND, false); final List<Uri> uris = extractUris(extras); if (uris != null && uris.size() > 0) { - final List<Uri> cleanedUris = cleanUris(new ArrayList<>(uris)); - mediaPreviewAdapter.addMediaPreviews(Attachment.of(getActivity(), cleanedUris)); + if (uris.size() == 1 && "geo".equals(uris.get(0).getScheme())) { + mediaPreviewAdapter.addMediaPreviews(Attachment.of(getActivity(), uris.get(0), Attachment.Type.LOCATION)); + } else { + final List<Uri> cleanedUris = cleanUris(new ArrayList<>(uris)); + mediaPreviewAdapter.addMediaPreviews(Attachment.of(getActivity(), cleanedUris)); + } toggleInputMethod(); return; } @@ -2268,7 +2272,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } } } else { - if (text != null && asQuote) { + if (text != null && GeoHelper.GEO_URI.matcher(text).matches()) { + mediaPreviewAdapter.addMediaPreviews(Attachment.of(getActivity(), Uri.parse(text), Attachment.Type.LOCATION)); + toggleInputMethod(); + return; + } else if (text != null && asQuote) { quoteText(text); } else { appendText(text, doNotAppend); |