mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-25 07:36:18 +09:00
Fix bug
This commit is contained in:
parent
931dc4b1bd
commit
d45e2661aa
@ -3,13 +3,20 @@ import * as debug from 'debug';
|
||||
import uploadFromUrl from '../../../services/drive/upload-from-url';
|
||||
import { IRemoteUser } from '../../../models/user';
|
||||
import { IDriveFile } from '../../../models/drive-file';
|
||||
import Resolver from '../resolver';
|
||||
|
||||
const log = debug('misskey:activitypub');
|
||||
|
||||
/**
|
||||
* Imageを作成します。
|
||||
*/
|
||||
export async function createImage(actor: IRemoteUser, image): Promise<IDriveFile> {
|
||||
export async function createImage(actor: IRemoteUser, value): Promise<IDriveFile> {
|
||||
const image = await new Resolver().resolve(value);
|
||||
|
||||
if (image.url == null) {
|
||||
throw new Error('invalid image: url not privided');
|
||||
}
|
||||
|
||||
log(`Creating the Image: ${image.url}`);
|
||||
|
||||
return await uploadFromUrl(image.url, actor);
|
||||
|
@ -14,6 +14,7 @@ export interface IObject {
|
||||
content: string;
|
||||
icon?: any;
|
||||
image?: any;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export interface IActivity extends IObject {
|
||||
|
Loading…
Reference in New Issue
Block a user