Rename updateRole to getRoomInfo

As it's now used for much more than getting our own role
master
Daniel Berteaud 11 years ago
parent f6ddfd119c
commit 109ce1c9ba
  1. 10
      public/js/vroom.js

@ -160,7 +160,7 @@ function initVroom(room) {
} }
// Update our role // Update our role
function updateRole(){ function getRoomInfo(){
$.ajax({ $.ajax({
data: { data: {
action: 'getRoomInfo', action: 'getRoomInfo',
@ -766,7 +766,7 @@ function initVroom(room) {
$.notify(sprintf(locale.OWNER_PASSWORD_CHANGED_BY_s, stringEscape(peers[data.id].displayName)), 'warn'); $.notify(sprintf(locale.OWNER_PASSWORD_CHANGED_BY_s, stringEscape(peers[data.id].displayName)), 'warn');
} }
else{ else{
updateRole(); getRoomInfo();
} }
}); });
webrtc.on('owner_password_removed', function(data){ webrtc.on('owner_password_removed', function(data){
@ -774,14 +774,14 @@ function initVroom(room) {
$.notify(sprintf(locale.OWNER_PASSWORD_REMOVED_BY_s, stringEscape(peers[data.id].displayName)), 'warn'); $.notify(sprintf(locale.OWNER_PASSWORD_REMOVED_BY_s, stringEscape(peers[data.id].displayName)), 'warn');
} }
else{ else{
updateRole(); getRoomInfo();
} }
}); });
// Handle the readyToCall event: join the room // Handle the readyToCall event: join the room
webrtc.once('readyToCall', function () { webrtc.once('readyToCall', function () {
peers.local.id = webrtc.connection.socket.sessionid; peers.local.id = webrtc.connection.socket.sessionid;
updateRole(); getRoomInfo();
webrtc.joinRoom(room); webrtc.joinRoom(room);
}); });
@ -1009,7 +1009,7 @@ function initVroom(room) {
success: function(data) { success: function(data) {
$('#authPass').val(''); $('#authPass').val('');
if (data.status == 'success'){ if (data.status == 'success'){
updateRole(); getRoomInfo();
$.notify(data.msg, 'success'); $.notify(data.msg, 'success');
} }
else{ else{

Loading…
Cancel
Save