Sync email notifications between owners of the room

master
Daniel Berteaud 11 years ago
parent 109ce1c9ba
commit 1effe36d96
  1. 11
      public/js/vroom.js

@ -94,6 +94,7 @@ function removeNotifiedEmail(email){
if (data.status == 'success'){
$.notify(data.msg, 'success');
$('#emailNotification_' + id).remove();
webrtc.sendToAll('notif_change', {});
}
else{
$.notify(data.msg, 'error');
@ -744,6 +745,15 @@ function initVroom(room) {
getPeerRole(data.id);
});
// A new notified email has been added
webrtc.on('notif_change', function(data){
if (peers.local.role != 'owner'){
return;
}
$('#emailNotificationList > li').remove();
getRoomInfo();
});
// A few notif on password set/unset or lock/unlock
webrtc.on('room_locked', function(data){
$('#lockLabel').addClass('btn-danger active');
@ -1172,6 +1182,7 @@ function initVroom(room) {
if (data.status == 'success'){
$.notify(data.msg, 'success');
addNotifiedEmail($('#newEmailNotification').val());
webrtc.sendToAll('notif_change', {});
$('#newEmailNotification').val('');
}
else{

Loading…
Cancel
Save