From 5ac335a531df596c69968366040554b98c5b6f8b Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 18 Apr 2018 18:39:04 +0900 Subject: oops --- src/client/docs/api/endpoints/view.pug | 2 +- src/client/docs/api/entities/view.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/docs') diff --git a/src/client/docs/api/endpoints/view.pug b/src/client/docs/api/endpoints/view.pug index d271a5517a..f8795c8442 100644 --- a/src/client/docs/api/endpoints/view.pug +++ b/src/client/docs/api/endpoints/view.pug @@ -2,7 +2,7 @@ extends ../../layout.pug include ../mixins block meta - link(rel="stylesheet" href="/assets/api/endpoints/style.css") + link(rel="stylesheet" href="/docs/assets/api/endpoints/style.css") block main h1= endpoint diff --git a/src/client/docs/api/entities/view.pug b/src/client/docs/api/entities/view.pug index 2156463dc7..ac938151a7 100644 --- a/src/client/docs/api/entities/view.pug +++ b/src/client/docs/api/entities/view.pug @@ -2,7 +2,7 @@ extends ../../layout.pug include ../mixins block meta - link(rel="stylesheet" href="/assets/api/entities/style.css") + link(rel="stylesheet" href="/docs/assets/api/entities/style.css") block main h1= name -- cgit v1.2.3-freya From f6a041559f008babe7d4ab5cb9d21664f220cff7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Apr 2018 14:32:14 +0900 Subject: Add doc --- src/client/docs/follow.pug | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/client/docs/follow.pug (limited to 'src/client/docs') diff --git a/src/client/docs/follow.pug b/src/client/docs/follow.pug new file mode 100644 index 0000000000..f0e83bc8fd --- /dev/null +++ b/src/client/docs/follow.pug @@ -0,0 +1,9 @@ +h1 フォロー +p ユーザーをフォローすると、タイムラインにそのユーザーの投稿が表示されるようになります。ただし、他のユーザーに対する返信は含まれません。 +p ユーザーをフォローするには、ユーザーページの「フォロー」ボタンをクリックします。フォローを解除するには、もう一度クリックします。 + +section + h2 ストーキング + p ユーザーをフォローしている状態では、さらに「ストーキング」モードをオンにすることができます。ストーキングを行うと、タイムラインにそのユーザーの全ての投稿が表示されるようになります。つまり、他のユーザーに対する返信も含まれることになります。 + p ストーキングするには、ユーザーページの「ストークする」をクリックします。ストーキングをやめるには、もう一度クリックします。 + p ストーキングしていることは相手に通知されません。 -- cgit v1.2.3-freya From d87e3a0ee3b4d079104215c0dca6a77c707e291a Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Apr 2018 15:19:18 +0900 Subject: oops --- src/client/docs/follow.ja.pug | 9 +++++++++ src/client/docs/follow.pug | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 src/client/docs/follow.ja.pug delete mode 100644 src/client/docs/follow.pug (limited to 'src/client/docs') diff --git a/src/client/docs/follow.ja.pug b/src/client/docs/follow.ja.pug new file mode 100644 index 0000000000..f0e83bc8fd --- /dev/null +++ b/src/client/docs/follow.ja.pug @@ -0,0 +1,9 @@ +h1 フォロー +p ユーザーをフォローすると、タイムラインにそのユーザーの投稿が表示されるようになります。ただし、他のユーザーに対する返信は含まれません。 +p ユーザーをフォローするには、ユーザーページの「フォロー」ボタンをクリックします。フォローを解除するには、もう一度クリックします。 + +section + h2 ストーキング + p ユーザーをフォローしている状態では、さらに「ストーキング」モードをオンにすることができます。ストーキングを行うと、タイムラインにそのユーザーの全ての投稿が表示されるようになります。つまり、他のユーザーに対する返信も含まれることになります。 + p ストーキングするには、ユーザーページの「ストークする」をクリックします。ストーキングをやめるには、もう一度クリックします。 + p ストーキングしていることは相手に通知されません。 diff --git a/src/client/docs/follow.pug b/src/client/docs/follow.pug deleted file mode 100644 index f0e83bc8fd..0000000000 --- a/src/client/docs/follow.pug +++ /dev/null @@ -1,9 +0,0 @@ -h1 フォロー -p ユーザーをフォローすると、タイムラインにそのユーザーの投稿が表示されるようになります。ただし、他のユーザーに対する返信は含まれません。 -p ユーザーをフォローするには、ユーザーページの「フォロー」ボタンをクリックします。フォローを解除するには、もう一度クリックします。 - -section - h2 ストーキング - p ユーザーをフォローしている状態では、さらに「ストーキング」モードをオンにすることができます。ストーキングを行うと、タイムラインにそのユーザーの全ての投稿が表示されるようになります。つまり、他のユーザーに対する返信も含まれることになります。 - p ストーキングするには、ユーザーページの「ストークする」をクリックします。ストーキングをやめるには、もう一度クリックします。 - p ストーキングしていることは相手に通知されません。 -- cgit v1.2.3-freya From 20e77196f28178c869402985761bd4c2fa74bf0a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Apr 2018 10:44:17 +0900 Subject: AP: 投票をレンダリング MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/desktop/views/components/notes.note.vue | 2 +- src/client/docs/api/entities/note.yaml | 6 ------ src/client/docs/api/entities/post.yaml | 6 ------ src/models/messaging-message.ts | 1 - src/models/note.ts | 1 - src/remote/activitypub/kernel/delete/note.ts | 1 - src/remote/activitypub/misc/get-note-html.ts | 18 ++++++++++++++++++ src/remote/activitypub/renderer/note.ts | 3 ++- src/server/api/endpoints/messaging/messages/create.ts | 3 --- src/services/note/create.ts | 2 -- 10 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 src/remote/activitypub/misc/get-note-html.ts (limited to 'src/client/docs') diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue index 1352fc4ee7..ae2793db92 100644 --- a/src/client/app/desktop/views/components/notes.note.vue +++ b/src/client/app/desktop/views/components/notes.note.vue @@ -36,7 +36,7 @@

