forked from upstream-mirrors/quik
Simplified methods
This commit is contained in:
@@ -25,11 +25,7 @@ public class BlockedConversationHelper {
|
|||||||
|
|
||||||
public static boolean isConversationBlocked(SharedPreferences prefs, long threadId) {
|
public static boolean isConversationBlocked(SharedPreferences prefs, long threadId) {
|
||||||
Set<String> idStrings = prefs.getStringSet(SettingsFragment.BLOCKED_SENDERS, new HashSet<String>());
|
Set<String> idStrings = prefs.getStringSet(SettingsFragment.BLOCKED_SENDERS, new HashSet<String>());
|
||||||
HashSet<Long> ids = new HashSet<>();
|
return (idStrings.contains(String.valueOf(threadId)));
|
||||||
for (String s : idStrings) {
|
|
||||||
ids.add(Long.parseLong(s));
|
|
||||||
}
|
|
||||||
return (ids.contains(threadId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void blockConversation(SharedPreferences prefs, long threadId) {
|
public static void blockConversation(SharedPreferences prefs, long threadId) {
|
||||||
@@ -59,12 +55,7 @@ public class BlockedConversationHelper {
|
|||||||
|
|
||||||
public static String[] getBlockedConversationArray(SharedPreferences prefs) {
|
public static String[] getBlockedConversationArray(SharedPreferences prefs) {
|
||||||
Set<String> idStrings = getBlockedConversations(prefs);
|
Set<String> idStrings = getBlockedConversations(prefs);
|
||||||
Object[] idArray = idStrings.toArray();
|
return idStrings.toArray(new String[idStrings.size()]);
|
||||||
String[] idStringArray = new String[idStrings.size()];
|
|
||||||
for (int i = 0; i < idStrings.size(); i++) {
|
|
||||||
idStringArray[i] = (String) idArray[i];
|
|
||||||
}
|
|
||||||
return idStringArray;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCursorSelection(SharedPreferences prefs, boolean blocked) {
|
public static String getCursorSelection(SharedPreferences prefs, boolean blocked) {
|
||||||
|
|||||||
Reference in New Issue
Block a user