|
|
|
|
@ -22,15 +22,13 @@ Meteor.methods({ |
|
|
|
|
} |
|
|
|
|
const blockDeleteInMinutes = RocketChat.settings.get('Message_AllowDeleting_BlockDeleteInMinutes'); |
|
|
|
|
if (!forceDelete && _.isNumber(blockDeleteInMinutes) && blockDeleteInMinutes !== 0) { |
|
|
|
|
if (message.ts) { |
|
|
|
|
const msgTs = moment(message.ts); |
|
|
|
|
if (msgTs) { |
|
|
|
|
const currentTsDiff = moment().diff(msgTs, 'minutes'); |
|
|
|
|
if (currentTsDiff > blockDeleteInMinutes) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
const msgTs = moment(message.ts); |
|
|
|
|
const currentTsDiff = moment().diff(msgTs, 'minutes'); |
|
|
|
|
if (currentTsDiff > blockDeleteInMinutes) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Tracker.nonreactive(function() { |
|
|
|
|
|