Explorar el Código

MUC: connect with stored password, if available

JC Brand hace 4 años
padre
commit
af4fd3b0c2
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/headless/converse-muc.js

+ 3 - 0
src/headless/converse-muc.js

@@ -440,6 +440,8 @@ converse.plugins.add('converse-muc', {
              * @method _converse.ChatRoom#join
              * @param { String } nick - The user's nickname
              * @param { String } [password] - Optional password, if required by the groupchat.
+             *  Will fall back to the `password` value stored in the room
+             *  model (if available).
              */
             async join (nick, password) {
                 if (this.session.get('connection_status') === converse.ROOMSTATUS.ENTERED) {
@@ -462,6 +464,7 @@ converse.plugins.add('converse-muc', {
                 }).c("x", {'xmlns': Strophe.NS.MUC})
                   .c("history", {'maxstanzas': this.features.get('mam_enabled') ? 0 : api.settings.get('muc_history_max_stanzas')}).up();
 
+                password = password || this.get('password');
                 if (password) {
                     stanza.cnode(Strophe.xmlElement("password", [], password));
                 }