-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Android Build Update Conversation List to have hooks
- Loading branch information
Showing
12 changed files
with
541 additions
and
467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import org.xmtp.android.library.ConsentList | ||
import org.xmtp.android.library.ConsentState | ||
import org.xmtp.android.library.Conversation | ||
|
||
suspend fun isConversationBlocked(conversation: Conversation, consentList: ConsentList): Boolean { | ||
return isConversationIdBlocked(conversation.id, consentList) | ||
} | ||
|
||
suspend fun isConversationAllowed(conversation: Conversation, consentList: ConsentList): Boolean { | ||
return isConversationIdAllowed(conversation.id, consentList) | ||
} | ||
|
||
suspend fun isConversationIdBlocked(conversationId: String, consentList: ConsentList): Boolean { | ||
return consentList.conversationState(conversationId) == ConsentState.DENIED | ||
} | ||
|
||
suspend fun isConversationIdAllowed(conversationId: String, consentList: ConsentList): Boolean { | ||
return consentList.conversationState(conversationId) == ConsentState.ALLOWED | ||
} | ||
|
||
suspend fun isAddressAllowed(address: String, consentList: ConsentList): Boolean { | ||
return consentList.addressState(address) == ConsentState.ALLOWED | ||
} | ||
|
||
suspend fun isAddressBlocked(address: String, consentList: ConsentList): Boolean { | ||
return consentList.addressState(address) == ConsentState.DENIED | ||
} | ||
|
||
suspend fun isInboxIdAllowed(inboxId: String, consentList: ConsentList): Boolean { | ||
return consentList.inboxIdState(inboxId) == ConsentState.ALLOWED | ||
} | ||
|
||
suspend fun isInboxIdBlocked(inboxId: String, consentList: ConsentList): Boolean { | ||
return consentList.inboxIdState(inboxId) == ConsentState.DENIED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.