Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Quote in a room :
Browse files Browse the repository at this point in the history
The quote is used in the current room. it is not anymore forwarded.
  • Loading branch information
ylecollen committed Sep 2, 2016
1 parent c35dcd3 commit 9d67090
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,15 @@ private void appendInTextEditor(String text) {
}
}

/**
* Init the edited with a provided text
* @param text the text
*/
public void initEditText(String text) {
mEditText.setText("");
mEditText.append(text);
}

//================================================================================
// Notifications area management (... is typing and so on)
//================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ public void onClick(DialogInterface dialog, int which) {
.show();
}
});
} else if ((action == R.id.ic_action_vector_quote) || (action == R.id.ic_action_vector_share) || (action == R.id.ic_action_vector_forward) || (action == R.id.ic_action_vector_save)) {
} else if (action == R.id.ic_action_vector_quote) {
Activity attachedActivity = getActivity();

if ((null != attachedActivity) && (attachedActivity instanceof VectorRoomActivity)) {
Message message = JsonUtils.toMessage(event.content);
((VectorRoomActivity)attachedActivity).initEditText( "> " + message.body + "\n\n");
}
} else if ((action == R.id.ic_action_vector_share) || (action == R.id.ic_action_vector_forward) || (action == R.id.ic_action_vector_save)) {
//
Message message = JsonUtils.toMessage(event.content);

Expand Down Expand Up @@ -335,11 +342,7 @@ public void onClick(DialogInterface dialog, int which) {
final Intent sendIntent = new Intent();

sendIntent.setAction(Intent.ACTION_SEND);
if (action == R.id.ic_action_vector_quote) {
sendIntent.putExtra(Intent.EXTRA_TEXT, "> " + message.body);
} else {
sendIntent.putExtra(Intent.EXTRA_TEXT, message.body);
}
sendIntent.putExtra(Intent.EXTRA_TEXT, message.body);
sendIntent.setType("text/plain");

if ((action == R.id.ic_action_vector_forward) ||(action == R.id.ic_action_vector_quote)) {
Expand Down

0 comments on commit 9d67090

Please sign in to comment.