-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[NEW] Command /hide to hide channels #10727
Conversation
@karlprieb @ggazzo I've been recommended to ask one of you to review it, if possible |
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.
what do you think about allow hide another room typing /hide #room_name
? I dont think will take much more time.
'rocketchat:lib' | ||
]); | ||
|
||
api.addFiles('hide.js', 'client'); |
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.
change to api.addFiles('client/hide.js', 'client');
(and move the file =) )
return; | ||
} | ||
|
||
try { |
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.
can you explain why you are using this try catch? Meteor.call
doest throw exceptions on client side, you should use
Meteor.call('hideRoom', item.rid, err => {
if(err) {
return RocketChat.Notifications.notifyUser(Meteor.userId(), 'mes'.......
}
if (['channel', 'group', 'direct'].includes(FlowRouter.getRouteName()) && (Session.get('openedRoom') === item.rid)) {
FlowRouter.go('home');
Session.delete('openedRoom');
}
}) ```
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 used the slashcommands-leave
as a base, there's a try catch there so I figured I should do the same too. Will update it soon, along with the other suggestions
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.
We need a server implementation of this, otherwise the mobile applications won't have access to this command.
- Move client function to client/ directory - Change error handling of the method call
@ggazzo and @graywolf336, all done. |
@mikaelmello I made some changes could test and see if you agree? |
@ggazzo Much better. I had written Hide_given_room to match the join command, but if you prefer it that way alright. About Room_doesnt_exist, it was because of direct messages. |
Actually, the sentence 'Hide_given_room' is better but, we have a lot of strings, and probably we will change in the future |
Closes #10713
Closes #8239
Simple feature requested in #10713, when an user executes the slash command
/hide
, they hide the channel and are redirected to the homepage.I've decided to redirect the user to the homepage after hiding because that is the current behavior when you hide the current room you are in using the GUI.