Skip to content

Commit

Permalink
do not send notification for system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
LomyW committed Jan 22, 2024
1 parent 6af9b04 commit 48d9d79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/controllers/chatNotificationController/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ async function handleChatNotification(req: WithRawBody<Request>, res: Response):
const chatType = getChatType(conversationParticipants);

const isUserVerified = await verifyChatUser(recipientUser);
const onlySystemMessages = data.messages.every((m) => m.type === 'SystemMessage');

if (isUserVerified) {
if (!onlySystemMessages && isUserVerified) {
const notificationContext = await getNotificationContext(notificationBody);

const notificationAction = chatType === ChatType.ONE_ON_ONE ? 'missed_one_on_one_chat_message' : 'missed_course_chat_message';
Expand Down

0 comments on commit 48d9d79

Please sign in to comment.