Skip to content

Commit

Permalink
Do not rate limit bots on createDirectMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
jangmarker committed Jul 17, 2017
1 parent a729aaa commit 6f64e37
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions server/methods/createDirectMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ Meteor.methods({
}
});

DDPRateLimiter.addRule({
type: 'method',
name: 'createDirectMessage',
connectionId() {
return true;
RocketChat.RateLimiter.limitMethod('createDirectMessage', 10, 60000, {
userId(userId) {
return !RocketChat.authz.hasPermission(userId, 'send-many-messages');
}
}, 10, 60000);
});

0 comments on commit 6f64e37

Please sign in to comment.