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++) {
|
for (int oldIndex = 0; oldIndex < oldSubscribedSubreddits.size(); oldIndex++) {
|
||||||
if (newIndex >= newSubscribedSubreddits.size()) {
|
if (newIndex >= newSubscribedSubreddits.size()) {
|
||||||
for (; oldIndex < oldSubscribedSubreddits.size(); oldIndex++) {
|
for (; oldIndex < oldSubscribedSubreddits.size(); oldIndex++) {
|
||||||
unsubscribedSubredditNames.add(oldSubscribedSubreddits.get(oldIndex).getName());
|
unsubscribedSubredditNames.add(oldSubscribedSubreddits.get(oldIndex).getQualified_name());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockedCommunityData old = oldSubscribedSubreddits.get(oldIndex);
|
BlockedCommunityData old = oldSubscribedSubreddits.get(oldIndex);
|
||||||
for (; newIndex < newSubscribedSubreddits.size(); newIndex++) {
|
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++;
|
newIndex++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (newSubscribedSubreddits.get(newIndex).getName().compareToIgnoreCase(old.getName()) > 0) {
|
if (newSubscribedSubreddits.get(newIndex).getQualified_name().compareToIgnoreCase(old.getQualified_name()) > 0) {
|
||||||
unsubscribedSubredditNames.add(old.getName());
|
unsubscribedSubredditNames.add(old.getQualified_name());
|
||||||
break;
|
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")
|
@Query("SELECT * FROM blocked_communities WHERE name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE LIMIT 1")
|
||||||
BlockedCommunityData getBlockedCommunity(String name, String accountName);
|
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);
|
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")
|
@Query("SELECT * FROM blocked_users WHERE name = :name COLLATE NOCASE AND account_name = :accountName COLLATE NOCASE LIMIT 1")
|
||||||
BlockedUserData getBlockedUser(String name, String accountName);
|
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);
|
void deleteBlockedUser(String name, String accountName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user