|
@@ -308,31 +308,6 @@ function initEtherpad(name) {
|
308
|
308
|
Etherpad.init(name);
|
309
|
309
|
}
|
310
|
310
|
|
311
|
|
-function onLocalRoleChanged(jid, info, pres, isModerator) {
|
312
|
|
- console.info("My role changed, new role: " + info.role);
|
313
|
|
- onModeratorStatusChanged(isModerator);
|
314
|
|
- VideoLayout.showModeratorIndicator();
|
315
|
|
- SettingsMenu.onRoleChanged();
|
316
|
|
-
|
317
|
|
- if (isModerator) {
|
318
|
|
- Authentication.closeAuthenticationWindow();
|
319
|
|
- messageHandler.notify(null, "notify.me",
|
320
|
|
- 'connected', "notify.moderator");
|
321
|
|
-
|
322
|
|
- Toolbar.checkAutoRecord();
|
323
|
|
- }
|
324
|
|
-}
|
325
|
|
-
|
326
|
|
-function onModeratorStatusChanged(isModerator) {
|
327
|
|
- Toolbar.showSipCallButton(isModerator);
|
328
|
|
- Toolbar.showRecordingButton(
|
329
|
|
- isModerator); //&&
|
330
|
|
- // FIXME:
|
331
|
|
- // Recording visible if
|
332
|
|
- // there are at least 2(+ 1 focus) participants
|
333
|
|
- //Object.keys(connection.emuc.members).length >= 3);
|
334
|
|
-}
|
335
|
|
-
|
336
|
311
|
UI.notifyPasswordRequired = function (callback) {
|
337
|
312
|
// password is required
|
338
|
313
|
Toolbar.lockLockButton();
|
|
@@ -413,24 +388,43 @@ function onPeerVideoTypeChanged(resourceJid, newVideoType) {
|
413
|
388
|
VideoLayout.onVideoTypeChanged(resourceJid, newVideoType);
|
414
|
389
|
}
|
415
|
390
|
|
416
|
|
-function onMucRoleChanged(role, displayName) {
|
|
391
|
+UI.updateLocalRole = function (isModerator) {
|
417
|
392
|
VideoLayout.showModeratorIndicator();
|
418
|
393
|
|
419
|
|
- if (role === 'moderator') {
|
420
|
|
- var messageKey, messageOptions = {};
|
421
|
|
- if (!displayName) {
|
422
|
|
- messageKey = "notify.grantedToUnknown";
|
423
|
|
- }
|
424
|
|
- else {
|
425
|
|
- messageKey = "notify.grantedTo";
|
426
|
|
- messageOptions = {to: displayName};
|
427
|
|
- }
|
|
394
|
+ Toolbar.showSipCallButton(isModerator);
|
|
395
|
+ Toolbar.showRecordingButton(isModerator);
|
|
396
|
+ SettingsMenu.onRoleChanged();
|
|
397
|
+
|
|
398
|
+ if (isModerator) {
|
|
399
|
+ Authentication.closeAuthenticationWindow();
|
|
400
|
+ messageHandler.notify(null, "notify.me", 'connected', "notify.moderator");
|
|
401
|
+
|
|
402
|
+ Toolbar.checkAutoRecord();
|
|
403
|
+ }
|
|
404
|
+};
|
|
405
|
+
|
|
406
|
+UI.updateUserRole = function (user) {
|
|
407
|
+ VideoLayout.showModeratorIndicator();
|
|
408
|
+
|
|
409
|
+ if (!user.isModerator()) {
|
|
410
|
+ return;
|
|
411
|
+ }
|
|
412
|
+
|
|
413
|
+ var displayName = user.getDisplayName();
|
|
414
|
+ if (displayName) {
|
428
|
415
|
messageHandler.notify(
|
429
|
|
- displayName,'notify.somebody',
|
430
|
|
- 'connected', messageKey,
|
431
|
|
- messageOptions);
|
|
416
|
+ displayName, 'notify.somebody',
|
|
417
|
+ 'connected', 'notify.grantedTo', {
|
|
418
|
+ to: displayName
|
|
419
|
+ }
|
|
420
|
+ );
|
|
421
|
+ } else {
|
|
422
|
+ messageHandler.notify(
|
|
423
|
+ '', 'notify.somebody',
|
|
424
|
+ 'connected', 'notify.grantedToUnknown', {}
|
|
425
|
+ );
|
432
|
426
|
}
|
433
|
|
-}
|
|
427
|
+};
|
434
|
428
|
|
435
|
429
|
UI.notifyAuthRequired = function (intervalCallback) {
|
436
|
430
|
Authentication.openAuthenticationDialog(
|