({
socketId,
userIdsToNotify,
commentId,
discussionId,
comment,
}: {
socketId?: string;
userIdsToNotify: string[];
commentId: string;
discussionId: string;
comment: ICommentDocument;
})
| 292 | } |
| 293 | |
| 294 | function unreadCommentAdded({ |
| 295 | socketId, |
| 296 | userIdsToNotify, |
| 297 | commentId, |
| 298 | discussionId, |
| 299 | comment, |
| 300 | }: { |
| 301 | socketId?: string; |
| 302 | userIdsToNotify: string[]; |
| 303 | commentId: string; |
| 304 | discussionId: string; |
| 305 | comment: ICommentDocument; |
| 306 | }) { |
| 307 | const socket = getSocket(socketId); |
| 308 | if (socket) { |
| 309 | userIdsToNotify.forEach((userId) => { |
| 310 | const roomName = `user-${userId}`; |
| 311 | socket.to(roomName).emit('unreadCommentEvent', { |
| 312 | actionType: 'added', |
| 313 | commentId, |
| 314 | userId, |
| 315 | discussionId, |
| 316 | comment, |
| 317 | }); |
| 318 | }); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | function unreadCommentDeleted({ |
| 323 | socketId, |
no test coverage detected