From f5c2c39f6a2026d7993416291fab7bc41f591d4c Mon Sep 17 00:00:00 2001 From: Alys Date: Sun, 12 May 2019 19:10:02 +1000 Subject: [PATCH 1/3] adjust error messages for muted users and system flagging error --- website/common/locales/en/groups.json | 8 ++++---- website/common/locales/en/messages.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index 7dcd94385f..ab127f9f33 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -137,7 +137,7 @@ "PMPlaceholderTitle": "Nothing Here Yet", "PMPlaceholderDescription": "Select a conversation on the left", "PMPlaceholderTitleRevoked": "Your chat privileges have been revoked", - "PMPlaceholderDescriptionRevoked": "You are not able to send private messages because your chat privileges have been revoked. If you have questions or concerns about this, please email admin@habitica.com to discuss it with the staff.", + "PMPlaceholderDescriptionRevoked": "You are not able to send private messages because your chat privileges have been revoked. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", "PMReceive": "Receive Private Messages", "PMEnabledOptPopoverText": "Private Messages are enabled. Users can contact you via your profile.", "PMDisabledOptPopoverText": "Private Messages are disabled. Enable this option to allow users to contact you via your profile.", @@ -266,9 +266,9 @@ "userRequestsApproval": "<%= userName %> requests approval", "userCountRequestsApproval": "<%= userCount %> members request approval", "youAreRequestingApproval": "You are requesting approval", - "chatPrivilegesRevoked": "You cannot do that because your chat privileges have been revoked.", - "cannotCreatePublicGuildWhenMuted": "You cannot create a public guild because your chat privileges have been revoked.", - "cannotInviteWhenMuted": "You cannot invite anyone to a guild or party because your chat privileges have been revoked.", + "chatPrivilegesRevoked": "You cannot do that because your chat privileges have been removed. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", + "cannotCreatePublicGuildWhenMuted": "You cannot create a public guild because your chat privileges have been revoked. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", + "cannotInviteWhenMuted": "You cannot invite anyone to a guild or party because your chat privileges have been revoked. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", "newChatMessagePlainNotification": "New message in <%= groupName %> by <%= authorName %>. Click here to open the chat page!", "newChatMessageTitle": "New message in <%= groupName %>", "exportInbox": "Export Messages", diff --git a/website/common/locales/en/messages.json b/website/common/locales/en/messages.json index b1aa99d069..8b3428aebf 100644 --- a/website/common/locales/en/messages.json +++ b/website/common/locales/en/messages.json @@ -56,7 +56,7 @@ "messageGroupChatFlagAlreadyReported": "You have already reported this message", "messageGroupChatNotFound": "Message not found!", "messageGroupChatAdminClearFlagCount": "Only an admin can clear the flag count!", - "messageCannotFlagSystemMessages": "You cannot flag a system message. If you need to report a violation of the Community Guidelines related to this message, please email a screenshot and explanation to Lemoness at <%= communityManagerEmail %>.", + "messageCannotFlagSystemMessages": "You cannot report a system message. If you need to report a violation of the Community Guidelines related to this message, please email a screenshot and explanation to our Community Manager at <%= communityManagerEmail %>.", "messageGroupChatSpam": "Whoops, looks like you're posting too many messages! Please wait a minute and try again. The Tavern chat only holds 200 messages at a time, so Habitica encourages posting longer, more thoughtful messages and consolidating replies. Can't wait to hear what you have to say. :)", "messageCannotLeaveWhileQuesting": "You cannot accept this party invitation while you are in a quest. If you'd like to join this party, you must first abort your quest, which you can do from your party screen. You will be given back the quest scroll.", From 344c20fd99d0a9380e8319beaf24122cfacc5b30 Mon Sep 17 00:00:00 2001 From: Alys Date: Sat, 18 May 2019 21:38:38 +1000 Subject: [PATCH 2/3] improve error notification shown when a player is blocked This improves the wording in the error notification that a player sees when they've been blocked. It also also changes markdown links to plain text because raw markdown was being shown in some locations (for example when you saw the error messages on the command line while using an API command). These changes have been discussed with and approved by beffymaroo and the other mods. --- website/common/locales/en/front.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/common/locales/en/front.json b/website/common/locales/en/front.json index 06ead889ae..0bcf963aa1 100644 --- a/website/common/locales/en/front.json +++ b/website/common/locales/en/front.json @@ -283,7 +283,7 @@ "passwordResetEmailHtml": "If you requested a password reset for <%= username %> on Habitica, \">click here to set a new one. The link will expire after 24 hours.

