From a1b490afa756a71b9cef4afa424575bc223bc612 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Apr 2018 02:30:37 +0900 Subject: Post --> Note Closes #1411 --- src/server/api/stream/home.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/server/api/stream') diff --git a/src/server/api/stream/home.ts b/src/server/api/stream/home.ts index 648bd7c3c2..313558851b 100644 --- a/src/server/api/stream/home.ts +++ b/src/server/api/stream/home.ts @@ -4,7 +4,7 @@ import * as debug from 'debug'; import User from '../../../models/user'; import Mute from '../../../models/mute'; -import { pack as packPost } from '../../../models/post'; +import { pack as packNote } from '../../../models/note'; import readNotification from '../common/read-notification'; const log = debug('misskey'); @@ -25,14 +25,14 @@ export default async function(request: websocket.request, connection: websocket. try { const x = JSON.parse(data); - if (x.type == 'post') { + if (x.type == 'note') { if (mutedUserIds.indexOf(x.body.userId) != -1) { return; } if (x.body.reply != null && mutedUserIds.indexOf(x.body.reply.userId) != -1) { return; } - if (x.body.repost != null && mutedUserIds.indexOf(x.body.repost.userId) != -1) { + if (x.body.renote != null && mutedUserIds.indexOf(x.body.renote.userId) != -1) { return; } } else if (x.type == 'notification') { @@ -46,16 +46,16 @@ export default async function(request: websocket.request, connection: websocket. connection.send(data); } break; - case 'post-stream': - const postId = channel.split(':')[2]; - log(`RECEIVED: ${postId} ${data} by @${user.username}`); - const post = await packPost(postId, user, { + case 'note-stream': + const noteId = channel.split(':')[2]; + log(`RECEIVED: ${noteId} ${data} by @${user.username}`); + const note = await packNote(noteId, user, { detail: true }); connection.send(JSON.stringify({ - type: 'post-updated', + type: 'note-updated', body: { - post: post + note: note } })); break; @@ -86,9 +86,9 @@ export default async function(request: websocket.request, connection: websocket. case 'capture': if (!msg.id) return; - const postId = msg.id; - log(`CAPTURE: ${postId} by @${user.username}`); - subscriber.subscribe(`misskey:post-stream:${postId}`); + const noteId = msg.id; + log(`CAPTURE: ${noteId} by @${user.username}`); + subscriber.subscribe(`misskey:note-stream:${noteId}`); break; } }); -- cgit v1.2.3-freya