[IMPROVE] User gets feedback when a message has been starred or unstarred (#13860)

pull/16923/head^2
Amish Mittal 5 years ago committed by GitHub
parent e1d277c516
commit e887afbab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/message-star/client/starMessage.js
  2. 5
      packages/rocketchat-i18n/i18n/en.i18n.json

@ -2,18 +2,28 @@ import { Meteor } from 'meteor/meteor';
import { settings } from '../../settings';
import { ChatMessage, Subscriptions } from '../../models';
import toastr from 'toastr';
import { TAPi18n } from 'meteor/tap:i18n';
Meteor.methods({
starMessage(message) {
if (!Meteor.userId()) {
toastr.error(TAPi18n.__('error-starring-message'));
return false;
}
if (Subscriptions.findOne({ rid: message.rid }) == null) {
toastr.error(TAPi18n.__('error-starring-message'));
return false;
}
if (!settings.get('Message_AllowStarring')) {
toastr.error(TAPi18n.__('error-starring-message'));
return false;
}
if (message.starred) {
toastr.success(TAPi18n.__('Message_has_been_starred'));
} else {
toastr.success(TAPi18n.__('Message_has_been_unstarred'));
}
return ChatMessage.update({
_id: message._id,
}, {

@ -1389,6 +1389,7 @@
"error-user-registration-disabled": "User registration is disabled",
"error-user-registration-secret": "User registration is only allowed via Secret URL",
"error-you-are-last-owner": "You are the last owner. Please set new owner before leaving the room.",
"error-starring-message": "Message could not be stared",
"Error_404": "Error:404",
"Error_changing_password": "Error changing password",
"Error_loading_pages": "Error loading pages",
@ -2260,6 +2261,8 @@
"Message_GlobalSearch": "Global Search",
"Message_GroupingPeriod": "Grouping Period (in seconds)",
"Message_GroupingPeriodDescription": "Messages will be grouped with previous message if both are from the same user and the elapsed time was less than the informed time in seconds.",
"Message_has_been_starred": "Message has been starred",
"Message_has_been_unstarred": "Message has been unstarred",
"Message_HideType_au": "Hide \"User Added\" messages",
"Message_HideType_mute_unmute": "Hide \"User Muted / Unmuted\" messages",
"Message_HideType_ru": "Hide \"User Removed\" messages",
@ -3622,4 +3625,4 @@
"Your_server_link": "Your server link",
"Your_temporary_password_is_password": "Your temporary password is <strong>[password]</strong>.",
"Your_workspace_is_ready": "Your workspace is ready to use 🎉"
}
}

Loading…
Cancel
Save