(socket)
| 363 | } |
| 364 | |
| 365 | async function parseNoteIdFromSocketAsync (socket) { |
| 366 | const noteId = extractNoteIdFromSocket(socket) |
| 367 | if (!noteId) { |
| 368 | return null |
| 369 | } |
| 370 | |
| 371 | return new Promise((resolve, reject) => { |
| 372 | models.Note.parseNoteId(noteId, function (err, id) { |
| 373 | if (err) { |
| 374 | reject(err) |
| 375 | } |
| 376 | if (!id) { |
| 377 | resolve(null) |
| 378 | } |
| 379 | resolve(id) |
| 380 | }) |
| 381 | }) |
| 382 | } |
| 383 | |
| 384 | // TODO: test it |
| 385 | function emitOnlineUsers (socket) { |
nothing calls this directly
no test coverage detected