mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-06 18:57:26 +01:00
Fix removing blocked things
This commit is contained in:
parent
6621748de5
commit
f5172a17db
@ -79,19 +79,19 @@ public class InsertBlockedThings {
|
||||
for (int oldIndex = 0; oldIndex < oldSubscribedSubreddits.size(); oldIndex++) {
|
||||
if (newIndex >= newSubscribedSubreddits.size()) {
|
||||
for (; oldIndex < oldSubscribedSubreddits.size(); oldIndex++) {
|
||||
unsubscribedSubredditNames.add(oldSubscribedSubreddits.get(oldIndex).getName());
|
||||
unsubscribedSubredditNames.add(oldSubscribedSubreddits.get(oldIndex).getQualified_name());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
BlockedCommunityData old = oldSubscribedSubreddits.get(oldIndex);
|
||||
for (; newIndex < newSubscribedSubreddits.size(); newIndex++) {
|
||||
if (newSubscribedSubreddits.get(newIndex).getName().compareToIgnoreCase(old.getName()) == 0) {
|
||||
if (newSubscribedSubreddits.get(newIndex).getQualified_name().compareToIgnoreCase(old.getQualified_name()) == 0) {
|
||||
newIndex++;
|
||||
break;
|
||||
}
|
||||
if (newSubscribedSubreddits.get(newIndex).getName().compareToIgnoreCase(old.getName()) > 0) {
|
||||
unsubscribedSubredditNames.add(old.getName());
|
||||
if (newSubscribedSubreddits.get(newIndex).getQualified_name().compareToIgnoreCase(old.getQualified_name()) > 0) {
|
||||
unsubscribedSubredditNames.add(old.getQualified_name());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ public interface BlockedCommunityDao {
|
||||
@Query("SELECT * FROM blocked_communities WHERE name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE LIMIT 1")
|
||||
BlockedCommunityData getBlockedCommunity(String name, String accountName);
|
||||
|
||||
@Query("DELETE FROM blocked_communities WHERE name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE")
|
||||
@Query("DELETE FROM blocked_communities WHERE qualified_name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE")
|
||||
void deleteBlockedCommunity(String name, String accountName);
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ public interface BlockedUserDao {
|
||||
@Query("SELECT * FROM blocked_users WHERE name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE LIMIT 1")
|
||||
BlockedUserData getBlockedUser(String name, String accountName);
|
||||
|
||||
@Query("DELETE FROM blocked_users WHERE name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE")
|
||||
@Query("DELETE FROM blocked_users WHERE qualified_name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE")
|
||||
void deleteBlockedUser(String name, String accountName);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user