-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat: introduce CommunityAdminSettings
in CommunityDescription
#2668
Conversation
Pull Request Checklist
|
Jenkins BuildsClick to see older builds (29)
|
8d72710
to
931dd57
Compare
This adds a checkbox to configure whether or not community members are allowed to pin any message of a community channel, based on the newly introduced `CommunityAdminSettings` that are introduced in status-im/status-go#2668 Closes #5662
931dd57
to
13b2047
Compare
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.
Looks good, but I think on the receiving end, there might be a missing condition. I might be wrong though.
protocol/messenger_handler.go
Outdated
isMemberAdmin := community.IsMemberAdmin(chatEntity.GetSigPubKey()) | ||
pinMessageAllowed := community.AllowsAllMembersToPinMessage() | ||
|
||
if (!isMemberAdmin && !pinMessageAllowed) || (!emojiReaction && !canPost) { |
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.
Should there be an additionnal check on pin? It seems like this might block people from posting normal messages as well.
Something like
(isPinMessage && !isMemberAdmin && !pinMessageAllowed)
Where isPinMessage
comes from a new case
in the switch
above.
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.
Ah, forgot to add that. In my head I was still inside HandlePinMessage
...
Thanks man, will update
76c200e
to
687247b
Compare
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.
Looks good. I'm presuming that in the future more parameters will be added to the Ah, I just reread the description.CommunityAdminSettings
?
687247b
to
1246821
Compare
This adds a checkbox to configure whether or not community members are allowed to pin any message of a community channel, based on the newly introduced `CommunityAdminSettings` that are introduced in status-im/status-go#2668 Closes #5662
b2f6fe1
to
194b120
Compare
Tests are failing but unrelated to these changes. Also, I think status-im/status-desktop#5729 is related. Investigating... |
So it seems it affects all tests that involve |
CommunityAdminSettings admin_settings = 10; | ||
} | ||
|
||
message CommunityAdminSettings { | ||
bool pin_message_all_members_enabled = 1; | ||
} |
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 is very nice!
3336b4a
to
459b456
Compare
This allows to store community admin settings that are meant to be propagated to community members (as opposed to the already existing `CommunitySettings` which are considered local to every account). The first setting introduced as part of this commit is one that enables community admins to configure whether or not members of the community are allowed to pin messages in community channels. Prior to this commit, this was not restricted at all on the protocol level and only enforced by clients via UI (e.g. members don't see an option to pin messages, although they could). This config setting now ensures that: 1. If turned off, members cannot send a pin message 2. If turned off, pin messages from members are not handled/processed This is needed by status-im/status-desktop#5662
459b456
to
6695097
Compare
Hello! |
@churik That one is on me! |
@PascalPrecht |
This adds a checkbox to configure whether or not community members are allowed to pin any message of a community channel, based on the newly introduced `CommunityAdminSettings` that are introduced in status-im/status-go#2668 Closes #5662
This allows to store community admin settings that are meant to be propagated
to community members (as opposed to the already existing
CommunitySettings
which are considered local to every account).The first setting introduced as part of this commit is one that enables
community admins to configure whether or not members of the community
are allowed to pin messages in community channels.
Prior to this commit, this was not restricted at all on the protocol
level and only enforced by clients via UI (e.g. members don't see an
option to pin messages, although they could).
This config setting now ensures that:
This is needed by status-im/status-desktop#5662