mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-12 03:07:11 +01:00
Following and unfollowing users are now properly implemented.
This commit is contained in:
parent
dc35c8fc9c
commit
0bd0639a4e
@ -27,7 +27,6 @@ public class ParseUserData {
|
|||||||
|
|
||||||
ParseUserDataAsyncTask(String response, ParseUserDataListener parseUserDataListener){
|
ParseUserDataAsyncTask(String response, ParseUserDataListener parseUserDataListener){
|
||||||
try {
|
try {
|
||||||
Log.i("response", response);
|
|
||||||
jsonResponse = new JSONObject(response);
|
jsonResponse = new JSONObject(response);
|
||||||
this.parseUserDataListener = parseUserDataListener;
|
this.parseUserDataListener = parseUserDataListener;
|
||||||
parseFailed = false;
|
parseFailed = false;
|
||||||
|
@ -47,7 +47,6 @@ public class RedditUtils {
|
|||||||
|
|
||||||
static final String ACTION_KEY = "action";
|
static final String ACTION_KEY = "action";
|
||||||
static final String SR_NAME_KEY = "sr_name";
|
static final String SR_NAME_KEY = "sr_name";
|
||||||
static final String SR_KEY = "sr";
|
|
||||||
|
|
||||||
static Map<String, String> getHttpBasicAuthHeader() {
|
static Map<String, String> getHttpBasicAuthHeader() {
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
|
@ -46,7 +46,7 @@ class UserFollowing {
|
|||||||
|
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
params.put(RedditUtils.ACTION_KEY, action);
|
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);
|
Call<String> subredditSubscriptionCall = api.subredditSubscription(RedditUtils.getOAuthHeader(accessToken), params);
|
||||||
subredditSubscriptionCall.enqueue(new Callback<String>() {
|
subredditSubscriptionCall.enqueue(new Callback<String>() {
|
||||||
|
@ -130,7 +130,7 @@ public class ViewUserDetailActivity extends AppCompatActivity {
|
|||||||
subscribeUserChip.setOnClickListener(view -> {
|
subscribeUserChip.setOnClickListener(view -> {
|
||||||
if(subscriptionReady) {
|
if(subscriptionReady) {
|
||||||
subscriptionReady = false;
|
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,
|
UserFollowing.followUser(mOauthRetrofit, mRetrofit, sharedPreferences,
|
||||||
userName, subscribedUserDao, new UserFollowing.UserFollowingListener() {
|
userName, subscribedUserDao, new UserFollowing.UserFollowingListener() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user