This commit is contained in:
syuilo 2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View file

@ -38,7 +38,7 @@ export async function createImage(actor: IRemoteUser, value: any): Promise<Drive
if (file.url !== image.url) {
await DriveFiles.update({ id: file.id }, {
url: image.url,
uri: image.url
uri: image.url,
});
file = await DriveFiles.findOneOrFail(file.id);

View file

@ -75,10 +75,10 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s
if (err) {
logger.error(`${err.message}`, {
resolver: {
history: resolver.getHistory()
history: resolver.getHistory(),
},
value: value,
object: object
object: object,
});
throw new Error('invalid note');
}
@ -169,16 +169,16 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s
if (res) {
return {
status: 'ok',
res
res,
};
} else {
return {
status: 'permerror'
status: 'permerror',
};
}
} catch (e) {
return {
status: (e instanceof StatusError && e.isClientError) ? 'permerror' : 'temperror'
status: (e instanceof StatusError && e.isClientError) ? 'permerror' : 'temperror',
};
}
};
@ -313,7 +313,7 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
const exists = await Emojis.findOne({
host,
name
name,
});
if (exists) {
@ -333,7 +333,7 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
return await Emojis.findOne({
host,
name
name,
}) as Emoji;
}
@ -349,7 +349,7 @@ export async function extractEmojis(tags: IObject | IObject[], host: string): Pr
uri: tag.id,
url: tag.icon!.url,
updatedAt: new Date(),
aliases: []
aliases: [],
} as Partial<Emoji>);
}));
}

View file

@ -238,7 +238,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
avatarUrl,
bannerUrl,
avatarBlurhash,
bannerBlurhash
bannerBlurhash,
});
user!.avatarId = avatarId;
@ -407,7 +407,7 @@ const services: {
} = {
'misskey:authentication:twitter': (userId, screenName) => ({ userId, screenName }),
'misskey:authentication:github': (id, login) => ({ id, login }),
'misskey:authentication:discord': (id, name) => $discord(id, name)
'misskey:authentication:discord': (id, name) => $discord(id, name),
};
const $discord = (id: string, name: string) => {

View file

@ -1,6 +1,6 @@
import config from '@/config/index';
import Resolver from '../resolver';
import { IObject, IQuestion, isQuestion, } from '../type';
import { IObject, IQuestion, isQuestion } from '../type';
import { apLogger } from '../logger';
import { Notes, Polls } from '@/models/index';
import { IPoll } from '@/models/entities/poll';
@ -31,7 +31,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver
choices,
votes,
multiple,
expiresAt
expiresAt,
};
}
@ -76,7 +76,7 @@ export async function updateQuestion(value: any) {
}
await Polls.update({ noteId: note.id }, {
votes: poll.votes
votes: poll.votes,
});
return changed;