forked from mirrors/Fedilab
Fix 103 response code for OG
This commit is contained in:
parent
04c5f32c53
commit
833ea5d0c3
2 changed files with 11 additions and 4 deletions
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -959,14 +959,14 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
}
|
||||
if (description != null && description.trim().length() > 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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue