Commit 60a1b2bf authored by Thomas's avatar Thomas
Browse files

Fix issue #276 - Problem when sharing text with URL

parent 3883af2f
Loading
Loading
Loading
Loading
+99 −91
Original line number Diff line number Diff line
@@ -852,6 +852,12 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
                    boolean fetchSharedMedia = sharedpreferences.getBoolean(getString(R.string.SET_RETRIEVE_METADATA_IF_URL_FROM_EXTERAL), true);
                    boolean fetchShareContent = sharedpreferences.getBoolean(getString(R.string.SET_SHARE_DETAILS), true);
                    if (url[0] != null && count == 1 && (fetchShareContent || fetchSharedMedia)) {
                        if (!url[0].trim().equalsIgnoreCase(sharedText.trim())) {
                            Bundle b = new Bundle();
                            b.putString(Helper.ARG_SHARE_TITLE, sharedSubject);
                            b.putString(Helper.ARG_SHARE_DESCRIPTION, sharedText);
                            CrossActionHelper.doCrossShare(BaseMainActivity.this, b);
                        } else {
                            new Thread(() -> {
                                if (url[0].startsWith("www."))
                                    url[0] = "http://" + url[0];
@@ -949,6 +955,8 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt

                                }
                            }).start();
                        }

                    } else {
                        Bundle b = new Bundle();
                        b.putString(Helper.ARG_SHARE_TITLE, sharedSubject);
+1 −1
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
        }
        if (description != null && description.trim().length() > 0) {
            statusList.get(position).text += description + "\n\n";
            if (!description.contains(url)) {
            if (url != null && !description.contains(url)) {
                statusList.get(position).text += url;
            }
        } else if (content != null && content.trim().length() > 0) {