fixed text sharing in direct sharing

This commit is contained in:
Daniel Gultsch 2018-09-18 17:03:08 +02:00
parent 6ede6c7f85
commit 53cd58c955
4 changed files with 4 additions and 5 deletions

View File

@ -1985,7 +1985,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
private void processExtras(Bundle extras) { private void processExtras(Bundle extras) {
final String downloadUuid = extras.getString(ConversationsActivity.EXTRA_DOWNLOAD_UUID); 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 String nick = extras.getString(ConversationsActivity.EXTRA_NICK);
final boolean asQuote = extras.getBoolean(ConversationsActivity.EXTRA_AS_QUOTE); final boolean asQuote = extras.getBoolean(ConversationsActivity.EXTRA_AS_QUOTE);
final boolean pm = extras.getBoolean(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, false); final boolean pm = extras.getBoolean(ConversationsActivity.EXTRA_IS_PRIVATE_MESSAGE, false);

View File

@ -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 ACTION_VIEW_CONVERSATION = "eu.siacs.conversations.action.VIEW";
public static final String EXTRA_CONVERSATION = "conversationUuid"; public static final String EXTRA_CONVERSATION = "conversationUuid";
public static final String EXTRA_DOWNLOAD_UUID = "eu.siacs.conversations.download_uuid"; 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_AS_QUOTE = "as_quote";
public static final String EXTRA_NICK = "nick"; public static final String EXTRA_NICK = "nick";
public static final String EXTRA_IS_PRIVATE_MESSAGE = "pm"; public static final String EXTRA_IS_PRIVATE_MESSAGE = "pm";

View File

@ -187,7 +187,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
} else if (share.text != null) { } else if (share.text != null) {
intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION);
intent.putExtra(ConversationsActivity.EXTRA_TEXT, share.text); intent.putExtra(Intent.EXTRA_TEXT, share.text);
} }
startActivity(intent); startActivity(intent);
finish(); finish();

View File

@ -473,9 +473,9 @@ public abstract class XmppActivity extends ActionBarActivity {
intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION); intent.setAction(ConversationsActivity.ACTION_VIEW_CONVERSATION);
intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid()); intent.putExtra(ConversationsActivity.EXTRA_CONVERSATION, conversation.getUuid());
if (text != null) { if (text != null) {
intent.putExtra(ConversationsActivity.EXTRA_TEXT, text); intent.putExtra(Intent.EXTRA_TEXT, text);
if (asQuote) { if (asQuote) {
intent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, asQuote); intent.putExtra(ConversationsActivity.EXTRA_AS_QUOTE, true);
} }
} }
if (nick != null) { if (nick != null) {