Skip to content

Commit

Permalink
Merge pull request #7326 from jangmarker/dont-rate-limit-bots-on-crea…
Browse files Browse the repository at this point in the history
…teDirectMessage

[NEW] Do not rate limit bots on createDirectMessage
  • Loading branch information
rodrigok authored Jul 25, 2017
2 parents e2abd92 + 6f64e37 commit 320145a
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 320145a

Please sign in to comment.