Move MatrixChat and login components to react SDK.

Removed Modulator as it is no longer necessary in this form. ConferenceHandler
is injected in src/vector/index.js
This commit is contained in:
Kegan Dougal 2015-11-30 18:11:04 +00:00
parent 02a71b20a9
commit 1e694da460
11 changed files with 1066 additions and 125 deletions

View file

@ -56,12 +56,12 @@ var Modal = require('./Modal');
var sdk = require('./index');
var Matrix = require("matrix-js-sdk");
var dis = require("./dispatcher");
var Modulator = require("./Modulator");
global.mxCalls = {
//room_id: MatrixCall
};
var calls = global.mxCalls;
var ConferenceHandler = null;
function play(audioId) {
// TODO: Attach an invisible element for this instead
@ -227,7 +227,7 @@ function _onAction(payload) {
break;
case 'place_conference_call':
console.log("Place conference call in %s", payload.room_id);
if (!Modulator.hasConferenceHandler()) {
if (!ConferenceHandler) {
Modal.createDialog(ErrorDialog, {
description: "Conference calls are not supported in this client"
});
@ -239,7 +239,6 @@ function _onAction(payload) {
});
}
else {
var ConferenceHandler = Modulator.getConferenceHandler();
ConferenceHandler.createNewMatrixCall(
MatrixClientPeg.get(), payload.room_id
).done(function(call) {
@ -295,8 +294,7 @@ var callHandler = {
var call = module.exports.getCall(roomId);
if (call) return call;
if (Modulator.hasConferenceHandler()) {
var ConferenceHandler = Modulator.getConferenceHandler();
if (ConferenceHandler) {
call = ConferenceHandler.getConferenceCallForRoom(roomId);
}
if (call) return call;
@ -317,6 +315,10 @@ var callHandler = {
}
}
return null;
},
setConferenceHandler: function(confHandler) {
ConferenceHandler = confHandler;
}
};
// Only things in here which actually need to be global are the