mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Created calls utilities
This commit is contained in:
parent
cbfe141c32
commit
1a3117a603
@ -1194,7 +1194,14 @@ var ComunicWeb = {
|
|||||||
*/
|
*/
|
||||||
ringScreen: {
|
ringScreen: {
|
||||||
//TODO : implement
|
//TODO : implement
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls utilities
|
||||||
|
*/
|
||||||
|
utils: {
|
||||||
|
//TODO : implement
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -593,11 +593,7 @@ ComunicWeb.components.calls.callWindow = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//Check if all other members rejected call
|
//Check if all other members rejected call
|
||||||
var allDisconnected = true;
|
var allDisconnected = ComunicWeb.components.calls.utils.hasEveryoneLeft(call.info);
|
||||||
call.info.members.forEach(function(member){
|
|
||||||
if(member.status != "rejected" && member.status != "hang_up" && member.userID != userID())
|
|
||||||
allDisconnected = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
//Check if all call peer rejected the call
|
//Check if all call peer rejected the call
|
||||||
if(allDisconnected){
|
if(allDisconnected){
|
||||||
|
27
assets/js/components/calls/utils.js
Normal file
27
assets/js/components/calls/utils.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* Calls utilities
|
||||||
|
*
|
||||||
|
* @author Pierre HUBERT
|
||||||
|
*/
|
||||||
|
|
||||||
|
ComunicWeb.components.calls.utils = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check out whether all the members of a conversation stop to follow it,
|
||||||
|
* except the current user
|
||||||
|
*
|
||||||
|
* @param {Object} info Information about the conversation to analyze
|
||||||
|
*/
|
||||||
|
hasEveryoneLeft: function(info){
|
||||||
|
|
||||||
|
var allDisconnected = true;
|
||||||
|
info.members.forEach(function(member){
|
||||||
|
if(member.status != "rejected" && member.status != "hang_up" && member.userID != userID())
|
||||||
|
allDisconnected = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return allDisconnected;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
@ -453,6 +453,7 @@ class Dev {
|
|||||||
"js/components/calls/currentList.js",
|
"js/components/calls/currentList.js",
|
||||||
"js/components/calls/userMedia.js",
|
"js/components/calls/userMedia.js",
|
||||||
"js/components/calls/ringScreen.js",
|
"js/components/calls/ringScreen.js",
|
||||||
|
"js/components/calls/utils.js",
|
||||||
|
|
||||||
//Pacman component (easter egg)
|
//Pacman component (easter egg)
|
||||||
"js/components/pacman.js",
|
"js/components/pacman.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user