feat: Implement direct notification for new messages and read receipts to conversation participants.
This commit is contained in:
@@ -555,6 +555,28 @@ export class MessagesService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get participant user IDs for a conversation (lightweight query)
|
||||
*/
|
||||
async getConversationParticipants(conversationId: string): Promise<{ userId: string; agentUserId: string } | null> {
|
||||
const conversation = await this.prisma.conversation.findUnique({
|
||||
where: { id: conversationId },
|
||||
select: {
|
||||
userId: true,
|
||||
agentProfile: {
|
||||
select: { userId: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!conversation) return null;
|
||||
|
||||
return {
|
||||
userId: conversation.userId,
|
||||
agentUserId: conversation.agentProfile.userId,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total unread count for a user across all conversations
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user