فهرست منبع

Bugfix. Can't expect `fullname` to be set anymore.

JC Brand 7 سال پیش
والد
کامیت
c14ef3bb75
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 2 2
      src/converse-core.js
  2. 1 1
      src/templates/roster_item.html

+ 2 - 2
src/converse-core.js

@@ -1063,8 +1063,8 @@
                 const status1 = contact1.get('chat_status') || 'offline';
                 const status2 = contact2.get('chat_status') || 'offline';
                 if (_converse.STATUS_WEIGHTS[status1] === _converse.STATUS_WEIGHTS[status2]) {
-                    const name1 = contact1.get('fullname').toLowerCase();
-                    const name2 = contact2.get('fullname').toLowerCase();
+                    const name1 = (contact1.get('fullname') || contact1.get('jid')).toLowerCase();
+                    const name2 = (contact2.get('fullname') || contact2.get('jid')).toLowerCase();
                     return name1 < name2 ? -1 : (name1 > name2? 1 : 0);
                 } else  {
                     return _converse.STATUS_WEIGHTS[status1] < _converse.STATUS_WEIGHTS[status2] ? -1 : 1;

+ 1 - 1
src/templates/roster_item.html

@@ -4,7 +4,7 @@
     {[ if (o.num_unread) { ]}
     <span class="msgs-indicator">{{{ o.num_unread }}}</span>
     {[ } ]}
-    <span class="contact-name {[ if (o.num_unread) { ]} unread-msgs {[ } ]}">{{{o.fullname}}}</span></a>
+    <span class="contact-name {[ if (o.num_unread) { ]} unread-msgs {[ } ]}">{{{o.fullname || o.jid}}}</span></a>
 {[ if (o.allow_contact_removal) { ]}
 <a class="remove-xmpp-contact fa fa-trash" title="{{{o.desc_remove}}}" href="#"></a>
 {[ } ]}