瀏覽代碼

Render nickname form when entering a room via invitation

JC Brand 8 年之前
父節點
當前提交
86dc3800aa
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 2 1
      CHANGES.md
  2. 4 5
      src/converse-muc.js

+ 2 - 1
CHANGES.md

@@ -16,10 +16,11 @@
   [jcbrand]
 - API change: the `message` event now returns a data object with `stanza` and
   `chatbox` attributes, instead of just the stanza. [jcbrand]
-- Remove all inline CSS to comply with strict Content-Security-Policy headers [mathiasertl]
+- Render nickname form when entering a room via invitation. [jcbrand]
 - #567 Unreaded message count reset on page load [novokrest]
 - #591 Unread message counter is reset when the chatbox is closed [novokrest]
 - #754 Show unread messages next to roster contacts. [jcbrand]
+- #864 Remove all inline CSS to comply with strict Content-Security-Policy headers [mathiasertl]
 - #873 Inconsistent unread messages count updating [novokrest]
 
 ## 3.0.2 (2017-04-23)

+ 4 - 5
src/converse-muc.js

@@ -1521,14 +1521,14 @@
                      * chat room with it.
                      */
                     ev.preventDefault();
-                    var $nick = this.$el.find('input[name=nick]');
-                    var nick = $nick.val();
+                    var nick_el = ev.target.nick;
+                    var nick = nick_el.value;
                     if (!nick) {
-                        $nick.addClass('error');
+                        nick_el.classList.add('error');
                         return;
                     }
                     else {
-                        $nick.removeClass('error');
+                        nick_el.classList.remove('error');
                     }
                     this.$el.find('.chatroom-form-container')
                             .replaceWith('<span class="spinner centered"/>');
@@ -2632,7 +2632,6 @@
                         'id': room_jid,
                         'jid': room_jid,
                         'name': Strophe.unescapeNode(Strophe.getNodeFromJid(room_jid)),
-                        'nick': Strophe.unescapeNode(Strophe.getNodeFromJid(_converse.connection.jid)),
                         'type': 'chatroom',
                         'box_id': b64_sha1(room_jid),
                         'password': $x.attr('password')