From bf702b742ee7ddb9e899915558c8330d6ca63e86 Mon Sep 17 00:00:00 2001 From: stom79 Date: Sat, 23 Feb 2019 09:14:09 +0100 Subject: [PATCH] Only put the status for reblog. That avoids too much management --- .../activities/CustomSharingActivity.java | 19 ++++++------------- .../mastodon/drawers/StatusListAdapter.java | 7 ++++++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/CustomSharingActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/CustomSharingActivity.java index 4a7301b11..e07fb876f 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/CustomSharingActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/CustomSharingActivity.java @@ -132,19 +132,11 @@ public class CustomSharingActivity extends BaseActivity implements OnCustomShari } - if (status.getReblog() != null) { - bundle_url = status.getReblog().getUrl(); - bundle_id = status.getReblog().getUri(); - bundle_source = status.getReblog().getAccount().getAcct(); - bundle_tags = status.getReblog().getTagsString(); - bundle_content = formatedContent(status.getReblog().getContent(), status.getReblog().getEmojis()); - } else { - bundle_url = status.getUrl(); - bundle_id = status.getUri(); - bundle_source = status.getAccount().getAcct(); - bundle_tags = status.getTagsString(); - bundle_content = formatedContent(status.getContent(), status.getEmojis()); - } + bundle_url = status.getUrl(); + bundle_id = status.getUri(); + bundle_source = status.getAccount().getAcct(); + bundle_tags = status.getTagsString(); + bundle_content = formatedContent(status.getContent(), status.getEmojis()); if (!bundle_source.contains("@")) { bundle_source = bundle_source + "@" + account.getInstance(); @@ -252,6 +244,7 @@ public class CustomSharingActivity extends BaseActivity implements OnCustomShari paramFound = true; builder.appendQueryParameter(param_name, keywords); break; + } if (!paramFound) { builder.appendQueryParameter(param_name, param_value); diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java index 1091aff1d..c23393574 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java @@ -2259,7 +2259,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct case R.id.action_custom_sharing: Intent intentCustomSharing = new Intent(context, CustomSharingActivity.class); Bundle bCustomSharing = new Bundle(); - bCustomSharing.putParcelable("status", status); + if (status.getReblog() != null) { + bCustomSharing.putParcelable("status", status.getReblog()); + } else { + bCustomSharing.putParcelable("status", status); + + } intentCustomSharing.putExtras(bCustomSharing); context.startActivity(intentCustomSharing); return true;