mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 20:57:25 +01:00
Prepare to add quarantined subreddit support.
This commit is contained in:
parent
b7b9a7f3bd
commit
36c7cfcc6b
@ -935,7 +935,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSubredditDataFail() {
|
||||
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||
mRespectSubredditRecommendedSortType = false;
|
||||
ViewPostDetailActivity.this.sortType = mSortTypeSharedPreferences.getString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, SortType.Type.BEST.value.toUpperCase());
|
||||
if (ViewPostDetailActivity.this.sortType != null) {
|
||||
|
@ -519,7 +519,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSubredditDataFail() {
|
||||
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||
makeSnackbar(R.string.cannot_fetch_subreddit_info, true);
|
||||
mFetchSubredditInfoSuccess = false;
|
||||
}
|
||||
|
@ -346,4 +346,7 @@ public interface RedditAPI {
|
||||
Call<String> addSubredditToMultiReddit(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params,
|
||||
@Path(value = "multipath", encoded = true) String multipath, @Path("subredditName") String subredditName);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("/api/quarantine_optin?raw_json=1")
|
||||
Call<String> optInQuarantinedSubreddit(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public class LoadSubredditIconAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSubredditDataFail() {
|
||||
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||
loadSubredditIconAsyncTaskListener.loadIconSuccess(null);
|
||||
}
|
||||
});
|
||||
|
@ -193,7 +193,7 @@ public class SidebarFragment extends Fragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSubredditDataFail() {
|
||||
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
Toast.makeText(activity, R.string.cannot_fetch_sidebar, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
@ -31,17 +31,17 @@ public class FetchSubredditData {
|
||||
|
||||
@Override
|
||||
public void onParseSubredditDataFail() {
|
||||
fetchSubredditDataListener.onFetchSubredditDataFail();
|
||||
fetchSubredditDataListener.onFetchSubredditDataFail(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fetchSubredditDataListener.onFetchSubredditDataFail();
|
||||
fetchSubredditDataListener.onFetchSubredditDataFail(response.code() == 403);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {
|
||||
fetchSubredditDataListener.onFetchSubredditDataFail();
|
||||
fetchSubredditDataListener.onFetchSubredditDataFail(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -84,7 +84,7 @@ public class FetchSubredditData {
|
||||
public interface FetchSubredditDataListener {
|
||||
void onFetchSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers);
|
||||
|
||||
void onFetchSubredditDataFail();
|
||||
void onFetchSubredditDataFail(boolean isQuarantined);
|
||||
}
|
||||
|
||||
interface FetchSubredditListingDataListener {
|
||||
|
@ -56,7 +56,7 @@ public class SubredditSubscription {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFetchSubredditDataFail() {
|
||||
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user