Fixes issue #303 - Add the content of the toot + author name.

This commit is contained in:
stom79 2018-04-04 16:43:54 +02:00
parent 391a74d8f9
commit 85033b2215
1 changed files with 14 additions and 1 deletions

View File

@ -1382,7 +1382,20 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else
url = status.getUrl();
}
sendIntent.putExtra(Intent.EXTRA_TEXT, url);
String extra_text = (status.getReblog() != null)?status.getReblog().getAccount().getAcct():status.getAccount().getAcct();
if( extra_text.split("@").length == 1)
extra_text = "@" + extra_text + "@" + Helper.getLiveInstance(context);
else
extra_text = "@" + extra_text;
extra_text += " " + Helper.shortnameToUnicode(":link:",true) + " " + url + "\r\n-\n";
final String contentToot;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
contentToot = Html.fromHtml((status.getReblog() != null)?status.getReblog().getContent():status.getContent(), Html.FROM_HTML_MODE_LEGACY).toString();
else
//noinspection deprecation
contentToot = Html.fromHtml((status.getReblog() != null)?status.getReblog().getContent():status.getContent()).toString();
extra_text += contentToot;
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
sendIntent.setType("text/plain");
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
return true;