Skip to content
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

converted slashcommand-join coffee to js #6469

Merged
merged 5 commits into from
Mar 29, 2017

Conversation

ggazzo
Copy link
Member

@ggazzo ggazzo commented Mar 24, 2017

@RocketChat/core

@@ -0,0 +1,10 @@
RocketChat.slashCommands.add('join', void 0, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use void 0

*/


const Join = function(command, params, item) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO named functions are better for theses cases, cuz the stack trace of the errors will be more clear.
What do you think about change const Join = function(command... by function Join(command...?

}, user.language)
});
}
if (room.usernames.indexOf(user.username) > -1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace the indexOf by includes?

@engelgabriel engelgabriel modified the milestone: 0.55.0 Mar 29, 2017
@engelgabriel engelgabriel merged commit f52ff73 into RocketChat:develop Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants