diff --git a/packages/rocketchat-ui-sidenav/client/roomList.js b/packages/rocketchat-ui-sidenav/client/roomList.js index 34ec4967b271..81929434b5be 100644 --- a/packages/rocketchat-ui-sidenav/client/roomList.js +++ b/packages/rocketchat-ui-sidenav/client/roomList.js @@ -21,7 +21,12 @@ Template.roomList.helpers({ const query = { open: true }; - const sort = { 't': 1, 'name': 1 }; + const sort = { 't': 1 }; + if (this.identifier === 'd' && RocketChat.settings.get('UI_Use_Real_Name')) { + sort.fname = 1; + } else { + sort.name = 1; + } if (this.identifier === 'f') { query.f = favoritesEnabled; } else {