Only notify you are owner if it's the case

Check that we're really owner now before notifying
master
Daniel Berteaud 11 years ago
parent e7d4e34a49
commit 1bc08f124a
  1. 4
      public/js/vroom.js

@ -913,8 +913,10 @@ function initVroom(room) {
} }
if (data.payload.peer && data.payload.peer == peers.local.id && peers.local.role != 'owner'){ if (data.payload.peer && data.payload.peer == peers.local.id && peers.local.role != 'owner'){
var who = (peers[data.id].hasName) ? peers[data.id].displayName : locale.A_ROOM_ADMIN; var who = (peers[data.id].hasName) ? peers[data.id].displayName : locale.A_ROOM_ADMIN;
$.notify(sprintf(locale.s_IS_PROMOTING_YOU, who), 'success');
getRoomInfo(); getRoomInfo();
if (peers.local.role == 'owner'){
$.notify(sprintf(locale.s_IS_PROMOTING_YOU, who), 'success');
}
} }
else if (data.payload.peer != peers.local.id && peers[data.payload.peer]){ else if (data.payload.peer != peers.local.id && peers[data.payload.peer]){
var who = (peers[data.id].hasName) ? peers[data.id].displayName : locale.A_ROOM_ADMIN; var who = (peers[data.id].hasName) ? peers[data.id].displayName : locale.A_ROOM_ADMIN;

Loading…
Cancel
Save