diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-08 02:30:37 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-08 02:30:37 +0900 |
| commit | a1b490afa756a71b9cef4afa424575bc223bc612 (patch) | |
| tree | 06de4d839e17b1e08e0891542af7360c701a154a /src/server/api/stream | |
| parent | Merge pull request #1392 from syuilo/greenkeeper/element-ui-2.3.3 (diff) | |
| download | sharkey-a1b490afa756a71b9cef4afa424575bc223bc612.tar.gz sharkey-a1b490afa756a71b9cef4afa424575bc223bc612.tar.bz2 sharkey-a1b490afa756a71b9cef4afa424575bc223bc612.zip | |
Post --> Note
Closes #1411
Diffstat (limited to 'src/server/api/stream')
| -rw-r--r-- | src/server/api/stream/home.ts | 24 |
1 files changed, 12 insertions, 12 deletions
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; } }); |