JC Brand преди 6 години
родител
ревизия
f5b10ff6e8
променени са 1 файла, в които са добавени 35 реда и са изтрити 37 реда
  1. 35 37
      src/converse-muc-views.js

+ 35 - 37
src/converse-muc-views.js

@@ -887,26 +887,25 @@
                             if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
                             if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
                                 break;
                                 break;
                             }
                             }
-                            this.model.setAffiliation('admin',
-                                    [{ 'jid': args[0],
-                                       'reason': args[1]
-                                    }]).then(
-                                        () => this.model.occupants.fetchMembers(),
-                                        (err) => this.onCommandError(err)
-                                    );
+                            this.model.setAffiliation('admin', [{
+                                'jid': args[0],
+                                'reason': args[1]
+                            }]).then(
+                                () => this.model.occupants.fetchMembers(),
+                                (err) => this.onCommandError(err)
+                            );
                             break;
                             break;
                         case 'ban':
                         case 'ban':
                             if (!this.verifyAffiliations(['owner', 'admin']) || !this.validateRoleChangeCommand(command, args)) {
                             if (!this.verifyAffiliations(['owner', 'admin']) || !this.validateRoleChangeCommand(command, args)) {
                                 break;
                                 break;
                             }
                             }
-
-                            this.model.setAffiliation('outcast',
-                                    [{ 'jid': args[0],
-                                       'reason': args[1]
-                                    }]).then(
-                                        () => this.model.occupants.fetchMembers(),
-                                        (err) => this.onCommandError(err)
-                                    );
+                            this.model.setAffiliation('outcast', [{
+                                'jid': args[0],
+                                'reason': args[1]
+                            }]).then(
+                                () => this.model.occupants.fetchMembers(),
+                                (err) => this.onCommandError(err)
+                            );
                             break;
                             break;
                         case 'deop':
                         case 'deop':
                             if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
                             if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
@@ -959,14 +958,13 @@
                             }
                             }
                             const occupant = this.model.occupants.findWhere({'nick': args[0]}) ||
                             const occupant = this.model.occupants.findWhere({'nick': args[0]}) ||
                                              this.model.occupants.findWhere({'jid': args[0]});
                                              this.model.occupants.findWhere({'jid': args[0]});
-
-                            this.model.setAffiliation('member',
-                                    [{ 'jid': occupant.get('jid'),
-                                       'reason': args[1]
-                                    }]).then(
-                                        () => this.model.occupants.fetchMembers(),
-                                        (err) => this.onCommandError(err)
-                                    );
+                            this.model.setAffiliation('member', [{
+                                'jid': occupant.get('jid'),
+                                'reason': args[1]
+                            }]).then(
+                                () => this.model.occupants.fetchMembers(),
+                                (err) => this.onCommandError(err)
+                            );
                             break;
                             break;
                         } case 'nick':
                         } case 'nick':
                             if (!this.verifyRoles(['visitor', 'participant', 'moderator'])) {
                             if (!this.verifyRoles(['visitor', 'participant', 'moderator'])) {
@@ -982,13 +980,13 @@
                             if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
                             if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
                                 break;
                                 break;
                             }
                             }
-                            this.model.setAffiliation('owner',
-                                    [{ 'jid': args[0],
-                                       'reason': args[1]
-                                    }]).then(
-                                        () => this.model.occupants.fetchMembers(),
-                                        (err) => this.onCommandError(err)
-                                    );
+                            this.model.setAffiliation('owner', [{
+                                'jid': args[0],
+                                'reason': args[1]
+                            }]).then(
+                                () => this.model.occupants.fetchMembers(),
+                                (err) => this.onCommandError(err)
+                            );
                             break;
                             break;
                         case 'op':
                         case 'op':
                             if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
                             if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
@@ -1009,13 +1007,13 @@
                             if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
                             if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
                                 break;
                                 break;
                             }
                             }
-                            this.model.setAffiliation('none',
-                                    [{ 'jid': args[0],
-                                       'reason': args[1]
-                                    }]).then(
-                                        () => this.model.occupants.fetchMembers(),
-                                        (err) => this.onCommandError(err)
-                                    );
+                            this.model.setAffiliation('none', [{
+                                'jid': args[0],
+                                'reason': args[1]
+                            }]).then(
+                                () => this.model.occupants.fetchMembers(),
+                                (err) => this.onCommandError(err)
+                            );
                             break;
                             break;
                         case 'topic':
                         case 'topic':
                         case 'subject':
                         case 'subject':