Ready to implement call system

This commit is contained in:
Pierre HUBERT 2020-04-10 11:24:46 +02:00
parent c8d0fc3186
commit a59b9b6441
3 changed files with 22 additions and 4 deletions

View File

@ -0,0 +1,18 @@
/**
* Calls controller
*
* @author Pierre Hubert
*/
class CallsController {
/**
* Open a call for a conversation
*
* @param {Conversation} conv Information about the target conversation
*/
static Open(conv) {
alert("Open call for conversation " + conv.ID);
}
}

View File

@ -585,11 +585,11 @@ const ConvChatWindow = {
showCallButton: function(conversation){
//Check if calls are disabled
if(/*TODO : implement */false)
if(!conversation.infos.can_have_call)
return;
//Add the call button
var button = createElem2({
const button = createElem2({
insertBefore: conversation.box.boxTools.firstChild,
type: "button",
class: "btn btn-box-tool",
@ -598,7 +598,7 @@ const ConvChatWindow = {
conversation.box.callButton = button;
button.addEventListener("click", function(){
// TODO : implement
CallsController.Open(conversation.infos)
});
},

View File

@ -456,7 +456,7 @@ class Dev {
"js/components/incognito/keyboard.js",
//Calls component
"js/components/calls/controller.js",
// Web app component
"js/components/webApp/interface.js",