From 0f1ddda001804aebdedd90a7f12d8de0eea4a2d4 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Wed, 2 Sep 2020 13:34:29 -0400 Subject: [PATCH] final resolution --- .../java/awais/instagrabber/MainHelper.java | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/MainHelper.java b/app/src/main/java/awais/instagrabber/MainHelper.java index c81bd3a9..8af5e4a9 100755 --- a/app/src/main/java/awais/instagrabber/MainHelper.java +++ b/app/src/main/java/awais/instagrabber/MainHelper.java @@ -1414,10 +1414,9 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener { ? mainActivity.locationModel.getName() : mainActivity.userQuery.replaceAll("^@", ""))); onRefresh(); -<<<<<<< HEAD } else if (v == mainActivity.mainBinding.profileView.btnFollow) { if (mainActivity.profileModel.isPrivate() && mainActivity.profileModel.getFollowing()) { - new AlertDialog.Builder(main) + new AlertDialog.Builder(mainActivity) .setTitle(R.string.priv_acc) .setMessage(R.string.priv_acc_confirm) .setNegativeButton(R.string.no, null) @@ -1426,25 +1425,6 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener { } else new ProfileAction().execute("follow"); } else if (v == mainActivity.mainBinding.profileView.btnRestrict && isLoggedIn) { -||||||| merged common ancestors - } else if (v == main.mainBinding.profileView.btnFollow) { - new ProfileAction().execute("follow"); - } else if (v == main.mainBinding.profileView.btnRestrict && isLoggedIn) { -======= - } else if (v == main.mainBinding.profileView.btnFollow) { - if (main.profileModel.isPrivate() && main.profileModel.getFollowing()) { - new AlertDialog.Builder(main) - .setTitle(R.string.priv_acc) - .setMessage(R.string.priv_acc_confirm) - .setNegativeButton(R.string.no, null) - .setPositiveButton(R.string.yes, (dialog, which) -> new ProfileAction().execute("follow")) - .show(); - } - else { - new ProfileAction().execute("follow"); - } - } else if (v == main.mainBinding.profileView.btnRestrict && isLoggedIn) { ->>>>>>> 44db2db57f4461bbffa160e26cd734fb07f3b930 new ProfileAction().execute("restrict"); } else if (v == mainActivity.mainBinding.profileView.btnSaved && !isSelf) { new ProfileAction().execute("block"); @@ -1475,7 +1455,6 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener { protected Void doInBackground(String... rawAction) { action = rawAction[0]; -<<<<<<< HEAD final String url = "https://www.instagram.com/web/" + (action.equals("followtag") && mainActivity.hashtagModel != null ? "tags/" + (mainActivity.hashtagModel.getFollowing() ? "unfollow/" @@ -1501,31 +1480,6 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener { .getBlocked() ? "unblock/" : "block/")); -||||||| merged common ancestors - final String url = "https://www.instagram.com/web/"+ - ((action == "followtag" && main.hashtagModel != null) ? ("tags/"+ - (main.hashtagModel.getFollowing() == true ? "unfollow/" : "follow/")+main.hashtagModel.getName()+"/") : ( - ((action == "restrict" && main.profileModel != null) ? "restrict_action" : ("friendships/"+main.profileModel.getId()))+"/"+ - ((action == "follow" && main.profileModel != null) ? - ((main.profileModel.getFollowing() == true || - (main.profileModel.getFollowing() == false && main.profileModel.getRequested() == true)) - ? "unfollow/" : "follow/") : - ((action == "restrict" && main.profileModel != null) ? - (main.profileModel.getRestricted() == true ? "unrestrict/" : "restrict/") : - (main.profileModel.getBlocked() == true ? "unblock/" : "block/"))))); -======= - final String url = "https://www.instagram.com/web/"+ - ((action == "followtag" && main.hashtagModel != null) ? ("tags/"+ - (main.hashtagModel.getFollowing() ? "unfollow/" : "follow/")+main.hashtagModel.getName()+"/") : ( - ((action == "restrict" && main.profileModel != null) ? "restrict_action" : ("friendships/"+main.profileModel.getId()))+"/"+ - ((action == "follow" && main.profileModel != null) ? - ((main.profileModel.getFollowing() || - (main.profileModel.getFollowing() == false && main.profileModel.getRequested() == true)) - ? "unfollow/" : "follow/") : - ((action == "restrict" && main.profileModel != null) ? - (main.profileModel.getRestricted() ? "unrestrict/" : "restrict/") : - (main.profileModel.getBlocked() ? "unblock/" : "block/"))))); ->>>>>>> 44db2db57f4461bbffa160e26cd734fb07f3b930 try { final HttpURLConnection urlConnection = (HttpURLConnection) new URL(url).openConnection(); urlConnection.setRequestMethod("POST");