mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Push Notifications Fixes - Part 2 (#12092)
* push notifications: handle some more error codes and when the user is loaded using .lean() * fix lint * do not send push notification if message is missing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { model as User } from '../models/user'; // eslint-disable-line import/no-cycle
|
||||
import { getUserInfo } from './email'; // eslint-disable-line import/no-cycle
|
||||
import { sendNotification as sendPushNotification } from './pushNotifications';
|
||||
import { sendNotification as sendPushNotification } from './pushNotifications'; // eslint-disable-line import/no-cycle
|
||||
|
||||
export async function getAuthorEmailFromMessage (message) {
|
||||
const authorId = message.uuid;
|
||||
@@ -30,6 +30,9 @@ export async function sendChatPushNotifications (user, group, message, mentions,
|
||||
if (mentions && mentions.includes(`@${member.auth.local.username}`) && member.preferences.pushNotifications.mentionParty !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.unformattedText) return;
|
||||
|
||||
sendPushNotification(
|
||||
member,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user