mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 14:03:08 +02:00
oops
This commit is contained in:
parent
6785f50a1f
commit
4955df3911
2 changed files with 8 additions and 3 deletions
|
@ -6,6 +6,11 @@ import { createPerson } from './activitypub/models/person';
|
||||||
|
|
||||||
export default async (username, _host, option?): Promise<IUser> => {
|
export default async (username, _host, option?): Promise<IUser> => {
|
||||||
const usernameLower = username.toLowerCase();
|
const usernameLower = username.toLowerCase();
|
||||||
|
|
||||||
|
if (_host == null) {
|
||||||
|
return await User.findOne({ usernameLower });
|
||||||
|
}
|
||||||
|
|
||||||
const hostAscii = toASCII(_host).toLowerCase();
|
const hostAscii = toASCII(_host).toLowerCase();
|
||||||
const host = toUnicode(hostAscii);
|
const host = toUnicode(hostAscii);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class NotificationManager {
|
||||||
private list: Array<{
|
private list: Array<{
|
||||||
user: ILocalUser['_id'],
|
user: ILocalUser['_id'],
|
||||||
reason: Reason;
|
reason: Reason;
|
||||||
}>;
|
}> = [];
|
||||||
|
|
||||||
constructor(user, note) {
|
constructor(user, note) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
@ -300,10 +300,10 @@ export default async (user: IUser, data: {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Append mentions data
|
// Append mentions data
|
||||||
if (mentions.length > 0) {
|
if (mentionedUsers.length > 0) {
|
||||||
Note.update({ _id: note._id }, {
|
Note.update({ _id: note._id }, {
|
||||||
$set: {
|
$set: {
|
||||||
mentions
|
mentions: mentionedUsers.map(u => u._id)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue