mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-14 06:22:50 +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
|
@Override
|
||||||
public void onFetchSubredditDataFail() {
|
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||||
mRespectSubredditRecommendedSortType = false;
|
mRespectSubredditRecommendedSortType = false;
|
||||||
ViewPostDetailActivity.this.sortType = mSortTypeSharedPreferences.getString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, SortType.Type.BEST.value.toUpperCase());
|
ViewPostDetailActivity.this.sortType = mSortTypeSharedPreferences.getString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, SortType.Type.BEST.value.toUpperCase());
|
||||||
if (ViewPostDetailActivity.this.sortType != null) {
|
if (ViewPostDetailActivity.this.sortType != null) {
|
||||||
|
@ -519,7 +519,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFetchSubredditDataFail() {
|
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||||
makeSnackbar(R.string.cannot_fetch_subreddit_info, true);
|
makeSnackbar(R.string.cannot_fetch_subreddit_info, true);
|
||||||
mFetchSubredditInfoSuccess = false;
|
mFetchSubredditInfoSuccess = false;
|
||||||
}
|
}
|
||||||
|
@ -346,4 +346,7 @@ public interface RedditAPI {
|
|||||||
Call<String> addSubredditToMultiReddit(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params,
|
Call<String> addSubredditToMultiReddit(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params,
|
||||||
@Path(value = "multipath", encoded = true) String multipath, @Path("subredditName") String subredditName);
|
@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
|
@Override
|
||||||
public void onFetchSubredditDataFail() {
|
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||||
loadSubredditIconAsyncTaskListener.loadIconSuccess(null);
|
loadSubredditIconAsyncTaskListener.loadIconSuccess(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -193,7 +193,7 @@ public class SidebarFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFetchSubredditDataFail() {
|
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
Toast.makeText(activity, R.string.cannot_fetch_sidebar, Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, R.string.cannot_fetch_sidebar, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
@ -31,17 +31,17 @@ public class FetchSubredditData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onParseSubredditDataFail() {
|
public void onParseSubredditDataFail() {
|
||||||
fetchSubredditDataListener.onFetchSubredditDataFail();
|
fetchSubredditDataListener.onFetchSubredditDataFail(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
fetchSubredditDataListener.onFetchSubredditDataFail();
|
fetchSubredditDataListener.onFetchSubredditDataFail(response.code() == 403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) {
|
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 {
|
public interface FetchSubredditDataListener {
|
||||||
void onFetchSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers);
|
void onFetchSubredditDataSuccess(SubredditData subredditData, int nCurrentOnlineSubscribers);
|
||||||
|
|
||||||
void onFetchSubredditDataFail();
|
void onFetchSubredditDataFail(boolean isQuarantined);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FetchSubredditListingDataListener {
|
interface FetchSubredditListingDataListener {
|
||||||
|
@ -56,7 +56,7 @@ public class SubredditSubscription {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFetchSubredditDataFail() {
|
public void onFetchSubredditDataFail(boolean isQuarantined) {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user