Skip to content

Commit

Permalink
Add Pagination to Consent Query (#151)
Browse files Browse the repository at this point in the history
* fix consent only fetching first 100 entries

* remove dev test

* optimize imports
  • Loading branch information
nplasterer authored Jan 3, 2024
1 parent d43f9d4 commit e12609c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions library/src/main/java/org/xmtp/android/library/Contacts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ class ConsentList(val client: Client) {

@OptIn(ExperimentalUnsignedTypes::class)
suspend fun load(): ConsentList {
val envelopes = client.query(
Topic.preferenceList(identifier),
val envelopes = client.apiClient.envelopes(
Topic.preferenceList(identifier).description,
Pagination(direction = MessageApiOuterClass.SortDirection.SORT_DIRECTION_ASCENDING)
)
val consentList = ConsentList(client)
val preferences: MutableList<PrivatePreferencesAction> = mutableListOf()

for (envelope in envelopes.envelopesList) {
for (envelope in envelopes) {
val payload = uniffi.xmtp_dh.userPreferencesDecrypt(
publicKey.toByteArray().toUByteArray().toList(),
privateKey.toByteArray().toUByteArray().toList(),
Expand Down

0 comments on commit e12609c

Please sign in to comment.