Skip to content

Commit

Permalink
filter out system messages
Browse files Browse the repository at this point in the history
  • Loading branch information
LomyW committed Jan 18, 2024
1 parent 32cbb30 commit 7adaf39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/controllers/chatNotificationController/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ export async function getNotificationContext(notificationBody: NotificationTrigg
courseId = subcourse.courseId;
}

const filteredMessages = messages.filter((message) => message.type !== 'SystemMessage');

notificationContext = {
sender: { firstname: firstnameSender },
conversationId: conversation.id,
message: messages[0].text,
message: filteredMessages[0].text,
totalUnread: messages.length.toString(),
...(match ? { matchId: match.matchId } : {}),
...(courseId ? { courseId: courseId.toString() } : {}),
Expand Down

0 comments on commit 7adaf39

Please sign in to comment.