0
0
This commit is contained in:
syuilo 2018-06-12 18:54:36 +09:00
parent e3f6d42a47
commit 8bc47baf4f
3 changed files with 18 additions and 2 deletions

View File

@ -289,7 +289,7 @@ export const pack = async (
// Poll
if (meId && _note.poll && !hide) {
_note.poll = (async (poll) => {
_note.poll = (async poll => {
const vote = await PollVote
.findOne({
userId: meId,

View File

@ -4,7 +4,7 @@ import * as debug from 'debug';
import User, { IUser } from '../../../models/user';
import Mute from '../../../models/mute';
import { pack as packNote } from '../../../models/note';
import { pack as packNote, pack } from '../../../models/note';
import readNotification from '../common/read-notification';
import call from '../call';
import { IApp } from '../../../models/app';
@ -48,6 +48,14 @@ export default async function(
}
//#endregion
// Renoteなら再pack
if (x.type == 'note' && x.body.renoteId != null) {
x.body.renote = await pack(x.body.renoteId, user, {
detail: true
});
data = JSON.stringify(x);
}
connection.send(data);
} catch (e) {
connection.send(data);

View File

@ -3,6 +3,7 @@ import * as redis from 'redis';
import { IUser } from '../../../models/user';
import Mute from '../../../models/mute';
import { pack } from '../../../models/note';
export default async function(
request: websocket.request,
@ -31,6 +32,13 @@ export default async function(
}
//#endregion
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await pack(note.renoteId, user, {
detail: true
});
}
connection.send(JSON.stringify({
type: 'note',
body: note