diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-03-31 20:50:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-31 20:50:40 +0900 |
| commit | eafb0f61ef6465697a0fbd9b931fc306417cd2a1 (patch) | |
| tree | 7d6c502c1e2c61eb3327f678f766f23bda10c1e7 /src/server/api/endpoints/posts | |
| parent | デフォルトでドライブ容量は128MiBにした (diff) | |
| parent | Implement remote status retrieval (diff) | |
| download | sharkey-eafb0f61ef6465697a0fbd9b931fc306417cd2a1.tar.gz sharkey-eafb0f61ef6465697a0fbd9b931fc306417cd2a1.tar.bz2 sharkey-eafb0f61ef6465697a0fbd9b931fc306417cd2a1.zip | |
Merge pull request #1341 from akihikodaki/github
Implement remote status retrieval
Diffstat (limited to 'src/server/api/endpoints/posts')
| -rw-r--r-- | src/server/api/endpoints/posts/create.ts | 8 | ||||
| -rw-r--r-- | src/server/api/endpoints/posts/polls/vote.ts | 2 | ||||
| -rw-r--r-- | src/server/api/endpoints/posts/reactions/create.ts | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/server/api/endpoints/posts/create.ts b/src/server/api/endpoints/posts/create.ts index 170b667191..42901ebcbf 100644 --- a/src/server/api/endpoints/posts/create.ts +++ b/src/server/api/endpoints/posts/create.ts @@ -3,7 +3,8 @@ */ import $ from 'cafy'; import deepEqual = require('deep-equal'); -import parse from '../../../../common/text'; +import html from '../../../../common/text/html'; +import parse from '../../../../common/text/parse'; import { default as Post, IPost, isValidText, isValidCw } from '../../../../models/post'; import { default as User, ILocalAccount, IUser } from '../../../../models/user'; import { default as Channel, IChannel } from '../../../../models/channel'; @@ -15,7 +16,7 @@ import ChannelWatching from '../../../../models/channel-watching'; import { pack } from '../../../../models/post'; import notify from '../../common/notify'; import watch from '../../common/watch-post'; -import event, { pushSw, publishChannelStream } from '../../event'; +import event, { pushSw, publishChannelStream } from '../../../../common/event'; import getAcct from '../../../../common/user/get-acct'; import parseAcct from '../../../../common/user/parse-acct'; import config from '../../../../conf'; @@ -254,11 +255,12 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { createdAt: new Date(), channelId: channel ? channel._id : undefined, index: channel ? channel.index + 1 : undefined, - mediaIds: files ? files.map(file => file._id) : undefined, + mediaIds: files ? files.map(file => file._id) : [], replyId: reply ? reply._id : undefined, repostId: repost ? repost._id : undefined, poll: poll, text: text, + textHtml: tokens === null ? null : html(tokens), cw: cw, tags: tags, userId: user._id, diff --git a/src/server/api/endpoints/posts/polls/vote.ts b/src/server/api/endpoints/posts/polls/vote.ts index b970c05e8d..98df074e5d 100644 --- a/src/server/api/endpoints/posts/polls/vote.ts +++ b/src/server/api/endpoints/posts/polls/vote.ts @@ -7,7 +7,7 @@ import Post from '../../../../../models/post'; import Watching from '../../../../../models/post-watching'; import notify from '../../../common/notify'; import watch from '../../../common/watch-post'; -import { publishPostStream } from '../../../event'; +import { publishPostStream } from '../../../../../common/event'; /** * Vote poll of a post diff --git a/src/server/api/endpoints/posts/reactions/create.ts b/src/server/api/endpoints/posts/reactions/create.ts index 5d2b5a7ed3..8db76d6436 100644 --- a/src/server/api/endpoints/posts/reactions/create.ts +++ b/src/server/api/endpoints/posts/reactions/create.ts @@ -8,7 +8,7 @@ import { pack as packUser } from '../../../../../models/user'; import Watching from '../../../../../models/post-watching'; import notify from '../../../common/notify'; import watch from '../../../common/watch-post'; -import { publishPostStream, pushSw } from '../../../event'; +import { publishPostStream, pushSw } from '../../../../../common/event'; /** * React to a post |