-
Notifications
You must be signed in to change notification settings - Fork 60
SES-5170 : Groups show 'Leave' option twice #1856
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
SES-5170 : Groups show 'Leave' option twice #1856
Conversation
| val groupV2Id = (address as? Address.Group)?.accountId ?: return | ||
| val isAdmin = groupManagerV2.isCurrentUserGroupAdmin(groupV2Id) | ||
|
|
||
| if (isAdmin == null) return |
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.
Is it dangerous to mix up non-existing groups with admin logic?
It's not obvious that a null admin means no group.
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.
Hmm, would an explicit check be better here?
val groupInfo = configFactory.getGroup(groupV2Id)
if (groupInfo == null) return
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 think that's true for the overall chance of isAdmin being nullable throughout? Is it misleading to add this nullable case to use as a way to say the group doesn't exist? It feels like a separate thing than the admin state
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.
Hmm makes sense. I removed the check from the group manager, added checks for groupInfo instead and check the admin key from that.
…-android into fix/convo-bottom-sheet
ThomasSession
left a comment
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.
Nice
This PR updates logic for checking if the user is a group admin and adds that logic to the context menu on conversation long-press.