Real-time Chat (#7664)

* feat(realtime-chat): add Pusher library to the server

* feat(realtime-chat): only for private groups

* feat(realtime-chat): add authentication endpoint for Pusher

* feat(realtime-chat): client proof of concept

* fix typo in apidoc

* feat(realtime-chat): redo authentication and write integration tests

* remove firebase code

* fix client side tests

* fix line ending in bower.json

* feat(realtime chat): use presence channels for parties, send events & disconnect clients if user leaves or is removed from party, automatically update UI

* pusher: enable all events in the background

* fix pusher integration tests
This commit is contained in:
Matteo Pagliazzi
2016-07-02 15:17:24 +02:00
committed by GitHub
parent 889c41fa18
commit 0880850408
26 changed files with 393 additions and 285 deletions

View File

@@ -6,7 +6,6 @@ var async = require('async');
var utils = require('../../libs/api-v2/utils');
var nconf = require('nconf');
var request = require('request');
var FirebaseTokenGenerator = require('firebase-token-generator');
import {
model as User,
} from '../../models/user';
@@ -351,28 +350,6 @@ api.changePassword = function(req, res, next) {
})
};
// DISABLED FOR API v2
/*var firebaseTokenGeneratorInstance = new FirebaseTokenGenerator(nconf.get('FIREBASE:SECRET'));
api.getFirebaseToken = function(req, res, next) {
var user = res.locals.user;
// Expires 24 hours after now (60*60*24*1000) (in milliseconds)
var expires = new Date();
expires.setTime(expires.getTime() + 86400000);
var token = firebaseTokenGeneratorInstance
.createToken({
uid: user._id,
isHabiticaUser: true
}, {
expires: expires
});
res.status(200).json({
token: token,
expires: expires
});
};*/
// DISABLED FOR API v2
/*api.setupPassport = function(router) {