瀏覽代碼

Tying some loose ends

JC Brand 7 年之前
父節點
當前提交
12af9d5cbd
共有 3 個文件被更改,包括 4 次插入6 次删除
  1. 1 1
      src/converse-core.js
  2. 2 4
      src/converse-mam.js
  3. 1 1
      src/converse-register.js

+ 1 - 1
src/converse-core.js

@@ -373,7 +373,7 @@
         // Module-level functions
         // ----------------------
 
-        this.generateResource = () => `/converse.js-${Math.floor(Math.random()*139749825).toString()}`;
+        this.generateResource = () => `/converse.js-${Math.floor(Math.random()*139749528).toString()}`;
 
         this.sendCSI = function (stat) {
             /* Send out a Chat Status Notification (XEP-0352)

+ 2 - 4
src/converse-mam.js

@@ -84,10 +84,8 @@
 
         const messages = [];
         const message_handler = _converse.connection.addHandler(function (message) {
-            if (options.groupchat) {
-                if (message.getAttribute('from') !== options['with']) { // eslint-disable-line dot-notation
-                    return true;
-                }
+            if (options.groupchat || message.getAttribute('from') !== options['with']) { // eslint-disable-line dot-notation
+                return true;
             }
             const result = message.querySelector('result');
             if (!_.isNull(result) && result.getAttribute('queryid') === queryid) {

+ 1 - 1
src/converse-register.js

@@ -334,7 +334,7 @@
                         return;
                     }
                     form.querySelector('input[type=submit]').classList.add('hidden');
-                    this.fetchRegistrationForm(domain);
+                    this.fetchRegistrationForm(domain.trim());
                 },
 
                 fetchRegistrationForm (domain_name) {