Add fname to subscriptions in memory#6597
Conversation
fname to subscriptions in memoryfname to subscriptions in memory
| _id: fromId | ||
| }); | ||
| if (message.u && message.u._id && UI_Use_Real_Name) { | ||
| const user = RocketChat.models.Users.findOneById(message.u._id); |
There was a problem hiding this comment.
Isn't this going to make quite a lot of request to the db to get the users name?
Would it be better to collect an array of user ids then fetch the full names all at once outside the loop?
There was a problem hiding this comment.
Not to the DB, to the memory cache, it's really fast cuz is indexed using a hash map
| Meteor.startup(function() { | ||
| function publishMessage(type, record) { | ||
| if (record._hidden !== true && (record.imported == null)) { | ||
| if (record.u && record.u._id) { |
There was a problem hiding this comment.
Should this check for the UI_Use_Real_Name setting before doing this?
| const messages = _.map(records, (message) => { | ||
| message.starred = _.findWhere(message.starred, { _id: fromUserId }); | ||
| if (message.u && message.u._id && UI_Use_Real_Name) { | ||
| const user = RocketChat.models.Users.findOneById(message.u._id); |
There was a problem hiding this comment.
Same as my other comment, would it be better to fetch all users in result at once, then map the name on to message.u.name?
alexbrazier
left a comment
There was a problem hiding this comment.
There appears to be an issue with showing the real name in the suggestions when mentioning a user, however this appears to be an issue in the develop branch as well, rather than something with this PR.
|
Hm, where is the real name setting (Running 0.55.1) EDIT: Okay, it's Layout -> User Interface |
|
But the user ist is sorted by user name, not real name? That is a bit strange ... |
|
Also the quick search (Ctrl+K) does not seem to take the fullname into account |
@RocketChat/core