If you haven't requested a password reset, please ignore this email.", "invalidLoginCredentialsLong": "Uh-oh - your email address / username or password is incorrect.\n- Make sure they are typed correctly. Your username and password are case-sensitive.\n- You may have signed up with Facebook or Google-sign-in, not email so double-check by trying them.\n- If you forgot your password, click \"Forgot Password\".", "invalidCredentials": "There is no account that uses those credentials.", - "accountSuspended": "This account, User ID \"<%= userId %>\", has been blocked for breaking the [Community Guidelines](https://habitica.com/static/community-guidelines) or [Terms of Service](https://habitica.com/static/terms). For details or to ask to be unblocked, please email our Community Manager at <%= communityManagerEmail %> or ask your parent or guardian to email them. Please copy your User ID into the email and include your username.", + "accountSuspended": "This account, User ID \"<%= userId %>\", has been blocked for breaking the Community Guidelines (https://habitica.com/static/community-guidelines) or Terms of Service (https://habitica.com/static/terms). For details or to ask to be unblocked, please email our Community Manager at <%= communityManagerEmail %> or ask your parent or guardian to email them. Please include your @Username in the email.", "accountSuspendedTitle": "Account has been suspended", "unsupportedNetwork": "This network is not currently supported.", "cantDetachSocial": "Account lacks another authentication method; can't detach this authentication method.", From b9b944ba29a9fcc16f381218882b0b5d4295a63b Mon Sep 17 00:00:00 2001 From: Alys Date: Sun, 26 May 2019 07:52:10 +1000 Subject: [PATCH 3/3] replace similar messages about chat privileges removed with one generic one --- test/api/v3/integration/groups/POST-groups.test.js | 2 +- test/api/v3/integration/groups/POST-groups_invite.test.js | 8 ++++---- website/client/components/userMenu/inbox.vue | 2 +- website/common/locales/en/groups.json | 5 +---- website/server/controllers/api-v3/groups.js | 6 +++--- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/test/api/v3/integration/groups/POST-groups.test.js b/test/api/v3/integration/groups/POST-groups.test.js index 9eeb6d0589..5fd322a564 100644 --- a/test/api/v3/integration/groups/POST-groups.test.js +++ b/test/api/v3/integration/groups/POST-groups.test.js @@ -149,7 +149,7 @@ describe('POST /group', () => { ).to.eventually.be.rejected.and.eql({ code: 401, error: 'NotAuthorized', - message: t('cannotCreatePublicGuildWhenMuted'), + message: t('chatPrivilegesRevoked'), }); }); }); diff --git a/test/api/v3/integration/groups/POST-groups_invite.test.js b/test/api/v3/integration/groups/POST-groups_invite.test.js index f5069b3875..2a648e2bb3 100644 --- a/test/api/v3/integration/groups/POST-groups_invite.test.js +++ b/test/api/v3/integration/groups/POST-groups_invite.test.js @@ -100,7 +100,7 @@ describe('Post /groups/:groupId/invite', () => { .to.eventually.be.rejected.and.eql({ code: 401, error: 'NotAuthorized', - message: t('cannotInviteWhenMuted'), + message: t('chatPrivilegesRevoked'), }); }); @@ -262,7 +262,7 @@ describe('Post /groups/:groupId/invite', () => { .to.eventually.be.rejected.and.eql({ code: 401, error: 'NotAuthorized', - message: t('cannotInviteWhenMuted'), + message: t('chatPrivilegesRevoked'), }); }); @@ -436,7 +436,7 @@ describe('Post /groups/:groupId/invite', () => { .to.eventually.be.rejected.and.eql({ code: 401, error: 'NotAuthorized', - message: t('cannotInviteWhenMuted'), + message: t('chatPrivilegesRevoked'), }); }); @@ -526,7 +526,7 @@ describe('Post /groups/:groupId/invite', () => { .to.eventually.be.rejected.and.eql({ code: 401, error: 'NotAuthorized', - message: t('cannotInviteWhenMuted'), + message: t('chatPrivilegesRevoked'), }); }); diff --git a/website/client/components/userMenu/inbox.vue b/website/client/components/userMenu/inbox.vue index ff36e3a325..ab2588b6c3 100644 --- a/website/client/components/userMenu/inbox.vue +++ b/website/client/components/userMenu/inbox.vue @@ -389,7 +389,7 @@ export default { if (this.user.flags.chatRevoked) { return { title: this.$t('PMPlaceholderTitleRevoked'), - description: this.$t('PMPlaceholderDescriptionRevoked'), + description: this.$t('chatPrivilegesRevoked'), }; } return { diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index ab127f9f33..cc06205b10 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -137,7 +137,6 @@ "PMPlaceholderTitle": "Nothing Here Yet", "PMPlaceholderDescription": "Select a conversation on the left", "PMPlaceholderTitleRevoked": "Your chat privileges have been revoked", - "PMPlaceholderDescriptionRevoked": "You are not able to send private messages because your chat privileges have been revoked. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", "PMReceive": "Receive Private Messages", "PMEnabledOptPopoverText": "Private Messages are enabled. Users can contact you via your profile.", "PMDisabledOptPopoverText": "Private Messages are disabled. Enable this option to allow users to contact you via your profile.", @@ -266,9 +265,7 @@ "userRequestsApproval": "<%= userName %> requests approval", "userCountRequestsApproval": "<%= userCount %> members request approval", "youAreRequestingApproval": "You are requesting approval", - "chatPrivilegesRevoked": "You cannot do that because your chat privileges have been removed. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", - "cannotCreatePublicGuildWhenMuted": "You cannot create a public guild because your chat privileges have been revoked. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", - "cannotInviteWhenMuted": "You cannot invite anyone to a guild or party because your chat privileges have been revoked. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", + "chatPrivilegesRevoked": "You cannot do this because your chat privileges have been removed. For details or to ask if your privileges can be returned, please email our Community Manager at admin@habitica.com or ask your parent or guardian to email them. Please include your @Username in the email. If a moderator has already told you that your chat ban is temporary, you do not need to send an email.", "newChatMessagePlainNotification": "New message in <%= groupName %> by <%= authorName %>. Click here to open the chat page!", "newChatMessageTitle": "New message in <%= groupName %>", "exportInbox": "Export Messages", diff --git a/website/server/controllers/api-v3/groups.js b/website/server/controllers/api-v3/groups.js index eed4aff4cb..991f30982f 100644 --- a/website/server/controllers/api-v3/groups.js +++ b/website/server/controllers/api-v3/groups.js @@ -82,7 +82,7 @@ let api = {}; * @apiError (401) {NotAuthorized} messageInsufficientGems User does not have enough gems (4) * @apiError (401) {NotAuthorized} partyMustbePrivate Party must have privacy set to private * @apiError (401) {NotAuthorized} messageGroupAlreadyInParty - * @apiError (401) {NotAuthorized} cannotCreatePublicGuildWhenMuted You cannot create a public guild because your chat privileges have been revoked. + * @apiError (401) {NotAuthorized} chatPrivilegesRevoked You cannot do this because your chat privileges have been removed... * * @apiSuccess (201) {Object} data The created group (See /website/server/models/group.js) * @@ -117,7 +117,7 @@ api.createGroup = { group.leader = user._id; if (group.type === 'guild') { - if (group.privacy === 'public' && user.flags.chatRevoked) throw new NotAuthorized(res.t('cannotCreatePublicGuildWhenMuted')); + if (group.privacy === 'public' && user.flags.chatRevoked) throw new NotAuthorized(res.t('chatPrivilegesRevoked')); if (user.balance < 1) throw new NotAuthorized(res.t('messageInsufficientGems')); group.balance = 1; @@ -1011,7 +1011,7 @@ api.inviteToGroup = { async handler (req, res) { const user = res.locals.user; - if (user.flags.chatRevoked) throw new NotAuthorized(res.t('cannotInviteWhenMuted')); + if (user.flags.chatRevoked) throw new NotAuthorized(res.t('chatPrivilegesRevoked')); req.checkParams('groupId', apiError('groupIdRequired')).notEmpty();