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')
.reported(v-if="isMessageReported")
span(v-once) {{ $t('reportedMessage')}}
br
span(v-if="inbox") {{ $t('canDeleteNow') }}
hr
div(v-if='msg.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');
},
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', {
groupId: this.groupId,

View File

@@ -155,11 +155,13 @@
"cannotSendGemsToYourself": "Cannot send gems to yourself. Try a subscription instead.",
"badAmountOfGemsToSend": "Amount must be within 1 and your current number of gems.",
"report": "Report",
"canDeleteNow": "You can now delete the message if you wish.",
"abuseFlag": "Report violation of Community Guidelines",
"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.",
"abuseFlagModalButton": "Report Violation",
"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.",
"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.",

View File

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