[NEW] Command /hide to hide channels#10727
[NEW] Command /hide to hide channels#10727ggazzo merged 8 commits intoRocketChat:developfrom mikaelmello:develop
Conversation
|
@karlprieb @ggazzo I've been recommended to ask one of you to review it, if possible |
ggazzo
left a comment
There was a problem hiding this comment.
what do you think about allow hide another room typing /hide #room_name ? I dont think will take much more time.
There was a problem hiding this comment.
change to api.addFiles('client/hide.js', 'client'); (and move the file =) )
There was a problem hiding this comment.
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.
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
graywolf336
left a comment
There was a problem hiding this comment.
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.