Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71bada97df | ||
|
|
62509edcbe | ||
|
|
f97cdfaa20 | ||
|
|
67ec10e86d |
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"author": "syuilo <i@syuilo.com>",
|
"author": "syuilo <i@syuilo.com>",
|
||||||
"version": "8.45.0",
|
"version": "8.45.1",
|
||||||
"clientVersion": "1.0.9834",
|
"clientVersion": "1.0.9840",
|
||||||
"codename": "nighthike",
|
"codename": "nighthike",
|
||||||
"main": "./built/index.js",
|
"main": "./built/index.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -1,22 +1,10 @@
|
|||||||
import { INote } from '../../../models/note';
|
import { INote } from '../../../models/note';
|
||||||
import toHtml from '../../../mfm/html';
|
import toHtml from '../../../mfm/html';
|
||||||
import parse from '../../../mfm/parse';
|
import parse from '../../../mfm/parse';
|
||||||
import config from '../../../config';
|
|
||||||
|
|
||||||
export default function(note: INote) {
|
export default function(note: INote) {
|
||||||
let html = toHtml(parse(note.text), note.mentionedRemoteUsers);
|
let html = toHtml(parse(note.text), note.mentionedRemoteUsers);
|
||||||
if (html == null) html = '';
|
if (html == null) html = '';
|
||||||
|
|
||||||
if (note.poll != null) {
|
|
||||||
const url = `${config.url}/notes/${note._id}`;
|
|
||||||
// TODO: i18n
|
|
||||||
html += `<p><a href="${url}">【Misskeyで投票を見る】</a></p>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (note.renoteId != null) {
|
|
||||||
const url = `${config.url}/notes/${note.renoteId}`;
|
|
||||||
html += `<p>RE: <a href="${url}">${url}</a></p>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,20 +82,38 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
|
|||||||
|
|
||||||
const files = await promisedFiles;
|
const files = await promisedFiles;
|
||||||
|
|
||||||
const text = note.text ? parseMfm(note.text).map(x => {
|
let text = note.text;
|
||||||
if (x.type == 'mention' && x.host == null) {
|
|
||||||
return `${x.content}@${config.host}`;
|
if (note.poll != null) {
|
||||||
} else {
|
if (text == null) text = '';
|
||||||
return x.content;
|
const url = `${config.url}/notes/${note._id}`;
|
||||||
}
|
// TODO: i18n
|
||||||
}).join('') : null;
|
text += `\n\n[投票を見る](${url})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (note.renoteId != null) {
|
||||||
|
if (text == null) text = '';
|
||||||
|
const url = `${config.url}/notes/${note.renoteId}`;
|
||||||
|
text += `\n\nRE: ${url}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 省略されたメンションのホストを復元する
|
||||||
|
if (text != null) {
|
||||||
|
text = parseMfm(text).map(x => {
|
||||||
|
if (x.type == 'mention' && x.host == null) {
|
||||||
|
return `${x.content}@${config.host}`;
|
||||||
|
} else {
|
||||||
|
return x.content;
|
||||||
|
}
|
||||||
|
}).join('');
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: `${config.url}/notes/${note._id}`,
|
id: `${config.url}/notes/${note._id}`,
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
attributedTo,
|
attributedTo,
|
||||||
summary: note.cw,
|
summary: note.cw,
|
||||||
content: toHtml(note),
|
content: toHtml(Object.assign({}, note, { text })),
|
||||||
_misskey_content: text,
|
_misskey_content: text,
|
||||||
published: note.createdAt.toISOString(),
|
published: note.createdAt.toISOString(),
|
||||||
to,
|
to,
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ export const meta = {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
untilId: $.type(ID).optional.note({
|
||||||
|
desc: {
|
||||||
|
'ja-JP': '指定すると、この投稿を基点としてより古い投稿を取得します'
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
sinceDate: $.num.optional.note({
|
sinceDate: $.num.optional.note({
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -318,6 +324,14 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ps.untilId) {
|
||||||
|
push({
|
||||||
|
_id: {
|
||||||
|
$lt: ps.untilId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (ps.sinceDate) {
|
if (ps.sinceDate) {
|
||||||
push({
|
push({
|
||||||
createdAt: {
|
createdAt: {
|
||||||
|
|||||||
Reference in New Issue
Block a user