diff --git a/src/client/docs/api/entities/note.yaml b/src/client/docs/api/entities/note.yaml index 718d331d13..6fd26543bb 100644 --- a/src/client/docs/api/entities/note.yaml +++ b/src/client/docs/api/entities/note.yaml @@ -29,12 +29,6 @@ props: desc: ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)" en: "The text of this note (in Markdown like format if local)" - - name: "textHtml" - type: "string" - optional: true - desc: - ja: "投稿の本文 (HTML) (投稿時は無視)" - en: "The text of this note (in HTML. Ignored when posting.)" - name: "mediaIds" type: "id(DriveFile)[]" optional: true diff --git a/src/client/docs/api/entities/post.yaml b/src/client/docs/api/entities/post.yaml index 718d331d13..6fd26543bb 100644 --- a/src/client/docs/api/entities/post.yaml +++ b/src/client/docs/api/entities/post.yaml @@ -29,12 +29,6 @@ props: desc: ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)" en: "The text of this note (in Markdown like format if local)" - - name: "textHtml" - type: "string" - optional: true - desc: - ja: "投稿の本文 (HTML) (投稿時は無視)" - en: "The text of this note (in HTML. Ignored when posting.)" - name: "mediaIds" type: "id(DriveFile)[]" optional: true diff --git a/src/models/messaging-message.ts b/src/models/messaging-message.ts index 9d62fab4fa..a6a50fc8cf 100644 --- a/src/models/messaging-message.ts +++ b/src/models/messaging-message.ts @@ -12,7 +12,6 @@ export interface IMessagingMessage { _id: mongo.ObjectID; createdAt: Date; text: string; - textHtml: string; userId: mongo.ObjectID; recipientId: mongo.ObjectID; isRead: boolean; diff --git a/src/models/note.ts b/src/models/note.ts index d4b16afa4c..02801b62de 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -38,7 +38,6 @@ export type INote = { poll: any; // todo text: string; tags: string[]; - textHtml: string; cw: string; userId: mongo.ObjectID; appId: mongo.ObjectID; diff --git a/src/remote/activitypub/kernel/delete/note.ts b/src/remote/activitypub/kernel/delete/note.ts index 64c342d39b..b2868f69a3 100644 --- a/src/remote/activitypub/kernel/delete/note.ts +++ b/src/remote/activitypub/kernel/delete/note.ts @@ -22,7 +22,6 @@ export default async function(actor: IRemoteUser, uri: string): Promise { $set: { deletedAt: new Date(), text: null, - textHtml: null, mediaIds: [], poll: null } diff --git a/src/remote/activitypub/misc/get-note-html.ts b/src/remote/activitypub/misc/get-note-html.ts new file mode 100644 index 0000000000..a63059a38d --- /dev/null +++ b/src/remote/activitypub/misc/get-note-html.ts @@ -0,0 +1,18 @@ +import { INote } from "../../../models/note"; +import toHtml from '../../../text/html'; +import parse from '../../../text/parse'; +import config from '../../../config'; + +export default function(note: INote) { + if (note.text == null) return null; + + let html = toHtml(parse(note.text)); + + if (note.poll != null) { + const url = `${config.url}/notes/${note._id}`; + // TODO: i18n + html += `

【投票】
${url}

`; + } + + return html; +} diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index c364b13249..a05c12b388 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -4,6 +4,7 @@ import config from '../../../config'; import DriveFile from '../../../models/drive-file'; import Note, { INote } from '../../../models/note'; import User from '../../../models/user'; +import toHtml from '../misc/get-note-html'; export default async function renderNote(note: INote, dive = true) { const promisedFiles = note.mediaIds @@ -48,7 +49,7 @@ export default async function renderNote(note: INote, dive = true) { id: `${config.url}/notes/${note._id}`, type: 'Note', attributedTo, - content: note.textHtml, + content: toHtml(note), published: note.createdAt.toISOString(), to: 'https://www.w3.org/ns/activitystreams#Public', cc: `${attributedTo}/followers`, diff --git a/src/server/api/endpoints/messaging/messages/create.ts b/src/server/api/endpoints/messaging/messages/create.ts index 085e75e6cf..0483b602b2 100644 --- a/src/server/api/endpoints/messaging/messages/create.ts +++ b/src/server/api/endpoints/messaging/messages/create.ts @@ -12,8 +12,6 @@ import { pack } from '../../../../../models/messaging-message'; import publishUserStream from '../../../../../publishers/stream'; import { publishMessagingStream, publishMessagingIndexStream } from '../../../../../publishers/stream'; import pushSw from '../../../../../publishers/push-sw'; -import html from '../../../../../text/html'; -import parse from '../../../../../text/parse'; import config from '../../../../../config'; /** @@ -77,7 +75,6 @@ module.exports = (params, user) => new Promise(async (res, rej) => { fileId: file ? file._id : undefined, recipientId: recipient._id, text: text ? text : undefined, - textHtml: text ? html(parse(text)) : undefined, userId: user._id, isRead: false }); diff --git a/src/services/note/create.ts b/src/services/note/create.ts index ca01b557d6..2380e64ce3 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -15,7 +15,6 @@ import Mute from '../../models/mute'; import pushSw from '../../publishers/push-sw'; import event from '../../publishers/stream'; import parse from '../../text/parse'; -import html from '../../text/html'; import { IApp } from '../../models/app'; export default async (user: IUser, data: { @@ -63,7 +62,6 @@ export default async (user: IUser, data: { replyId: data.reply ? data.reply._id : null, renoteId: data.renote ? data.renote._id : null, text: data.text, - textHtml: tokens === null ? null : html(tokens), poll: data.poll, cw: data.cw, tags, -- cgit v1.2.3-freya From 6419185228d6786cf750f6ce78401bfd0cc7c416 Mon Sep 17 00:00:00 2001 From: ha-dai Date: Mon, 7 May 2018 03:05:00 +0900 Subject: fix typo --- src/client/docs/api/mixins.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/docs') diff --git a/src/client/docs/api/mixins.pug b/src/client/docs/api/mixins.pug index 686bf6a2b6..913135a85f 100644 --- a/src/client/docs/api/mixins.pug +++ b/src/client/docs/api/mixins.pug @@ -14,13 +14,13 @@ mixin propTable(props) if prop.kind == 'id' if prop.entity | ( - a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity + a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity | ID) else | (ID) else if prop.kind == 'entity' | ( - a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity + a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity | ) else if prop.kind == 'object' if prop.def -- cgit v1.2.3-freya