show correct username of author when sharing toot content

closes #918
This commit is contained in:
Conny Duck 2018-12-03 15:22:51 +01:00
parent afaaafdace
commit aae72205c3

View file

@ -173,14 +173,16 @@ public abstract class SFragment extends BaseFragment {
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.status_share_content: { case R.id.status_share_content: {
StringBuilder sb = new StringBuilder(); Status statusToShare = status;
sb.append(status.getAccount().getUsername()); if(statusToShare.getReblog() != null) statusToShare = statusToShare.getReblog();
sb.append(" - ");
sb.append(status.getContent().toString());
Intent sendIntent = new Intent(); Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND); sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, sb.toString());
String stringToShare = statusToShare.getAccount().getUsername() +
" - " +
statusToShare.getContent().toString();
sendIntent.putExtra(Intent.EXTRA_TEXT, stringToShare);
sendIntent.setType("text/plain"); sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_content_to))); startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_content_to)));
return true; return true;