mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +01:00
Delete anonymous multireddit.
This commit is contained in:
parent
10cccb5b93
commit
426db4c069
@ -13,7 +13,11 @@ public class DeleteMultiredditInDatabase {
|
|||||||
String accountName, String multipath,
|
String accountName, String multipath,
|
||||||
DeleteMultiredditInDatabaseListener deleteMultiredditInDatabaseListener) {
|
DeleteMultiredditInDatabaseListener deleteMultiredditInDatabaseListener) {
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
redditDataRoomDatabase.multiRedditDao().deleteMultiReddit(multipath, accountName);
|
if (accountName.equals("-")) {
|
||||||
|
redditDataRoomDatabase.multiRedditDao().anonymousDeleteMultiReddit(multipath);
|
||||||
|
} else {
|
||||||
|
redditDataRoomDatabase.multiRedditDao().deleteMultiReddit(multipath, accountName);
|
||||||
|
}
|
||||||
handler.post(deleteMultiredditInDatabaseListener::success);
|
handler.post(deleteMultiredditInDatabaseListener::success);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class DeleteMultiReddit {
|
|||||||
String accessToken, String accountName, String multipath,
|
String accessToken, String accountName, String multipath,
|
||||||
DeleteMultiRedditListener deleteMultiRedditListener) {
|
DeleteMultiRedditListener deleteMultiRedditListener) {
|
||||||
oauthRetrofit.create(RedditAPI.class).deleteMultiReddit(APIUtils.getOAuthHeader(accessToken),
|
oauthRetrofit.create(RedditAPI.class).deleteMultiReddit(APIUtils.getOAuthHeader(accessToken),
|
||||||
multipath).enqueue(new Callback<String>() {
|
multipath).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {
|
public void onResponse(@NonNull Call<String> call, @NonNull Response<String> response) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
|
@ -28,6 +28,9 @@ public interface MultiRedditDao {
|
|||||||
@Query("DELETE FROM multi_reddits WHERE name = :name AND username = :username")
|
@Query("DELETE FROM multi_reddits WHERE name = :name AND username = :username")
|
||||||
void deleteMultiReddit(String name, String username);
|
void deleteMultiReddit(String name, String username);
|
||||||
|
|
||||||
|
@Query("DELETE FROM multi_reddits WHERE path = :path")
|
||||||
|
void anonymousDeleteMultiReddit(String path);
|
||||||
|
|
||||||
@Query("DELETE FROM multi_reddits WHERE username = :username")
|
@Query("DELETE FROM multi_reddits WHERE username = :username")
|
||||||
void deleteAllUserMultiReddits(String username);
|
void deleteAllUserMultiReddits(String username);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user