From aae72205c34af669d12eee293cddd9668e51550c Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Mon, 3 Dec 2018 15:22:51 +0100 Subject: [PATCH] show correct username of author when sharing toot content closes #918 --- .../com/keylesspalace/tusky/fragment/SFragment.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java index 8178c32d..f91b5380 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java @@ -173,14 +173,16 @@ public abstract class SFragment extends BaseFragment { popup.setOnMenuItemClickListener(item -> { switch (item.getItemId()) { case R.id.status_share_content: { - StringBuilder sb = new StringBuilder(); - sb.append(status.getAccount().getUsername()); - sb.append(" - "); - sb.append(status.getContent().toString()); + Status statusToShare = status; + if(statusToShare.getReblog() != null) statusToShare = statusToShare.getReblog(); Intent sendIntent = new Intent(); 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"); startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_status_content_to))); return true;