(socketId?: string)
| 118 | } |
| 119 | |
| 120 | function getSocket(socketId?: string) { |
| 121 | if (!io) { |
| 122 | return null; |
| 123 | } |
| 124 | |
| 125 | if (socketId && io.sockets.sockets.get(socketId)) { |
| 126 | // if client connected to socket broadcast to other connected sockets |
| 127 | return io.sockets.sockets.get(socketId).broadcast; |
| 128 | } else { |
| 129 | // if client NOT connected to socket sent to all sockets |
| 130 | return io; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | function discussionAdded({ |
| 135 | socketId, |
no outgoing calls
no test coverage detected