-
Notifications
You must be signed in to change notification settings - Fork 250
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
Ensure owner is removed from community when leaving community #2429
Conversation
Pull Request Checklist
|
protocol/communities/manager.go
Outdated
@@ -726,8 +726,10 @@ func (m *Manager) LeaveCommunity(id types.HexBytes) (*Community, error) { | |||
if community == nil { | |||
return nil, ErrOrgNotFound | |||
} | |||
community.RemoveUserFromOrg(m.identity) |
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.
Notice that I'm not handling possible errors here. When this API is called we know that the user exists in the org so removal should always go fine.
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.
nit: github shows some indentation issue
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.
Fixed!
Jenkins BuildsClick to see older builds (9)
|
…ommunity When an owner of a community leaves its own community, we optimistically update the members list in Status Desktop. The `LeaveCommunity` API that is called via status-lib has been updated to correctly remove that member as well. This depends on status-im/status-go#2429 Fixes #4074
protocol/communities/manager.go
Outdated
@@ -726,8 +726,10 @@ func (m *Manager) LeaveCommunity(id types.HexBytes) (*Community, error) { | |||
if community == nil { | |||
return nil, ErrOrgNotFound | |||
} | |||
community.RemoveUserFromOrg(m.identity) |
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.
nit: github shows some indentation issue
3424e5c
to
44f6685
Compare
Prior to this commit, when a community owner leaves her community, status-go would just set the `joined` flag to `false` without updating the members list. This results in wrong data as the number of members doesn't match the reality. This commit removes the owner of the community from the members list when she's leaving the community.
44f6685
to
f3c0731
Compare
…ommunity When an owner of a community leaves its own community, we optimistically update the members list in Status Desktop. The `LeaveCommunity` API that is called via status-lib has been updated to correctly remove that member as well. This depends on status-im/status-go#2429 Fixes #4074
Prior to this commit, when a community owner leaves her community,
status-go would just set the
joined
flag tofalse
without updating themembers list. This results in wrong data as the number of members doesn't
match the reality.
This commit removes the owner of the community from the members list
when she's leaving the community.