review fixes

This commit is contained in:
negue
2018-10-10 20:46:43 +02:00
parent 9fc03cb91a
commit 5670be26c7
4 changed files with 21 additions and 17 deletions

View File

@@ -15,6 +15,8 @@ div
.text(v-markdown='msg.text') .text(v-markdown='msg.text')
.reported(v-if="isMessageReported") .reported(v-if="isMessageReported")
span(v-once) {{ $t('reportedMessage')}} span(v-once) {{ $t('reportedMessage')}}
br
span(v-if="inbox") {{ $t('canDeleteNow') }}
hr hr
div(v-if='msg.id') div(v-if='msg.id')
.action(@click='like()', v-if='!inbox && msg.likes', :class='{active: msg.likes[user._id]}') .action(@click='like()', v-if='!inbox && msg.likes', :class='{active: msg.likes[user._id]}')

View File

@@ -106,7 +106,7 @@ export default {
this.$root.$emit('bv::hide::modal', 'report-flag'); this.$root.$emit('bv::hide::modal', 'report-flag');
}, },
async reportAbuse () { async reportAbuse () {
this.text('Thank you for reporting this violation. The moderators have been notified.'); this.text(this.$t(this.groupId === 'privateMessage' ? 'pmReported' : 'abuseReported'));
let result = await this.$store.dispatch('chat:flag', { let result = await this.$store.dispatch('chat:flag', {
groupId: this.groupId, groupId: this.groupId,

View File

@@ -155,11 +155,13 @@
"cannotSendGemsToYourself": "Cannot send gems to yourself. Try a subscription instead.", "cannotSendGemsToYourself": "Cannot send gems to yourself. Try a subscription instead.",
"badAmountOfGemsToSend": "Amount must be within 1 and your current number of gems.", "badAmountOfGemsToSend": "Amount must be within 1 and your current number of gems.",
"report": "Report", "report": "Report",
"canDeleteNow": "You can now delete the message if you wish.",
"abuseFlag": "Report violation of Community Guidelines", "abuseFlag": "Report violation of Community Guidelines",
"abuseFlagModalHeading": "Report a Violation", "abuseFlagModalHeading": "Report a Violation",
"abuseFlagModalBody": "Are you sure you want to report this post? You should <strong>only</strong> report a post that violates the <%= firstLinkStart %>Community Guidelines<%= linkEnd %> and/or <%= secondLinkStart %>Terms of Service<%= linkEnd %>. Inappropriately reporting a post is a violation of the Community Guidelines and may give you an infraction.", "abuseFlagModalBody": "Are you sure you want to report this post? You should <strong>only</strong> report a post that violates the <%= firstLinkStart %>Community Guidelines<%= linkEnd %> and/or <%= secondLinkStart %>Terms of Service<%= linkEnd %>. Inappropriately reporting a post is a violation of the Community Guidelines and may give you an infraction.",
"abuseFlagModalButton": "Report Violation", "abuseFlagModalButton": "Report Violation",
"abuseReported": "Thank you for reporting this violation. The moderators have been notified.", "abuseReported": "Thank you for reporting this violation. The moderators have been notified.",
"pmReported": "Thank you for reporting this message. The moderators have been notified. You can now delete the message if you wish.",
"abuseAlreadyReported": "You have already reported this message.", "abuseAlreadyReported": "You have already reported this message.",
"whyReportingPost": "Why are you reporting this post?", "whyReportingPost": "Why are you reporting this post?",
"whyReportingPostPlaceholder": "Please help our moderators by letting us know why you are reporting this post for a violation, e.g., spam, swearing, religious oaths, bigotry, slurs, adult topics, violence.", "whyReportingPostPlaceholder": "Please help our moderators by letting us know why you are reporting this post for a violation, e.g., spam, swearing, religious oaths, bigotry, slurs, adult topics, violence.",

View File

@@ -89,6 +89,10 @@ function sendFlagNotification ({
}); });
} }
function formatUser (name, email, uuid) {
return `${name} (${email}; ${uuid}`;
}
function sendInboxFlagNotification ({ function sendInboxFlagNotification ({
authorEmail, authorEmail,
flagger, flagger,
@@ -108,27 +112,23 @@ function sendInboxFlagNotification ({
text += ` and commented: ${userComment}`; text += ` and commented: ${userComment}`;
} }
authorName = `${message.user} - ${authorEmail} - ${message.uuid}`;
let messageText = message.text; let messageText = message.text;
let sender = '';
let recipient = '';
if (flagger.id === message.uuid) { const flaggerFormat = formatUser(flagger.profile.name, flagger.auth.local.email, flagger._id);
messageText += `: ${flagger.profile.name} is writing to itself.`; const messageUserFormat = formatUser(message.user, authorEmail, message.uuid);
if (message.sent) {
sender = flaggerFormat;
recipient = messageUserFormat;
} else { } else {
let sender = ''; sender = messageUserFormat;
let recipient = ''; recipient = flaggerFormat;
if (message.sent) {
sender = flagger.profile.name;
recipient = message.user;
} else {
sender = message.user;
recipient = flagger.profile.name;
}
messageText += `: ${sender} is writing this message to ${recipient}.`;
} }
authorName = `${sender} is writing this message to ${recipient}.`;
flagSlack.send({ flagSlack.send({
text, text,
attachments: [{ attachments: [{