Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
a40bc57f06
No account linked to committer's email address
1 değiştirilmiş dosya ile 18 ekleme ve 0 silme
  1. 18
    0
      JitsiConference.js

+ 18
- 0
JitsiConference.js Dosyayı Görüntüle

@@ -1470,6 +1470,24 @@ JitsiConference.prototype.grantOwner = function(id) {
1470 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 1492
  * Kick participant from this conference.
1475 1493
  * @param {string} id id of the participant to kick

Loading…
İptal
Kaydet