Переглянути джерело

Feature: Moderator can revoke moderator role to others and himself (#1532)

* Feature: Moderator can revoke moderator role to others and himself

* Code review inputs

* Code review inputs
dev1
BenjaminVega 4 роки тому
джерело
коміт
a40bc57f06
Аккаунт користувача з таким Email не знайдено
1 змінених файлів з 18 додано та 0 видалено
  1. 18
    0
      JitsiConference.js

+ 18
- 0
JitsiConference.js Переглянути файл

1470
     this.room.setAffiliation(participant.getJid(), 'owner');
1470
     this.room.setAffiliation(participant.getJid(), 'owner');
1471
 };
1471
 };
1472
 
1472
 
1473
+/**
1474
+ * Revoke owner rights to the participant or local Participant as
1475
+ * the user might want to refuse to be a moderator.
1476
+ * @param {string} id id of the participant to revoke owner rights to.
1477
+ */
1478
+JitsiConference.prototype.revokeOwner = function(id) {
1479
+    const participant = this.getParticipantById(id);
1480
+    const isMyself = this.myUserId() === id;
1481
+    const role = this.isMembersOnly() ? 'member' : 'none';
1482
+
1483
+    if (isMyself) {
1484
+        this.room.setAffiliation(this.room.myroomjid, role);
1485
+    } else if (participant) {
1486
+        this.room.setAffiliation(participant.getJid(), role);
1487
+    }
1488
+};
1489
+
1490
+
1473
 /**
1491
 /**
1474
  * Kick participant from this conference.
1492
  * Kick participant from this conference.
1475
  * @param {string} id id of the participant to kick
1493
  * @param {string} id id of the participant to kick

Завантаження…
Відмінити
Зберегти