diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-05 03:21:11 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-05 03:21:11 +0900 |
| commit | c2c03a1c650c0395fc4d77334ec86d00b1bb24c2 (patch) | |
| tree | 12a55d4b30ede3892a0bd747dfe386307e7eeb77 /src/api | |
| parent | wip (diff) | |
| download | misskey-c2c03a1c650c0395fc4d77334ec86d00b1bb24c2.tar.gz misskey-c2c03a1c650c0395fc4d77334ec86d00b1bb24c2.tar.bz2 misskey-c2c03a1c650c0395fc4d77334ec86d00b1bb24c2.zip | |
wip
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/drive/add-file.ts | 12 | ||||
| -rw-r--r-- | src/api/drive/upload-from-url.ts | 2 | ||||
| -rw-r--r-- | src/api/post/create.ts | 13 | ||||
| -rw-r--r-- | src/api/post/watch.ts | 2 |
4 files changed, 15 insertions, 14 deletions
diff --git a/src/api/drive/add-file.ts b/src/api/drive/add-file.ts index 24eb5208d5..64a2f18340 100644 --- a/src/api/drive/add-file.ts +++ b/src/api/drive/add-file.ts @@ -10,12 +10,12 @@ import * as debug from 'debug'; import fileType = require('file-type'); import prominence = require('prominence'); -import DriveFile, { IMetadata, getGridFSBucket } from '../models/drive-file'; -import DriveFolder from '../models/drive-folder'; -import { pack } from '../models/drive-file'; -import event, { publishDriveStream } from '../publishers/stream'; -import getAcct from '../acct/render'; -import config from '../config'; +import DriveFile, { IMetadata, getGridFSBucket } from '../../models/drive-file'; +import DriveFolder from '../../models/drive-folder'; +import { pack } from '../../models/drive-file'; +import event, { publishDriveStream } from '../../publishers/stream'; +import getAcct from '../../acct/render'; +import config from '../../config'; const gm = _gm.subClass({ imageMagick: true diff --git a/src/api/drive/upload-from-url.ts b/src/api/drive/upload-from-url.ts index f96af0f266..26c890d157 100644 --- a/src/api/drive/upload-from-url.ts +++ b/src/api/drive/upload-from-url.ts @@ -1,5 +1,5 @@ import * as URL from 'url'; -import { IDriveFile, validateFileName } from '../models/drive-file'; +import { IDriveFile, validateFileName } from '../../models/drive-file'; import create from './add-file'; import * as debug from 'debug'; import * as tmp from 'tmp'; diff --git a/src/api/post/create.ts b/src/api/post/create.ts index 8256cbc355..36819ec2b8 100644 --- a/src/api/post/create.ts +++ b/src/api/post/create.ts @@ -1,6 +1,5 @@ -import parseAcct from '../../acct/parse'; import Post, { pack, IPost } from '../../models/post'; -import User, { isLocalUser, isRemoteUser, IUser } from '../../models/user'; +import User, { isLocalUser, IUser } from '../../models/user'; import stream from '../../publishers/stream'; import Following from '../../models/following'; import { createHttp } from '../../queue'; @@ -25,14 +24,16 @@ export default async (user: IUser, content: { repost: IPost; media: IDriveFile[]; geo: any; - poll: any; + poll?: any; viaMobile: boolean; - tags: string[]; - cw: string; - visibility: string; + tags?: string[]; + cw?: string; + visibility?: string; uri?: string; app?: IApp; }) => new Promise<IPost>(async (res, rej) => { + if (content.visibility == null) content.visibility = 'public'; + const tags = content.tags || []; let tokens = null; diff --git a/src/api/post/watch.ts b/src/api/post/watch.ts index 61ea444430..bbd9976f40 100644 --- a/src/api/post/watch.ts +++ b/src/api/post/watch.ts @@ -1,5 +1,5 @@ import * as mongodb from 'mongodb'; -import Watching from '../models/post-watching'; +import Watching from '../../models/post-watching'; export default async (me: mongodb.ObjectID, post: object) => { // 自分の投稿はwatchできない |