MCPcopy Create free account
hub / github.com/async-labs/async / unreadCommentAdded

Function unreadCommentAdded

api/server/sockets.ts:294–320  ·  view source on GitHub ↗
({
  socketId,
  userIdsToNotify,
  commentId,
  discussionId,
  comment,
}: {
  socketId?: string;
  userIdsToNotify: string[];
  commentId: string;
  discussionId: string;
  comment: ICommentDocument;
})

Source from the content-addressed store, hash-verified

292}
293
294function 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
322function unreadCommentDeleted({
323 socketId,

Callers 1

team-member.tsFile · 0.90

Calls 1

getSocketFunction · 0.85

Tested by

no test coverage detected