Merge branch 'hotfix/21.56.9' into master
[gitter.git] / server / api / v1 / sockets.js
blob76caa4a8af0ed1a5aa6efb475d46ff1fc07d1cd5
1 'use strict';
3 var presenceService = require('gitter-web-presence');
5 module.exports = function(req, res, next) {
6 var socketId = String(req.params.socketId);
7 var userId = req.user && req.user.id;
9 presenceService.socketDisconnectionRequested(userId, socketId, function(err) {
10 if (err) {
11 if (err.invalidSocketId) {
12 return res.sendStatus(400);
15 return next(err);
18 res.send('OK');
19 });