mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Add changes
This commit is contained in:
+1
-1
@@ -55,7 +55,7 @@ class Context {
|
||||
this.log = parent.log || createLogger('context', this.id);
|
||||
|
||||
// Load the current logged in user to `user`, otherwise this will be null.
|
||||
this.user = get(parent, 'user', null);
|
||||
this.user = get(parent, 'user');
|
||||
|
||||
// Attach the connectors.
|
||||
this.connectors = connectors;
|
||||
|
||||
@@ -4,7 +4,6 @@ const util = require('./util');
|
||||
|
||||
const { SEARCH_OTHER_USERS } = require('../../perms/constants');
|
||||
|
||||
const UsersService = require('../../services/users');
|
||||
const { escapeRegExp } = require('../../services/regex');
|
||||
const UserModel = require('../../models/user');
|
||||
|
||||
@@ -56,12 +55,9 @@ const genUserByIDs = async (context, ids) => {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (ids.length === 1) {
|
||||
const user = await UsersService.findById(ids[0]);
|
||||
return [user];
|
||||
}
|
||||
|
||||
return UsersService.findByIdArray(ids).then(util.singleJoinBy(ids, 'id'));
|
||||
return UserModel.find({ id: { $in: ids } }).then(
|
||||
util.singleJoinBy(ids, 'id')
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user