-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Add read only channels #3861
Add read only channels #3861
Conversation
Looks good @alexbrazier - can you make the announcements piece configurable? ie allow an Admin to specify if the event of a new user joining the channel should be posted to channel or not? Also, can the read-only channel also and simultaneously be a default channel? ie have all new users automatically be enrolled into the read-only channel |
Hi Alex, this is great work. I'm not part of the core team so I can't speak to the general acceptance, but I've tested your feature branch on my own fork. We were working on our own solution to this which is slightly different in that we intended to allow settings for room event notifications to be set individually, as well as choosing which roles are exempt to muting. i.e. I noticed admins are muted in read-only rooms and must be appointed to allow posting, personally I think that's undesirable or at least should be configurable. There's a strange, probably unintended result of not firing the channel join message, in that the channel leave message still fires, but you don't see people rejoin. So over time the channel will appear to be entirely abandoned, even if that's not the case. Also as you've used rocketbot to send the response to the user when they try posting: "You have been muted and cannot speak in this room". What happens if rocketbot is removed/disabled in an instance? Couldn't that notice be a system alert instead, or potentially just disable the message input field - setting the notice as placeholder text on the input instead: [ 📎 ][ You have been muted and cannot speak in this room. 😶 ][ ^ ] Lastly, I noticed what appears to be a pretty critical bug, but its hard to reproduce. When you login and the default room is read-only, if you were previously a member of that room (before this functionality was enabled) everything hangs until to you do a browser reload. |
@RichardFoxworthy Do you think it should be a channel setting to make announcements, or a global setting? I don't want to fill up the channel info bar, and channel creation with too many settings to choose from, but if people think it is better per channel, then I can add it. @timkinnane It would be good to see what you guys have already done if you have something working? Using rocketbot to tell a user that they are muted is the default behaviour for muted users before. If you are worried about rocketbot being disabled then maybe we should make normal muting messages a system message as well? If not, I could change the message so instead of saying that the user is muted, I could tell them that it's a read only channel? I will try to reproduce the bug you mentioned tonight, and try to fix it. Let me know if you have any ideas as to why this is happening. Thanks for the feedback! |
Thanks for the detailed response @alexbrazier. This community has such devoted contributors :) I've made our feature branch available here. We also use the standard muting behaviour, but we've tried to improve the default implementation when the whole room is muted/read-only. We hooked into We're just testing functionality, so the controls are pretty basic, just two buttons, hard coded to mute the There's a diverse range of use cases in the world of Rocket.Chat so its dangerous to make assumptions what will work best for everyone, or even what works now which might change with scale, so I err on the side of dynamic configuration when planning features - even if that means a couple more controls as long as their UI is clean and intuitive. My comments on #825 mention some of the other issues that can be addressed if we keep the configuration open. We have a handful of bots that need to post in most rooms and we're running multiple instances for different communities with different needs for different rooms and users in a variety of roles who join at different times. So we don't want to rely on manual actions to fulfil what I see as a permission based behaviour, when the role system can be implemented easier at scale. Oh yeah, lastly yes I do think the "you are muted response" should be a system response, not from rocketbot. We have branded instances with no Rocket.Chat references so rocketbot makes no sense to suddenly appear to our users for this one message type. I'm not sure that message works with internationalisation the way all other system alerts do either. It seems like possibly an artifact from early days, I'm assuming no one will mind if we change it. As for the bug. Try adding a dummy user to the room before its read only, then while they're not online make the room read only. Switch to another browser and login as the dummy user, it seems to hang on the first screen trying to restore the room state. Might be an unrelated bug though, there's a few in the current develop branch. Have a look what we've done so far. Would be great if we can come up with a merged approach. |
@timkinnane I've had a look at your changes, and they look pretty good! I like how you have used the I like the idea of changing the muted users to just disable the text box with the message in your comment above, as rocketbot doesn't seem to be used anywhere else, so I think we should go with that approach, and just change it for muting in general. Something I would questing is whether we want settings to say which user groups are allowed to post in read only channels.
Do you (or anyone else) have any thoughts on these points - e.g. where to put the setting? I think I will add the setting to disable room system notifications, such a users joining and leaving, as this can be a setting for all channels, even non read only. I will take a look at that bug tomorrow, and see if I can recreate it. Thanks for giving a detailed description to recreate. |
Great ideas @alexbrazier. Firstly just wanted to credit @nazclarion, as he actually coded the solution, but we worked on the spec together. Regarding the callbacks, I'm not actually sure why we're doing both I like the idea of a single permission to overrule read-only. That allows everything we wanted with roles, without having to specify each role with access in the room settings. I'd suggest something more semantic though, like Sounds like there's three distinct parts to the solution now, to take the advantages of both approaches and address the related issues.
Are you happy to make changes to your PR and proceed with part 1? I won't bother submitting our own PR if we can join forces 😄 Part 2 needs a distinct issue and possibly further discussion - I've just created that: #3869 We have some code written for part 3, its not a priority so we didn't get far, but I'll dig that up and share it. Don't know if that's something you've got time or intention to address as well? We can do it, but might not come back to it for a while. |
FYI, here's the info from @nazclarion on |
Sounds good @timkinnane, I'm glad we could find a solution. I will make changes to my PR to do part 1, and may do part 3 as well. |
@timkinnane I looked into the bug you mentioned, and tried it on the |
@RocketChat/core @timkinnane: I think this is ready to be checked and merged |
ro: readOnly | ||
|
||
if readOnly | ||
users = @findOne(query, { fields: { usernames: 1 }})?.usernames |
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.
Why are you doing this query?
@alexbrazier first of all, this PR is amazing, we are very happy to see the community engaged like this 😄 Can you explain some things to me?
We are migrating part of our core to use a new type of cache at server side, and we are removing the array of usernames from the db. |
I'm just dropping back in to this to say I also think it's awesome. Thanks @alexbrazier. I've been busy but hoping to test your feature branch by next week and work on improvements either before or after PR is accepted. If there's anything you need specific help with let me know. |
Thanks! @rodrigok to answer your questions, muted users can't post in the channel and this feature is already implemented, so I didn't have to change anything. So are you moving users who are in a room to only be stored in the subscriptions? If so the problem with doing the same for muted users is that a muted user can leave a room, and rejoin and they wont be muted anymore (unless its a read only room) as the subscription that contained muted information gets deleted |
@alexbrazier you are right, but I don't see this as a huge problem, we can live with that right now. Will work for read only rooms, for other rooms if you want to mute the user maybe you should consider to exclude the user 😄 |
@rodrigok Can you confirm that means apart from read-only rooms, there's no capacity to mute someone without kicking from the room entirely? Or at least if you do, they can just exit and rejoin to unmute themselves? Seems like that's breaking a pretty core feature. |
Updated by #4034 |
@RocketChat/core
Closes #825
Add read only channels and private groups.
Currently it doesn't post in the channel when someone joins, or if someone switches channel between read only states, but it does post if an admin adds a user, or manually mutes/unmutes user - any thoughts on the expected behaviour of when to post system message?
Bot tells user they have been muted if they try to post in a read only channel (unless they have been given permission)
