Skip to content

Commit

Permalink
Merge pull request #6861 from RocketChat/fix-star-message
Browse files Browse the repository at this point in the history
[FIX] start/unstar message
  • Loading branch information
engelgabriel authored May 2, 2017
2 parents 01211b1 + 0419f68 commit 8dc691b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/rocketchat-message-star/client/actionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ Meteor.startup(function() {
});
},
validation(message) {
if (RocketChat.models.Subscriptions.findOne({ rid: message.rid }) == null) {
if (RocketChat.models.Subscriptions.findOne({ rid: message.rid }) == null && RocketChat.settings.get('Message_AllowStarring')) {
return false;
}
return RocketChat.settings.get('Message_AllowStarring') && !message.starred;

return !_.findWhere(message.starred, {_id: Meteor.userId()});
},
order: 10
});
Expand All @@ -37,10 +38,11 @@ Meteor.startup(function() {
});
},
validation(message) {
if (RocketChat.models.Subscriptions.findOne({ rid: message.rid }) == null) {
if (RocketChat.models.Subscriptions.findOne({ rid: message.rid }) == null && RocketChat.settings.get('Message_AllowStarring')) {
return false;
}
return RocketChat.settings.get('Message_AllowStarring') && message.starred;

return Boolean(_.findWhere(message.starred, {_id: Meteor.userId()}));
},
order: 10
});
Expand Down

0 comments on commit 8dc691b

Please sign in to comment.