(userId, conversationId, teamId = null)
| 56 | } |
| 57 | |
| 58 | async canJoinConversation(userId, conversationId, teamId = null) { |
| 59 | if (!userId || !conversationId) { |
| 60 | return false; |
| 61 | } |
| 62 | |
| 63 | const where = { |
| 64 | id: conversationId, |
| 65 | user_id: userId, |
| 66 | }; |
| 67 | |
| 68 | if (teamId) { |
| 69 | where.team_id = teamId; |
| 70 | } |
| 71 | |
| 72 | const conversation = await db.AiConversation.findOne({ where }); |
| 73 | return Boolean(conversation); |
| 74 | } |
| 75 | |
| 76 | async initialize(server) { |
| 77 | this.io = new Server(server, { |
no outgoing calls
no test coverage detected