mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-01 05:47:10 +01:00
Fix bugs related to fetching blocked users
This commit is contained in:
parent
23d41846d0
commit
7877001533
@ -40,7 +40,10 @@ public class FetchBlockedThings {
|
|||||||
JSONObject blockedUserJson = blockedUsersJson.getJSONObject(i).getJSONObject("target");
|
JSONObject blockedUserJson = blockedUsersJson.getJSONObject(i).getJSONObject("target");
|
||||||
int id = blockedUserJson.getInt("id");
|
int id = blockedUserJson.getInt("id");
|
||||||
String name = blockedUserJson.getString("name");
|
String name = blockedUserJson.getString("name");
|
||||||
String avatar = blockedUserJson.getString("avatar");
|
String avatar = "";
|
||||||
|
if (blockedUserJson.has("avatar"))
|
||||||
|
avatar = blockedUserJson.getString("avatar");
|
||||||
|
|
||||||
String qualifiedName = LemmyUtils.actorID2FullName(blockedUserJson.getString("actor_id"));
|
String qualifiedName = LemmyUtils.actorID2FullName(blockedUserJson.getString("actor_id"));
|
||||||
BlockedUserData blockedUserData = new BlockedUserData(id, name, avatar, qualifiedName, accountName);
|
BlockedUserData blockedUserData = new BlockedUserData(id, name, avatar, qualifiedName, accountName);
|
||||||
|
|
||||||
|
@ -1094,8 +1094,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
mUserData = userData;
|
mUserData = userData;
|
||||||
username = userData.getName();
|
username = userData.getName();
|
||||||
setupVisibleElements();
|
setupVisibleElements();
|
||||||
new ViewUserDetailActivity.InsertUserDataAsyncTask(mRedditDataRoomDatabase.userDao(), userData,
|
|
||||||
() -> mFetchUserInfoSuccess = true).execute();
|
|
||||||
FetchBlockedThings.fetchBlockedThings(mRetrofit.getRetrofit(), mAccessToken, mAccountQualifiedName, new FetchBlockedThings.FetchBlockedThingsListener() {
|
FetchBlockedThings.fetchBlockedThings(mRetrofit.getRetrofit(), mAccessToken, mAccountQualifiedName, new FetchBlockedThings.FetchBlockedThingsListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1108,13 +1106,15 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
isBlocked = false;
|
isBlocked = false;
|
||||||
|
invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFetchBlockedThingsFailure() {
|
public void onFetchBlockedThingsFailure() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
new ViewUserDetailActivity.InsertUserDataAsyncTask(mRedditDataRoomDatabase.userDao(), userData,
|
||||||
|
() -> mFetchUserInfoSuccess = true).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user