From 53cd58c955f68582bbc38bfafb03274c8a629197 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 18 Sep 2018 17:03:08 +0200 Subject: [PATCH] fixed text sharing in direct sharing --- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 2 +- .../java/eu/siacs/conversations/ui/ConversationsActivity.java | 1 - .../java/eu/siacs/conversations/ui/ShareWithActivity.java | 2 +- src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 7b61ab471..a1112fda4 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1985,7 +1985,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke private void processExtras(Bundle extras) { final String downloadUuid = extras.getString(ConversationsActivity.EXTRA_DOWNLOAD_UUID); - final String text = extras.getString(ConversationsActivity.EXTRA_TEXT); + final String text = extras.getString(Intent.EXTRA_TEXT); final String nick = extras.getString(ConversationsActivity.EXTRA_NICK); final boolean asQuote = extras.getBoolean(ConversationsActivity.EXTRA_AS_QUOTE); final boolean pm = extras.getBoolean(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, false); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java index d0012f1d0..666026e5f 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsActivity.java @@ -89,7 +89,6 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio public static final String ACTION_VIEW_CONVERSATION = "eu.siacs.conversations.action.VIEW"; public static final String EXTRA_CONVERSATION = "conversationUuid"; public static final String EXTRA_DOWNLOAD_UUID = "eu.siacs.conversations.download_uuid"; - public static final String EXTRA_TEXT = "text"; public static final String EXTRA_AS_QUOTE = "as_quote"; public static final String EXTRA_NICK = "nick"; public static final String EXTRA_IS_PRIVATE_MESSAGE = "pm"; diff --git a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java index 8595fda95..bcd783ed2 100644 --- a/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java @@ -187,7 +187,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); } else if (share.text != null) { intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); - intent.putExtra(ConversationsActivity.EXTRA_TEXT, share.text); + intent.putExtra(Intent.EXTRA_TEXT, share.text); } startActivity(intent); finish(); diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index dce1826e6..9265bb736 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -473,9 +473,9 @@ public abstract class XmppActivity extends ActionBarActivity { intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid()); if (text != null) { - intent.putExtra(ConversationsActivity.EXTRA_TEXT, text); + intent.putExtra(Intent.EXTRA_TEXT, text); if (asQuote) { - intent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, asQuote); + intent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, true); } } if (nick != null) {