aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-01-11 07:41:38 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-01-11 07:41:38 +0000
commit0bd0639a4ed270524443c637be9320eb822cc0cf (patch)
tree41c0b0d36499f444c0b4771bad7e78be8be9d4b9
parentdc35c8fc9c21bbf7458a182942a409f3e00ecf3e (diff)
downloadinfinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.tar
infinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.tar.gz
infinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.tar.bz2
infinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.tar.lz
infinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.tar.xz
infinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.tar.zst
infinity-for-reddit-0bd0639a4ed270524443c637be9320eb822cc0cf.zip
Following and unfollowing users are now properly implemented.
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/RedditUtils.java1
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java2
4 files changed, 2 insertions, 4 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java
index 12402f03..4666ffef 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java
@@ -27,7 +27,6 @@ public class ParseUserData {
ParseUserDataAsyncTask(String response, ParseUserDataListener parseUserDataListener){
try {
- Log.i("response", response);
jsonResponse = new JSONObject(response);
this.parseUserDataListener = parseUserDataListener;
parseFailed = false;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditUtils.java
index 44c46d7e..d598f684 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditUtils.java
@@ -47,7 +47,6 @@ public class RedditUtils {
static final String ACTION_KEY = "action";
static final String SR_NAME_KEY = "sr_name";
- static final String SR_KEY = "sr";
static Map<String, String> getHttpBasicAuthHeader() {
Map<String, String> params = new HashMap<>();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java
index c5af5a26..56040fa8 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java
@@ -46,7 +46,7 @@ class UserFollowing {
Map<String, String> params = new HashMap<>();
params.put(RedditUtils.ACTION_KEY, action);
- params.put(RedditUtils.SR_KEY, "u/" + userName);
+ params.put(RedditUtils.SR_NAME_KEY, "u_" + userName);
Call<String> subredditSubscriptionCall = api.subredditSubscription(RedditUtils.getOAuthHeader(accessToken), params);
subredditSubscriptionCall.enqueue(new Callback<String>() {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java
index 8b3fa0a1..636bb98a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java
@@ -130,7 +130,7 @@ public class ViewUserDetailActivity extends AppCompatActivity {
subscribeUserChip.setOnClickListener(view -> {
if(subscriptionReady) {
subscriptionReady = false;
- if(subscribeUserChip.getText().equals(getResources().getString(R.string.subscribe))) {
+ if(subscribeUserChip.getText().equals(getResources().getString(R.string.follow))) {
UserFollowing.followUser(mOauthRetrofit, mRetrofit, sharedPreferences,
userName, subscribedUserDao, new UserFollowing.UserFollowingListener() {
@Override