mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Reimplement contact search collection to support group access predicate.
This commit is contained in:
committed by
Cody Henthorne
parent
9dd96148d1
commit
1cea615675
@@ -25,6 +25,7 @@ import org.signal.storageservice.protos.groups.local.DecryptedGroup;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedGroupChange;
|
||||
import org.signal.storageservice.protos.groups.local.EnabledState;
|
||||
import org.thoughtcrime.securesms.contacts.paged.ContactSearchSortOrder;
|
||||
import org.thoughtcrime.securesms.contacts.paged.collections.ContactSearchIterator;
|
||||
import org.thoughtcrime.securesms.crypto.SenderKeyUtil;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.BadGroupIdException;
|
||||
@@ -1049,7 +1050,7 @@ public class GroupDatabase extends Database {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class Reader implements Closeable {
|
||||
public static class Reader implements Closeable, ContactSearchIterator<GroupRecord> {
|
||||
|
||||
public final Cursor cursor;
|
||||
|
||||
@@ -1101,6 +1102,21 @@ public class GroupDatabase extends Database {
|
||||
if (this.cursor != null)
|
||||
this.cursor.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToPosition(int n) {
|
||||
cursor.moveToPosition(n);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return !cursor.isLast() && !cursor.isAfterLast();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroupRecord next() {
|
||||
return getNext();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GroupRecord {
|
||||
|
||||
Reference in New Issue
Block a user