mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-04 17:34:08 +00:00
27 lines
554 B
JavaScript
27 lines
554 B
JavaScript
|
/**
|
||
|
* 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;
|
||
|
|
||
|
}
|
||
|
|
||
|
};
|