Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71bada97df | ||
|
|
62509edcbe | ||
|
|
f97cdfaa20 | ||
|
|
67ec10e86d |
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "8.45.0",
|
||||
"clientVersion": "1.0.9834",
|
||||
"version": "8.45.1",
|
||||
"clientVersion": "1.0.9840",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
import { INote } from '../../../models/note';
|
||||
import toHtml from '../../../mfm/html';
|
||||
import parse from '../../../mfm/parse';
|
||||
import config from '../../../config';
|
||||
|
||||
export default function(note: INote) {
|
||||
let html = toHtml(parse(note.text), note.mentionedRemoteUsers);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -82,20 +82,38 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
|
||||
|
||||
const files = await promisedFiles;
|
||||
|
||||
const text = note.text ? parseMfm(note.text).map(x => {
|
||||
if (x.type == 'mention' && x.host == null) {
|
||||
return `${x.content}@${config.host}`;
|
||||
} else {
|
||||
return x.content;
|
||||
}
|
||||
}).join('') : null;
|
||||
let text = note.text;
|
||||
|
||||
if (note.poll != null) {
|
||||
if (text == null) text = '';
|
||||
const url = `${config.url}/notes/${note._id}`;
|
||||
// TODO: i18n
|
||||
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 {
|
||||
id: `${config.url}/notes/${note._id}`,
|
||||
type: 'Note',
|
||||
attributedTo,
|
||||
summary: note.cw,
|
||||
content: toHtml(note),
|
||||
content: toHtml(Object.assign({}, note, { text })),
|
||||
_misskey_content: text,
|
||||
published: note.createdAt.toISOString(),
|
||||
to,
|
||||
|
||||
@@ -87,6 +87,12 @@ export const meta = {
|
||||
}
|
||||
}),
|
||||
|
||||
untilId: $.type(ID).optional.note({
|
||||
desc: {
|
||||
'ja-JP': '指定すると、この投稿を基点としてより古い投稿を取得します'
|
||||
}
|
||||
}),
|
||||
|
||||
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) {
|
||||
push({
|
||||
createdAt: {
|
||||
|
||||
Reference in New Issue
Block a user