Skip to content

converted slashcommand-join coffee to js#6469

Merged
engelgabriel merged 5 commits into
RocketChat:developfrom
ggazzo:slashcommands-join
Mar 29, 2017
Merged

converted slashcommand-join coffee to js#6469
engelgabriel merged 5 commits into
RocketChat:developfrom
ggazzo:slashcommands-join

Conversation

@ggazzo

@ggazzo ggazzo commented Mar 24, 2017

Copy link
Copy Markdown
Member

@RocketChat/core

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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