refactor(profiles): remove email feature

also still more visual cleanup of profile modal
This commit is contained in:
SabreCat
2023-09-15 16:39:50 -05:00
parent 311c743284
commit f55d74a95d
7 changed files with 84 additions and 202 deletions
+1 -26
View File
@@ -14,7 +14,7 @@ import {
NotAuthorized,
} from '../../libs/errors';
import { removeFromArray } from '../../libs/collectionManipulators';
import { getUserInfo, getGroupUrl, sendTxn } from '../../libs/email';
import { getUserInfo, getGroupUrl } from '../../libs/email';
import * as slack from '../../libs/slack';
import { chatReporterFactory } from '../../libs/chatReporting/chatReporterFactory';
import { getAuthorEmailFromMessage } from '../../libs/chat';
@@ -28,7 +28,6 @@ import { getAnalyticsServiceByEnvironment } from '../../libs/analyticsService';
const analytics = getAnalyticsServiceByEnvironment();
const ACCOUNT_MIN_CHAT_AGE = Number(nconf.get('ACCOUNT_MIN_CHAT_AGE'));
const FLAG_REPORT_EMAILS = nconf.get('FLAG_REPORT_EMAIL').split(',').map(email => ({ email, canSend: true }));
/**
* @apiDefine MessageNotFound
@@ -164,8 +163,6 @@ api.postChat = {
{ name: 'GROUP_URL', content: groupUrl },
];
sendTxn(FLAG_REPORT_EMAILS, 'slur-report-to-mods', report);
// Slack the mods
slack.sendSlurNotification({
authorEmail,
@@ -241,8 +238,6 @@ api.postChat = {
{ name: 'GROUP_URL', content: groupUrl },
];
sendTxn(FLAG_REPORT_EMAILS, 'shadow-muted-post-report-to-mods', report);
// Slack the mods
slack.sendShadowMutedPostNotification({
authorEmail,
@@ -447,26 +442,6 @@ api.clearChatFlags = {
const authorEmail = getAuthorEmailFromMessage(message);
const groupUrl = getGroupUrl(group);
sendTxn(FLAG_REPORT_EMAILS, 'unflag-report-to-mods', [
{ name: 'MESSAGE_TIME', content: (new Date(message.timestamp)).toString() },
{ name: 'MESSAGE_TEXT', content: message.text },
{ name: 'ADMIN_USERNAME', content: user.profile.name },
{ name: 'ADMIN_UUID', content: user._id },
{ name: 'ADMIN_EMAIL', content: adminEmailContent },
{ name: 'ADMIN_MODAL_URL', content: `/profile/${user._id}` },
{ name: 'AUTHOR_USERNAME', content: message.user },
{ name: 'AUTHOR_UUID', content: message.uuid },
{ name: 'AUTHOR_EMAIL', content: authorEmail },
{ name: 'AUTHOR_MODAL_URL', content: `/profile/${message.uuid}` },
{ name: 'GROUP_NAME', content: group.name },
{ name: 'GROUP_TYPE', content: group.type },
{ name: 'GROUP_ID', content: group._id },
{ name: 'GROUP_URL', content: groupUrl },
]);
res.respond(200, {});
},
};