فهرست منبع

Update contact nickname when receive a roster push

André Berenguel 6 سال پیش
والد
کامیت
8dcb327ead
4فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 1 0
      CHANGES.md
  2. 1 0
      dist/converse.js
  3. 2 2
      spec/protocol.js
  4. 1 0
      src/headless/converse-roster.js

+ 1 - 0
CHANGES.md

@@ -20,6 +20,7 @@
 - #1417 Margin between nickname and badge
 - #1421 Fix direct invite for membersonly room
 - #1422 Resurrect the `muc_show_join_leave` option
+- #1438 Update contact nickname when receiving a roster push
 - #1442 MUC read receipts causing empty lines
 
 ## 4.1.0 (2019-01-11)

+ 1 - 0
dist/converse.js

@@ -68673,6 +68673,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
           contact.save({
             'subscription': subscription,
             'ask': ask,
+            'nickname': item.getAttribute("name"),
             'requesting': null,
             'groups': groups
           });

+ 2 - 2
spec/protocol.js

@@ -270,7 +270,7 @@
                     .c('item', {
                         'jid': 'contact@example.org',
                         'subscription': 'to',
-                        'name': 'contact@example.org'});
+                        'name': 'Nicky'});
                 _converse.connection._dataRecv(test_utils.createRequest(stanza));
                 // Check that the IQ set was acknowledged.
                 expect(sent_stanza.toLocaleString()).toBe( // Strophe adds the xmlns attr (although not in spec)
@@ -294,7 +294,7 @@
                 expect($contacts.hasClass('to')).toBeTruthy();
                 expect($contacts.hasClass('both')).toBeFalsy();
                 expect($contacts.hasClass('current-xmpp-contact')).toBeTruthy();
-                expect($contacts.text().trim()).toBe('Contact');
+                expect($contacts.text().trim()).toBe('Nicky');
                 expect(contact.presence.get('show')).toBe('offline');
 
                 /*  <presence

+ 1 - 0
src/headless/converse-roster.js

@@ -627,6 +627,7 @@ converse.plugins.add('converse-roster', {
                     contact.save({
                         'subscription': subscription,
                         'ask': ask,
+                        'nickname': item.getAttribute("name"),
                         'requesting': null,
                         'groups': groups
                     });