server: remove sendEmailNotification

The functions have their bodies completely comented out,
which means they are doing nothing.
This commit is contained in:
Norm 2022-12-07 14:55:09 -05:00
parent fde751df8f
commit fdc682e810
2 changed files with 0 additions and 36 deletions

View file

@ -4,7 +4,6 @@ import { Notifications, Mutings, UserProfiles, Users } from '@/models/index.js';
import { genId } from '@/misc/gen-id.js'; import { genId } from '@/misc/gen-id.js';
import { User } from '@/models/entities/user.js'; import { User } from '@/models/entities/user.js';
import { Notification } from '@/models/entities/notification.js'; import { Notification } from '@/models/entities/notification.js';
import { sendEmailNotification } from './send-email-notification.js';
export async function createNotification( export async function createNotification(
notifieeId: User['id'], notifieeId: User['id'],
@ -53,9 +52,6 @@ export async function createNotification(
publishMainStream(notifieeId, 'unreadNotification', packed); publishMainStream(notifieeId, 'unreadNotification', packed);
pushNotification(notifieeId, 'notification', packed); pushNotification(notifieeId, 'notification', packed);
if (type === 'follow') sendEmailNotification.follow(notifieeId, await Users.findOneByOrFail({ id: data.notifierId! }));
if (type === 'receiveFollowRequest') sendEmailNotification.receiveFollowRequest(notifieeId, await Users.findOneByOrFail({ id: data.notifierId! }));
}, 2000); }, 2000);
return notification; return notification;

View file

@ -1,32 +0,0 @@
import { UserProfiles } from '@/models/index.js';
import { User } from '@/models/entities/user.js';
import { I18n } from '@/misc/i18n.js';
import * as Acct from '@/misc/acct.js';
import { sendEmail } from './send-email.js';
// TODO: locale ファイルをクライアント用とサーバー用で分けたい
async function follow(userId: User['id'], follower: User) {
/*
const userProfile = await UserProfiles.findOneByOrFail({ userId: userId });
if (!userProfile.email || !userProfile.emailNotificationTypes.includes('follow')) return;
const i18n = new I18n(userProfile.lang ?? 'en-US');
// TODO: render user information html
sendEmail(userProfile.email, i18n.t('_email._follow.title'), `${follower.name} (@${Acct.toString(follower)})`, `${follower.name} (@${Acct.toString(follower)})`);
*/
}
async function receiveFollowRequest(userId: User['id'], follower: User) {
/*
const userProfile = await UserProfiles.findOneByOrFail({ userId: userId });
if (!userProfile.email || !userProfile.emailNotificationTypes.includes('receiveFollowRequest')) return;
const i18n = new I18n(userProfile.lang ?? 'en-US');
// TODO: render user information html
sendEmail(userProfile.email, i18n.t('_email._receiveFollowRequest.title'), `${follower.name} (@${Acct.toString(follower)})`, `${follower.name} (@${Acct.toString(follower)})`);
*/
}
export const sendEmailNotification = {
follow,
receiveFollowRequest,
};