From 833ea5d0c3aefbcaa63738cf60d5aa81e63ab8f5 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 31 Jan 2023 18:11:22 +0100 Subject: [PATCH] Fix 103 response code for OG --- .../main/java/app/fedilab/android/BaseMainActivity.java | 7 +++++++ .../android/mastodon/ui/drawer/ComposeAdapter.java | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index 13a516b5..cb70a91c 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -793,6 +793,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt Request request = new Request.Builder() .url(potentialUrl) .build(); + String finalPotentialUrl = potentialUrl; client.newCall(request).enqueue(new Callback() { @Override public void onFailure(@NonNull Call call, @NonNull IOException e) { @@ -869,6 +870,12 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt } catch (Exception e) { e.printStackTrace(); } + } else if (response.code() == 103) { + activity.runOnUiThread(() -> { + Bundle b = new Bundle(); + b.putString(Helper.ARG_SHARE_DESCRIPTION, finalPotentialUrl); + CrossActionHelper.doCrossShare(activity, b); + }); } else { activity.runOnUiThread(() -> Toasty.warning(activity, activity.getString(R.string.toast_error), Toast.LENGTH_LONG).show()); } diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java index dce9f81d..ca474590 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java @@ -959,14 +959,14 @@ public class ComposeAdapter extends RecyclerView.Adapter 0) { if (url != null && !description.contains(url)) { - statusList.get(position).text += url + "\n"; + statusList.get(position).text += url + "\n>"; } - statusList.get(position).text += ">" + description + "\n\n"; + statusList.get(position).text += description + "\n\n"; } else if (content != null && content.trim().length() > 0) { if (!content.contains(url)) { - statusList.get(position).text += url + "\n"; + statusList.get(position).text += url + "\n>"; } - statusList.get(position).text += ">" + content + "\n\n"; + statusList.get(position).text += content + "\n\n"; } else { statusList.get(position).text += url + "\n\n"; }