This commit is contained in:
parent
e3f6d42a47
commit
8bc47baf4f
|
@ -289,7 +289,7 @@ export const pack = async (
|
||||||
|
|
||||||
// Poll
|
// Poll
|
||||||
if (meId && _note.poll && !hide) {
|
if (meId && _note.poll && !hide) {
|
||||||
_note.poll = (async (poll) => {
|
_note.poll = (async poll => {
|
||||||
const vote = await PollVote
|
const vote = await PollVote
|
||||||
.findOne({
|
.findOne({
|
||||||
userId: meId,
|
userId: meId,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import * as debug from 'debug';
|
||||||
|
|
||||||
import User, { IUser } from '../../../models/user';
|
import User, { IUser } from '../../../models/user';
|
||||||
import Mute from '../../../models/mute';
|
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 readNotification from '../common/read-notification';
|
||||||
import call from '../call';
|
import call from '../call';
|
||||||
import { IApp } from '../../../models/app';
|
import { IApp } from '../../../models/app';
|
||||||
|
@ -48,6 +48,14 @@ export default async function(
|
||||||
}
|
}
|
||||||
//#endregion
|
//#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);
|
connection.send(data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
connection.send(data);
|
connection.send(data);
|
||||||
|
|
|
@ -3,6 +3,7 @@ import * as redis from 'redis';
|
||||||
|
|
||||||
import { IUser } from '../../../models/user';
|
import { IUser } from '../../../models/user';
|
||||||
import Mute from '../../../models/mute';
|
import Mute from '../../../models/mute';
|
||||||
|
import { pack } from '../../../models/note';
|
||||||
|
|
||||||
export default async function(
|
export default async function(
|
||||||
request: websocket.request,
|
request: websocket.request,
|
||||||
|
@ -31,6 +32,13 @@ export default async function(
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
// Renoteなら再pack
|
||||||
|
if (note.renoteId != null) {
|
||||||
|
note.renote = await pack(note.renoteId, user, {
|
||||||
|
detail: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
connection.send(JSON.stringify({
|
connection.send(JSON.stringify({
|
||||||
type: 'note',
|
type: 'note',
|
||||||
body: note
|
body: note
|
||||||
|
|
Loading…
Reference in New Issue