-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
group preference actions #180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great! Thanks for doing this. A couple of notes
Can you update this location to correctly reflect the groups consent state https://github.com/xmtp/xmtp-android/blob/main/library/src/main/java/org/xmtp/android/library/Conversation.kt#L103
Can you add in the implicit consent like we do for DMs on newGroup
https://github.com/xmtp/xmtp-android/blob/main/library/src/main/java/org/xmtp/android/library/Conversations.kt#L94-L116
We also do implicit consent when sending a message to a conversation with a state of unknown so we should probably also do that for groups. https://github.com/xmtp/xmtp-android/blob/main/library/src/main/java/org/xmtp/android/library/Group.kt#L40
var result = boClient.contacts.isGroupAllowed(group.id) | ||
|
||
assert(!result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed that this test should fail now since the default is allow on newGroup? Possibly do you need to call refreshConsentList()
to get the latest results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks great. Approving to unblock.
Would like to see some additional testing around the implicit consent stuff
- a check here that the group has a state of allowed https://github.com/xmtp/xmtp-android/blob/main/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt#L267-L280
- a check here that the bogroup has a state of allowed and alixgroup has a state of unknown https://github.com/xmtp/xmtp-android/blob/main/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt#L92-L132
Summary
With xmtp/proto#146 in, this patch adds initial support for recognizing group consents:
AllowGroup
andDenyGroup
.Bumps
org.xmtp:proto-kotlin
to3.43.2
Fixes some other kotlin warnings