From cf33e483f7e6f40e8cbbbc0118a7df70bdaf651f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 29 Mar 2018 20:32:18 +0900 Subject: 整理した MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/docs/api/endpoints/posts/create.yaml | 53 +++++++++++++++++++++++ src/client/docs/api/endpoints/posts/timeline.yaml | 32 ++++++++++++++ src/client/docs/api/endpoints/style.styl | 21 +++++++++ src/client/docs/api/endpoints/view.pug | 32 ++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 src/client/docs/api/endpoints/posts/create.yaml create mode 100644 src/client/docs/api/endpoints/posts/timeline.yaml create mode 100644 src/client/docs/api/endpoints/style.styl create mode 100644 src/client/docs/api/endpoints/view.pug (limited to 'src/client/docs/api/endpoints') diff --git a/src/client/docs/api/endpoints/posts/create.yaml b/src/client/docs/api/endpoints/posts/create.yaml new file mode 100644 index 0000000000..11d9f40c54 --- /dev/null +++ b/src/client/docs/api/endpoints/posts/create.yaml @@ -0,0 +1,53 @@ +endpoint: "posts/create" + +desc: + ja: "投稿します。" + en: "Compose new post." + +params: + - name: "text" + type: "string" + optional: true + desc: + ja: "投稿の本文" + en: "The text of your post" + - name: "mediaIds" + type: "id(DriveFile)[]" + optional: true + desc: + ja: "添付するメディア(1~4つ)" + en: "Media you want to attach (1~4)" + - name: "replyId" + type: "id(Post)" + optional: true + desc: + ja: "返信する投稿" + en: "The post you want to reply" + - name: "repostId" + type: "id(Post)" + optional: true + desc: + ja: "引用する投稿" + en: "The post you want to quote" + - name: "poll" + type: "object" + optional: true + desc: + ja: "投票" + en: "The poll" + defName: "poll" + def: + - name: "choices" + type: "string[]" + optional: false + desc: + ja: "投票の選択肢" + en: "Choices of a poll" + +res: + - name: "createdPost" + type: "entity(Post)" + optional: false + desc: + ja: "作成した投稿" + en: "A post that created" diff --git a/src/client/docs/api/endpoints/posts/timeline.yaml b/src/client/docs/api/endpoints/posts/timeline.yaml new file mode 100644 index 0000000000..9c44dd736a --- /dev/null +++ b/src/client/docs/api/endpoints/posts/timeline.yaml @@ -0,0 +1,32 @@ +endpoint: "posts/timeline" + +desc: + ja: "タイムラインを取得します。" + en: "Get your timeline." + +params: + - name: "limit" + type: "number" + optional: true + desc: + ja: "取得する最大の数" + - name: "sinceId" + type: "id(Post)" + optional: true + desc: + ja: "指定すると、この投稿を基点としてより新しい投稿を取得します" + - name: "untilId" + type: "id(Post)" + optional: true + desc: + ja: "指定すると、この投稿を基点としてより古い投稿を取得します" + - name: "sinceDate" + type: "number" + optional: true + desc: + ja: "指定した時間を基点としてより新しい投稿を取得します。数値は、1970 年 1 月 1 日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。" + - name: "untilDate" + type: "number" + optional: true + desc: + ja: "指定した時間を基点としてより古い投稿を取得します。数値は、1970 年 1 月 1 日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。" diff --git a/src/client/docs/api/endpoints/style.styl b/src/client/docs/api/endpoints/style.styl new file mode 100644 index 0000000000..2af9fe9a77 --- /dev/null +++ b/src/client/docs/api/endpoints/style.styl @@ -0,0 +1,21 @@ +@import "../style" + +#url + padding 8px 12px 8px 8px + font-family Consolas, 'Courier New', Courier, Monaco, monospace + color #fff + background #222e40 + border-radius 4px + + > .method + display inline-block + margin 0 8px 0 0 + padding 0 6px + color #f4fcff + background #17afc7 + border-radius 4px + user-select none + pointer-events none + + > .host + opacity 0.7 diff --git a/src/client/docs/api/endpoints/view.pug b/src/client/docs/api/endpoints/view.pug new file mode 100644 index 0000000000..d271a5517a --- /dev/null +++ b/src/client/docs/api/endpoints/view.pug @@ -0,0 +1,32 @@ +extends ../../layout.pug +include ../mixins + +block meta + link(rel="stylesheet" href="/assets/api/endpoints/style.css") + +block main + h1= endpoint + + p#url + span.method POST + span.host + = url.host + | / + span.path= url.path + + p#desc= desc[lang] || desc['ja'] + + section + h2 %i18n:docs.api.endpoints.params% + +propTable(params) + + if paramDefs + each paramDef in paramDefs + section(id= paramDef.name) + h3= paramDef.name + +propTable(paramDef.params) + + if res + section + h2 %i18n:docs.api.endpoints.res% + +propTable(res) -- cgit v1.2.3-freya From 75c4c844e6d679cd94da59525801fdd879e780c1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 30 Mar 2018 11:24:07 +0900 Subject: cw --- src/client/docs/api/endpoints/posts/create.yaml | 6 ++++++ src/models/post.ts | 5 +++++ src/server/api/endpoints/posts/create.ts | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/client/docs/api/endpoints') diff --git a/src/client/docs/api/endpoints/posts/create.yaml b/src/client/docs/api/endpoints/posts/create.yaml index 11d9f40c54..d2d6e27fc7 100644 --- a/src/client/docs/api/endpoints/posts/create.yaml +++ b/src/client/docs/api/endpoints/posts/create.yaml @@ -11,6 +11,12 @@ params: desc: ja: "投稿の本文" en: "The text of your post" + - name: "cw" + type: "string" + optional: true + desc: + ja: "コンテンツの警告。このパラメータを指定すると設定したテキストで投稿のコンテンツを隠す事が出来ます。" + en: "Content Warning" - name: "mediaIds" type: "id(DriveFile)[]" optional: true diff --git a/src/models/post.ts b/src/models/post.ts index 833e599320..9bc0c1d3b9 100644 --- a/src/models/post.ts +++ b/src/models/post.ts @@ -18,6 +18,10 @@ export function isValidText(text: string): boolean { return text.length <= 1000 && text.trim() != ''; } +export function isValidCw(text: string): boolean { + return text.length <= 100 && text.trim() != ''; +} + export type IPost = { _id: mongo.ObjectID; channelId: mongo.ObjectID; @@ -27,6 +31,7 @@ export type IPost = { repostId: mongo.ObjectID; poll: any; // todo text: string; + cw: string; userId: mongo.ObjectID; appId: mongo.ObjectID; viaMobile: boolean; diff --git a/src/server/api/endpoints/posts/create.ts b/src/server/api/endpoints/posts/create.ts index 6b2957ae67..170b667191 100644 --- a/src/server/api/endpoints/posts/create.ts +++ b/src/server/api/endpoints/posts/create.ts @@ -4,7 +4,7 @@ import $ from 'cafy'; import deepEqual = require('deep-equal'); import parse from '../../../../common/text'; -import { default as Post, IPost, isValidText } from '../../../../models/post'; +import { default as Post, IPost, isValidText, isValidCw } from '../../../../models/post'; import { default as User, ILocalAccount, IUser } from '../../../../models/user'; import { default as Channel, IChannel } from '../../../../models/channel'; import Following from '../../../../models/following'; @@ -33,6 +33,10 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { const [text, textErr] = $(params.text).optional.string().pipe(isValidText).$; if (textErr) return rej('invalid text'); + // Get 'cw' parameter + const [cw, cwErr] = $(params.cw).optional.string().pipe(isValidCw).$; + if (cwErr) return rej('invalid cw'); + // Get 'viaMobile' parameter const [viaMobile = false, viaMobileErr] = $(params.viaMobile).optional.boolean().$; if (viaMobileErr) return rej('invalid viaMobile'); @@ -255,6 +259,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { repostId: repost ? repost._id : undefined, poll: poll, text: text, + cw: cw, tags: tags, userId: user._id, appId: app ? app._id : null, -- cgit v1.2.3-freya From a1b490afa756a71b9cef4afa424575bc223bc612 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Apr 2018 02:30:37 +0900 Subject: Post --> Note Closes #1411 --- locales/en.yml | 86 +-- locales/ja.yml | 74 +-- src/client/app/auth/views/form.vue | 2 +- src/client/app/ch/tags/channel.tag | 68 +-- src/client/app/common/mios.ts | 4 +- .../app/common/scripts/compose-notification.ts | 10 +- .../app/common/scripts/parse-search-query.ts | 4 +- src/client/app/common/views/components/index.ts | 4 +- .../views/components/messaging-room.message.vue | 2 +- .../app/common/views/components/note-html.ts | 157 ++++++ .../app/common/views/components/note-menu.vue | 141 +++++ src/client/app/common/views/components/poll.vue | 8 +- .../app/common/views/components/post-html.ts | 157 ------ .../app/common/views/components/post-menu.vue | 141 ----- .../common/views/components/reaction-picker.vue | 6 +- .../common/views/components/reactions-viewer.vue | 4 +- .../common/views/components/welcome-timeline.vue | 26 +- src/client/app/desktop/api/post.ts | 8 +- src/client/app/desktop/script.ts | 16 +- .../desktop/views/components/activity.calendar.vue | 2 +- .../desktop/views/components/activity.chart.vue | 16 +- src/client/app/desktop/views/components/index.ts | 32 +- .../app/desktop/views/components/mentions.vue | 24 +- .../desktop/views/components/note-detail.sub.vue | 130 +++++ .../app/desktop/views/components/note-detail.vue | 448 ++++++++++++++++ .../app/desktop/views/components/note-preview.vue | 107 ++++ .../desktop/views/components/notes.note.sub.vue | 116 ++++ .../app/desktop/views/components/notes.note.vue | 596 +++++++++++++++++++++ src/client/app/desktop/views/components/notes.vue | 89 +++ .../app/desktop/views/components/notifications.vue | 54 +- .../desktop/views/components/post-detail.sub.vue | 130 ----- .../app/desktop/views/components/post-detail.vue | 84 +-- .../desktop/views/components/post-form-window.vue | 6 +- .../app/desktop/views/components/post-form.vue | 32 +- .../app/desktop/views/components/post-preview.vue | 107 ---- .../desktop/views/components/posts.post.sub.vue | 116 ---- .../app/desktop/views/components/posts.post.vue | 104 ++-- src/client/app/desktop/views/components/posts.vue | 89 --- .../views/components/renote-form-window.vue | 42 ++ .../app/desktop/views/components/renote-form.vue | 131 +++++ .../views/components/repost-form-window.vue | 6 +- .../app/desktop/views/components/repost-form.vue | 26 +- .../desktop/views/components/sub-note-content.vue | 44 ++ .../desktop/views/components/sub-post-content.vue | 44 -- .../app/desktop/views/components/timeline.vue | 42 +- .../desktop/views/components/ui.header.post.vue | 6 +- .../app/desktop/views/components/user-preview.vue | 2 +- src/client/app/desktop/views/pages/home.vue | 12 +- src/client/app/desktop/views/pages/note.vue | 67 +++ src/client/app/desktop/views/pages/post.vue | 67 --- src/client/app/desktop/views/pages/search.vue | 32 +- .../app/desktop/views/pages/user/user.home.vue | 2 +- .../app/desktop/views/pages/user/user.photos.vue | 8 +- .../app/desktop/views/pages/user/user.profile.vue | 2 +- .../app/desktop/views/pages/user/user.timeline.vue | 24 +- .../desktop/views/widgets/channel.channel.form.vue | 4 +- .../desktop/views/widgets/channel.channel.note.vue | 75 +++ .../desktop/views/widgets/channel.channel.post.vue | 75 --- .../app/desktop/views/widgets/channel.channel.vue | 36 +- src/client/app/desktop/views/widgets/polls.vue | 8 +- src/client/app/desktop/views/widgets/post-form.vue | 4 +- src/client/app/desktop/views/widgets/trends.vue | 24 +- src/client/app/dev/views/new-app.vue | 2 +- src/client/app/mobile/api/post.ts | 20 +- src/client/app/mobile/script.ts | 4 +- .../app/mobile/views/components/activity.vue | 16 +- src/client/app/mobile/views/components/index.ts | 24 +- .../app/mobile/views/components/note-card.vue | 93 ++++ .../mobile/views/components/note-detail.sub.vue | 113 ++++ .../app/mobile/views/components/note-detail.vue | 462 ++++++++++++++++ .../app/mobile/views/components/note-preview.vue | 110 ++++ .../app/mobile/views/components/note.sub.vue | 119 ++++ src/client/app/mobile/views/components/note.vue | 540 +++++++++++++++++++ src/client/app/mobile/views/components/notes.vue | 111 ++++ .../views/components/notification-preview.vue | 42 +- .../app/mobile/views/components/notification.vue | 38 +- .../app/mobile/views/components/post-card.vue | 93 ---- .../mobile/views/components/post-detail.sub.vue | 113 ---- .../app/mobile/views/components/post-detail.vue | 80 +-- .../app/mobile/views/components/post-form.vue | 10 +- .../app/mobile/views/components/post-preview.vue | 110 ---- .../app/mobile/views/components/post.sub.vue | 119 ---- src/client/app/mobile/views/components/post.vue | 90 ++-- src/client/app/mobile/views/components/posts.vue | 111 ---- .../mobile/views/components/sub-note-content.vue | 43 ++ .../mobile/views/components/sub-post-content.vue | 43 -- .../app/mobile/views/components/timeline.vue | 38 +- .../app/mobile/views/components/user-timeline.vue | 32 +- src/client/app/mobile/views/pages/home.vue | 12 +- src/client/app/mobile/views/pages/note.vue | 85 +++ src/client/app/mobile/views/pages/post.vue | 85 --- src/client/app/mobile/views/pages/search.vue | 30 +- src/client/app/mobile/views/pages/user.vue | 8 +- .../app/mobile/views/pages/user/home.notes.vue | 57 ++ .../app/mobile/views/pages/user/home.photos.vue | 12 +- .../app/mobile/views/pages/user/home.posts.vue | 57 -- src/client/app/mobile/views/pages/user/home.vue | 14 +- src/client/app/stats/tags/index.tag | 28 +- src/client/docs/api/endpoints/notes/create.yaml | 59 ++ src/client/docs/api/endpoints/notes/timeline.yaml | 32 ++ src/client/docs/api/endpoints/posts/create.yaml | 59 -- src/client/docs/api/endpoints/posts/timeline.yaml | 32 -- src/client/docs/api/entities/note.yaml | 174 ++++++ src/client/docs/api/entities/post.yaml | 40 +- src/client/docs/api/entities/user.yaml | 16 +- src/client/docs/mute.ja.pug | 2 +- src/client/docs/search.ja.pug | 16 +- src/models/favorite.ts | 2 +- src/models/note-reaction.ts | 53 ++ src/models/note-watching.ts | 13 + src/models/note.ts | 241 +++++++++ src/models/notification.ts | 14 +- src/models/poll-vote.ts | 2 +- src/models/post-reaction.ts | 53 -- src/models/post-watching.ts | 13 - src/models/post.ts | 241 --------- src/models/user.ts | 18 +- src/othello/ai/back.ts | 10 +- src/othello/ai/front.ts | 18 +- src/publishers/stream.ts | 6 +- src/queue/processors/http/report-github-failure.ts | 4 +- src/remote/activitypub/act/create/note.ts | 22 +- src/remote/activitypub/act/delete/index.ts | 6 +- src/remote/activitypub/act/delete/note.ts | 12 +- src/remote/activitypub/act/like.ts | 12 +- src/remote/activitypub/renderer/like.ts | 4 +- src/remote/activitypub/renderer/note.ts | 28 +- src/remote/activitypub/resolve-person.ts | 4 +- src/renderers/get-note-summary.ts | 45 ++ src/renderers/get-notification-summary.ts | 16 +- src/renderers/get-post-summary.ts | 45 -- src/renderers/get-user-summary.ts | 2 +- src/server/activitypub/index.ts | 4 +- src/server/activitypub/note.ts | 43 ++ src/server/activitypub/outbox.ts | 8 +- src/server/activitypub/post.ts | 43 -- src/server/api/bot/core.ts | 22 +- src/server/api/bot/interfaces/line.ts | 18 +- src/server/api/endpoints.ts | 54 +- .../api/endpoints/aggregation/notes/reaction.ts | 76 +++ .../api/endpoints/aggregation/notes/reactions.ts | 72 +++ .../api/endpoints/aggregation/notes/reply.ts | 75 +++ .../api/endpoints/aggregation/notes/repost.ts | 75 +++ src/server/api/endpoints/aggregation/posts.ts | 22 +- .../api/endpoints/aggregation/posts/reaction.ts | 76 --- .../api/endpoints/aggregation/posts/reactions.ts | 72 --- .../api/endpoints/aggregation/posts/reply.ts | 75 --- .../api/endpoints/aggregation/posts/repost.ts | 75 --- .../api/endpoints/aggregation/users/activity.ts | 20 +- src/server/api/endpoints/aggregation/users/post.ts | 22 +- .../api/endpoints/aggregation/users/reaction.ts | 2 +- src/server/api/endpoints/app/create.ts | 2 +- src/server/api/endpoints/app/name_id/available.ts | 2 +- src/server/api/endpoints/app/show.ts | 2 +- src/server/api/endpoints/auth/accept.ts | 2 +- src/server/api/endpoints/auth/session/generate.ts | 2 +- src/server/api/endpoints/auth/session/show.ts | 2 +- src/server/api/endpoints/auth/session/userkey.ts | 2 +- src/server/api/endpoints/channels/posts.ts | 10 +- src/server/api/endpoints/i/favorites.ts | 4 +- src/server/api/endpoints/i/pin.ts | 20 +- src/server/api/endpoints/meta.ts | 2 +- src/server/api/endpoints/notes/context.ts | 63 +++ src/server/api/endpoints/notes/create.ts | 251 +++++++++ src/server/api/endpoints/notes/favorites/create.ts | 48 ++ src/server/api/endpoints/notes/favorites/delete.ts | 46 ++ src/server/api/endpoints/notes/mentions.ts | 78 +++ .../api/endpoints/notes/polls/recommendation.ts | 59 ++ src/server/api/endpoints/notes/polls/vote.ts | 115 ++++ src/server/api/endpoints/notes/reactions.ts | 57 ++ src/server/api/endpoints/notes/reactions/create.ts | 47 ++ src/server/api/endpoints/notes/reactions/delete.ts | 60 +++ src/server/api/endpoints/notes/replies.ts | 53 ++ src/server/api/endpoints/notes/reposts.ts | 73 +++ src/server/api/endpoints/notes/search.ts | 364 +++++++++++++ src/server/api/endpoints/notes/show.ts | 32 ++ src/server/api/endpoints/notes/timeline.ts | 132 +++++ src/server/api/endpoints/notes/trend.ts | 79 +++ src/server/api/endpoints/posts.ts | 18 +- src/server/api/endpoints/posts/context.ts | 63 --- src/server/api/endpoints/posts/create.ts | 108 ++-- src/server/api/endpoints/posts/favorites/create.ts | 48 -- src/server/api/endpoints/posts/favorites/delete.ts | 46 -- src/server/api/endpoints/posts/mentions.ts | 78 --- .../api/endpoints/posts/polls/recommendation.ts | 59 -- src/server/api/endpoints/posts/polls/vote.ts | 115 ---- src/server/api/endpoints/posts/reactions.ts | 57 -- src/server/api/endpoints/posts/reactions/create.ts | 47 -- src/server/api/endpoints/posts/reactions/delete.ts | 60 --- src/server/api/endpoints/posts/replies.ts | 53 -- src/server/api/endpoints/posts/reposts.ts | 73 --- src/server/api/endpoints/posts/search.ts | 364 ------------- src/server/api/endpoints/posts/show.ts | 32 -- src/server/api/endpoints/posts/timeline.ts | 132 ----- src/server/api/endpoints/posts/trend.ts | 79 --- src/server/api/endpoints/stats.ts | 12 +- .../users/get_frequently_replied_users.ts | 18 +- src/server/api/endpoints/users/posts.ts | 10 +- src/server/api/private/signup.ts | 2 +- src/server/api/service/github.ts | 2 +- src/server/api/stream/home.ts | 24 +- src/services/note/create.ts | 357 ++++++++++++ src/services/note/reaction/create.ts | 94 ++++ src/services/note/watch.ts | 26 + src/services/post/create.ts | 358 ------------- src/services/post/reaction/create.ts | 94 ---- src/services/post/watch.ts | 26 - tools/migration/nighthike/11.js | 35 ++ 208 files changed, 7945 insertions(+), 5267 deletions(-) create mode 100644 src/client/app/common/views/components/note-html.ts create mode 100644 src/client/app/common/views/components/note-menu.vue delete mode 100644 src/client/app/common/views/components/post-html.ts delete mode 100644 src/client/app/common/views/components/post-menu.vue create mode 100644 src/client/app/desktop/views/components/note-detail.sub.vue create mode 100644 src/client/app/desktop/views/components/note-detail.vue create mode 100644 src/client/app/desktop/views/components/note-preview.vue create mode 100644 src/client/app/desktop/views/components/notes.note.sub.vue create mode 100644 src/client/app/desktop/views/components/notes.note.vue create mode 100644 src/client/app/desktop/views/components/notes.vue delete mode 100644 src/client/app/desktop/views/components/post-detail.sub.vue delete mode 100644 src/client/app/desktop/views/components/post-preview.vue delete mode 100644 src/client/app/desktop/views/components/posts.post.sub.vue delete mode 100644 src/client/app/desktop/views/components/posts.vue create mode 100644 src/client/app/desktop/views/components/renote-form-window.vue create mode 100644 src/client/app/desktop/views/components/renote-form.vue create mode 100644 src/client/app/desktop/views/components/sub-note-content.vue delete mode 100644 src/client/app/desktop/views/components/sub-post-content.vue create mode 100644 src/client/app/desktop/views/pages/note.vue delete mode 100644 src/client/app/desktop/views/pages/post.vue create mode 100644 src/client/app/desktop/views/widgets/channel.channel.note.vue delete mode 100644 src/client/app/desktop/views/widgets/channel.channel.post.vue create mode 100644 src/client/app/mobile/views/components/note-card.vue create mode 100644 src/client/app/mobile/views/components/note-detail.sub.vue create mode 100644 src/client/app/mobile/views/components/note-detail.vue create mode 100644 src/client/app/mobile/views/components/note-preview.vue create mode 100644 src/client/app/mobile/views/components/note.sub.vue create mode 100644 src/client/app/mobile/views/components/note.vue create mode 100644 src/client/app/mobile/views/components/notes.vue delete mode 100644 src/client/app/mobile/views/components/post-card.vue delete mode 100644 src/client/app/mobile/views/components/post-detail.sub.vue delete mode 100644 src/client/app/mobile/views/components/post-preview.vue delete mode 100644 src/client/app/mobile/views/components/post.sub.vue delete mode 100644 src/client/app/mobile/views/components/posts.vue create mode 100644 src/client/app/mobile/views/components/sub-note-content.vue delete mode 100644 src/client/app/mobile/views/components/sub-post-content.vue create mode 100644 src/client/app/mobile/views/pages/note.vue delete mode 100644 src/client/app/mobile/views/pages/post.vue create mode 100644 src/client/app/mobile/views/pages/user/home.notes.vue delete mode 100644 src/client/app/mobile/views/pages/user/home.posts.vue create mode 100644 src/client/docs/api/endpoints/notes/create.yaml create mode 100644 src/client/docs/api/endpoints/notes/timeline.yaml delete mode 100644 src/client/docs/api/endpoints/posts/create.yaml delete mode 100644 src/client/docs/api/endpoints/posts/timeline.yaml create mode 100644 src/client/docs/api/entities/note.yaml create mode 100644 src/models/note-reaction.ts create mode 100644 src/models/note-watching.ts create mode 100644 src/models/note.ts delete mode 100644 src/models/post-reaction.ts delete mode 100644 src/models/post-watching.ts delete mode 100644 src/models/post.ts create mode 100644 src/renderers/get-note-summary.ts delete mode 100644 src/renderers/get-post-summary.ts create mode 100644 src/server/activitypub/note.ts delete mode 100644 src/server/activitypub/post.ts create mode 100644 src/server/api/endpoints/aggregation/notes/reaction.ts create mode 100644 src/server/api/endpoints/aggregation/notes/reactions.ts create mode 100644 src/server/api/endpoints/aggregation/notes/reply.ts create mode 100644 src/server/api/endpoints/aggregation/notes/repost.ts delete mode 100644 src/server/api/endpoints/aggregation/posts/reaction.ts delete mode 100644 src/server/api/endpoints/aggregation/posts/reactions.ts delete mode 100644 src/server/api/endpoints/aggregation/posts/reply.ts delete mode 100644 src/server/api/endpoints/aggregation/posts/repost.ts create mode 100644 src/server/api/endpoints/notes/context.ts create mode 100644 src/server/api/endpoints/notes/create.ts create mode 100644 src/server/api/endpoints/notes/favorites/create.ts create mode 100644 src/server/api/endpoints/notes/favorites/delete.ts create mode 100644 src/server/api/endpoints/notes/mentions.ts create mode 100644 src/server/api/endpoints/notes/polls/recommendation.ts create mode 100644 src/server/api/endpoints/notes/polls/vote.ts create mode 100644 src/server/api/endpoints/notes/reactions.ts create mode 100644 src/server/api/endpoints/notes/reactions/create.ts create mode 100644 src/server/api/endpoints/notes/reactions/delete.ts create mode 100644 src/server/api/endpoints/notes/replies.ts create mode 100644 src/server/api/endpoints/notes/reposts.ts create mode 100644 src/server/api/endpoints/notes/search.ts create mode 100644 src/server/api/endpoints/notes/show.ts create mode 100644 src/server/api/endpoints/notes/timeline.ts create mode 100644 src/server/api/endpoints/notes/trend.ts delete mode 100644 src/server/api/endpoints/posts/context.ts delete mode 100644 src/server/api/endpoints/posts/favorites/create.ts delete mode 100644 src/server/api/endpoints/posts/favorites/delete.ts delete mode 100644 src/server/api/endpoints/posts/mentions.ts delete mode 100644 src/server/api/endpoints/posts/polls/recommendation.ts delete mode 100644 src/server/api/endpoints/posts/polls/vote.ts delete mode 100644 src/server/api/endpoints/posts/reactions.ts delete mode 100644 src/server/api/endpoints/posts/reactions/create.ts delete mode 100644 src/server/api/endpoints/posts/reactions/delete.ts delete mode 100644 src/server/api/endpoints/posts/replies.ts delete mode 100644 src/server/api/endpoints/posts/reposts.ts delete mode 100644 src/server/api/endpoints/posts/search.ts delete mode 100644 src/server/api/endpoints/posts/show.ts delete mode 100644 src/server/api/endpoints/posts/timeline.ts delete mode 100644 src/server/api/endpoints/posts/trend.ts create mode 100644 src/services/note/create.ts create mode 100644 src/services/note/reaction/create.ts create mode 100644 src/services/note/watch.ts delete mode 100644 src/services/post/create.ts delete mode 100644 src/services/post/reaction/create.ts delete mode 100644 src/services/post/watch.ts create mode 100644 tools/migration/nighthike/11.js (limited to 'src/client/docs/api/endpoints') diff --git a/locales/en.yml b/locales/en.yml index 2cc857f698..900571124f 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -33,7 +33,7 @@ common: confused: "Confused" pudding: "Pudding" - post_categories: + note_categories: music: "Music" game: "Video Game" anime: "Anime" @@ -124,7 +124,7 @@ common: show-result: "Show result" voted: "Voted" - mk-post-menu: + mk-note-menu: pin: "Pin" pinned: "Pinned" select: "Select category" @@ -211,7 +211,7 @@ ch: textarea: "Write here" upload: "Upload" drive: "Drive" - post: "Do" + note: "Do" posting: "Doing" desktop: @@ -304,8 +304,8 @@ desktop: settings: "Settings" signout: "Sign out" - mk-ui-header-post-button: - post: "Compose new Post" + mk-ui-header-note-button: + note: "Compose new Post" mk-ui-header-notifications: title: "Notifications" @@ -350,18 +350,18 @@ desktop: no-users: "No muted users" mk-post-form: - post-placeholder: "What's happening?" - reply-placeholder: "Reply to this post..." - quote-placeholder: "Quote this post..." - post: "Post" + note-placeholder: "What's happening?" + reply-placeholder: "Reply to this note..." + quote-placeholder: "Quote this note..." + note: "Post" reply: "Reply" - repost: "Repost" + renote: "Renote" posted: "Posted!" replied: "Replied!" reposted: "Reposted!" - post-failed: "Failed to post" + note-failed: "Failed to note" reply-failed: "Failed to reply" - repost-failed: "Failed to repost" + renote-failed: "Failed to renote" posting: "Posting" attach-media-from-local: "Attach media from your pc" attach-media-from-drive: "Attach media from the drive" @@ -371,14 +371,14 @@ desktop: text-remain: "{} chars remaining" mk-post-form-window: - post: "New post" + note: "New note" reply: "Reply" attaches: "{} media attached" uploading-media: "Uploading {} media" - mk-post-page: - prev: "Previous post" - next: "Next post" + mk-note-page: + prev: "Previous note" + next: "Next note" mk-settings: profile: "Profile" @@ -390,10 +390,10 @@ desktop: other: "Other" license: "License" - mk-timeline-post: + mk-timeline-note: reposted-by: "Reposted by {}" reply: "Reply" - repost: "Repost" + renote: "Renote" add-reaction: "Add your reaction" detail: "Show detail" @@ -448,7 +448,7 @@ desktop: mk-post-form-home-widget: title: "Post" - post: "Post" + note: "Post" placeholder: "What's happening?" mk-access-log-home-widget: @@ -463,16 +463,16 @@ desktop: have-a-nice-day: "Have a nice day!" next: "Next" - mk-repost-form: + mk-renote-form: quote: "Quote..." cancel: "Cancel" - repost: "Repost" + renote: "Renote" reposting: "Reposting..." success: "Reposted!" - failure: "Failed to Repost" + failure: "Failed to Renote" - mk-repost-form-window: - title: "Are you sure you want to repost this post?" + mk-renote-form-window: + title: "Are you sure you want to renote this note?" mk-user: last-used-at: "Last used at" @@ -541,10 +541,10 @@ mobile: notifications: "Notifications" read-all: "Are you sure you want to mark all unread notifications as read?" - mk-post-page: + mk-note-page: title: "Post" - prev: "Previous post" - next: "Next post" + prev: "Previous note" + next: "Next note" mk-search-page: search: "Search" @@ -606,33 +606,33 @@ mobile: unfollow: "Unfollow" mk-home-timeline: - empty-timeline: "There is no posts" + empty-timeline: "There is no notes" mk-notifications: more: "More" empty: "No notifications" - mk-post-detail: + mk-note-detail: reply: "Reply" reaction: "Reaction" mk-post-form: submit: "Post" - reply-placeholder: "Reply to this post..." - post-placeholder: "What's happening?" + reply-placeholder: "Reply to this note..." + note-placeholder: "What's happening?" - mk-search-posts: - empty: "There is no post related to the 「{}」" + mk-search-notes: + empty: "There is no note related to the 「{}」" - mk-sub-post-content: + mk-sub-note-content: media-count: "{} media" poll: "Poll" - mk-timeline-post: + mk-timeline-note: reposted-by: "Reposted by {}" mk-timeline: - empty: "No posts" + empty: "No notes" load-more: "More" mk-ui-nav: @@ -652,21 +652,21 @@ mobile: no-users: "No following." mk-user-timeline: - no-posts: "This user seems never post" - no-posts-with-media: "There is no posts with media" + no-notes: "This user seems never note" + no-notes-with-media: "There is no notes with media" load-more: "More" mk-user: follows-you: "Follows you" following: "Following" followers: "Followers" - posts: "Posts" + notes: "Posts" overview: "Overview" timeline: "Timeline" media: "Media" mk-user-overview: - recent-posts: "Recent posts" + recent-notes: "Recent notes" images: "Images" activity: "Activity" keywords: "Keywords" @@ -675,9 +675,9 @@ mobile: followers-you-know: "Followers you know" last-used-at: "Last used at" - mk-user-overview-posts: + mk-user-overview-notes: loading: "Loading" - no-posts: "No posts" + no-notes: "No notes" mk-user-overview-photos: loading: "Loading" @@ -703,7 +703,7 @@ mobile: load-more: "More" stats: - posts-count: "Number of all posts" + notes-count: "Number of all notes" users-count: "Number of all users" status: diff --git a/locales/ja.yml b/locales/ja.yml index fd140ecc30..84694e3c74 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -33,7 +33,7 @@ common: confused: "こまこまのこまり" pudding: "Pudding" - post_categories: + note_categories: music: "音楽" game: "ゲーム" anime: "アニメ" @@ -124,7 +124,7 @@ common: show-result: "結果を見る" voted: "投票済み" - mk-post-menu: + mk-note-menu: pin: "ピン留め" pinned: "ピン留めしました" select: "カテゴリを選択" @@ -211,7 +211,7 @@ ch: textarea: "書いて" upload: "アップロード" drive: "ドライブ" - post: "やる" + note: "やる" posting: "やってます" desktop: @@ -304,8 +304,8 @@ desktop: settings: "設定" signout: "サインアウト" - mk-ui-header-post-button: - post: "新規投稿" + mk-ui-header-note-button: + note: "新規投稿" mk-ui-header-notifications: title: "通知" @@ -350,18 +350,18 @@ desktop: no-users: "ミュートしているユーザーはいません" mk-post-form: - post-placeholder: "いまどうしてる?" + note-placeholder: "いまどうしてる?" reply-placeholder: "この投稿への返信..." quote-placeholder: "この投稿を引用..." - post: "投稿" + note: "投稿" reply: "返信" - repost: "Repost" + renote: "Renote" posted: "投稿しました!" replied: "返信しました!" - reposted: "Repostしました!" - post-failed: "投稿に失敗しました" + reposted: "Renoteしました!" + note-failed: "投稿に失敗しました" reply-failed: "返信に失敗しました" - repost-failed: "Repostに失敗しました" + renote-failed: "Renoteに失敗しました" posting: "投稿中" attach-media-from-local: "PCからメディアを添付" attach-media-from-drive: "ドライブからメディアを添付" @@ -371,12 +371,12 @@ desktop: text-remain: "のこり{}文字" mk-post-form-window: - post: "新規投稿" + note: "新規投稿" reply: "返信" attaches: "添付: {}メディア" uploading-media: "{}個のメディアをアップロード中" - mk-post-page: + mk-note-page: prev: "前の投稿" next: "次の投稿" @@ -390,10 +390,10 @@ desktop: other: "その他" license: "ライセンス" - mk-timeline-post: - reposted-by: "{}がRepost" + mk-timeline-note: + reposted-by: "{}がRenote" reply: "返信" - repost: "Repost" + renote: "Renote" add-reaction: "リアクション" detail: "詳細" @@ -448,7 +448,7 @@ desktop: mk-post-form-home-widget: title: "投稿" - post: "投稿" + note: "投稿" placeholder: "いまどうしてる?" mk-access-log-home-widget: @@ -463,16 +463,16 @@ desktop: have-a-nice-day: "良い一日を!" next: "次" - mk-repost-form: + mk-renote-form: quote: "引用する..." cancel: "キャンセル" - repost: "Repost" + renote: "Renote" reposting: "しています..." - success: "Repostしました!" - failure: "Repostに失敗しました" + success: "Renoteしました!" + failure: "Renoteに失敗しました" - mk-repost-form-window: - title: "この投稿をRepostしますか?" + mk-renote-form-window: + title: "この投稿をRenoteしますか?" mk-user: last-used-at: "最終アクセス" @@ -541,7 +541,7 @@ mobile: notifications: "通知" read-all: "すべての通知を既読にしますか?" - mk-post-page: + mk-note-page: title: "投稿" prev: "前の投稿" next: "次の投稿" @@ -612,24 +612,24 @@ mobile: more: "もっと見る" empty: "ありません!" - mk-post-detail: + mk-note-detail: reply: "返信" reaction: "リアクション" mk-post-form: submit: "投稿" reply-placeholder: "この投稿への返信..." - post-placeholder: "いまどうしてる?" + note-placeholder: "いまどうしてる?" - mk-search-posts: + mk-search-notes: empty: "「{}」に関する投稿は見つかりませんでした。" - mk-sub-post-content: + mk-sub-note-content: media-count: "{}個のメディア" poll: "投票" - mk-timeline-post: - reposted-by: "{}がRepost" + mk-timeline-note: + reposted-by: "{}がRenote" mk-timeline: empty: "表示するものがありません" @@ -652,21 +652,21 @@ mobile: no-users: "フォロー中のユーザーはいないようです。" mk-user-timeline: - no-posts: "このユーザーはまだ投稿していないようです。" - no-posts-with-media: "メディア付き投稿はありません。" + no-notes: "このユーザーはまだ投稿していないようです。" + no-notes-with-media: "メディア付き投稿はありません。" load-more: "もっとみる" mk-user: follows-you: "フォローされています" following: "フォロー" followers: "フォロワー" - posts: "投稿" + notes: "投稿" overview: "概要" timeline: "タイムライン" media: "メディア" mk-user-overview: - recent-posts: "最近の投稿" + recent-notes: "最近の投稿" images: "画像" activity: "アクティビティ" keywords: "キーワード" @@ -675,9 +675,9 @@ mobile: followers-you-know: "知り合いのフォロワー" last-used-at: "最終ログイン" - mk-user-overview-posts: + mk-user-overview-notes: loading: "読み込み中" - no-posts: "投稿はありません" + no-notes: "投稿はありません" mk-user-overview-photos: loading: "読み込み中" @@ -703,7 +703,7 @@ mobile: load-more: "もっと" stats: - posts-count: "投稿の数" + notes-count: "投稿の数" users-count: "アカウントの数" status: diff --git a/src/client/app/auth/views/form.vue b/src/client/app/auth/views/form.vue index eb55b9035b..b323907eb0 100644 --- a/src/client/app/auth/views/form.vue +++ b/src/client/app/auth/views/form.vue @@ -16,7 +16,7 @@ @@ -27,7 +27,7 @@ export default Vue.extend({ moreFetching: false, mode: 'default', unreadCount: 0, - posts: [], + notes: [], date: null }; }, @@ -38,7 +38,7 @@ export default Vue.extend({ }, computed: { empty(): boolean { - return this.posts.length == 0; + return this.notes.length == 0; } }, mounted() { @@ -60,26 +60,26 @@ export default Vue.extend({ } }, fetch(cb?) { - (this as any).api('users/posts', { + (this as any).api('users/notes', { userId: this.user.id, untilDate: this.date ? this.date.getTime() : undefined, with_replies: this.mode == 'with-replies' - }).then(posts => { - this.posts = posts; + }).then(notes => { + this.notes = notes; this.fetching = false; if (cb) cb(); }); }, more() { - if (this.moreFetching || this.fetching || this.posts.length == 0) return; + if (this.moreFetching || this.fetching || this.notes.length == 0) return; this.moreFetching = true; - (this as any).api('users/posts', { + (this as any).api('users/notes', { userId: this.user.id, with_replies: this.mode == 'with-replies', - untilId: this.posts[this.posts.length - 1].id - }).then(posts => { + untilId: this.notes[this.notes.length - 1].id + }).then(notes => { this.moreFetching = false; - this.posts = this.posts.concat(posts); + this.notes = this.notes.concat(notes); }); }, onScroll() { diff --git a/src/client/app/desktop/views/widgets/channel.channel.form.vue b/src/client/app/desktop/views/widgets/channel.channel.form.vue index aaf327f1ef..f2744268bb 100644 --- a/src/client/app/desktop/views/widgets/channel.channel.form.vue +++ b/src/client/app/desktop/views/widgets/channel.channel.form.vue @@ -24,11 +24,11 @@ export default Vue.extend({ if (/^>>([0-9]+) /.test(this.text)) { const index = this.text.match(/^>>([0-9]+) /)[1]; - reply = (this.$parent as any).posts.find(p => p.index.toString() == index); + reply = (this.$parent as any).notes.find(p => p.index.toString() == index); this.text = this.text.replace(/^>>([0-9]+) /, ''); } - (this as any).api('posts/create', { + (this as any).api('notes/create', { text: this.text, replyId: reply ? reply.id : undefined, channelId: (this.$parent as any).channel.id diff --git a/src/client/app/desktop/views/widgets/channel.channel.note.vue b/src/client/app/desktop/views/widgets/channel.channel.note.vue new file mode 100644 index 0000000000..313a2e3f4f --- /dev/null +++ b/src/client/app/desktop/views/widgets/channel.channel.note.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/src/client/app/desktop/views/widgets/channel.channel.post.vue b/src/client/app/desktop/views/widgets/channel.channel.post.vue deleted file mode 100644 index fa6d8c34a5..0000000000 --- a/src/client/app/desktop/views/widgets/channel.channel.post.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/widgets/channel.channel.vue b/src/client/app/desktop/views/widgets/channel.channel.vue index e9fb9e3fd7..ea4d8f8454 100644 --- a/src/client/app/desktop/views/widgets/channel.channel.vue +++ b/src/client/app/desktop/views/widgets/channel.channel.vue @@ -1,9 +1,9 @@ - + @@ -36,7 +36,7 @@ export default define({ post() { this.posting = true; - (this as any).api('posts/create', { + (this as any).api('notes/create', { text: this.text }).then(data => { this.clear(); diff --git a/src/client/app/desktop/views/widgets/trends.vue b/src/client/app/desktop/views/widgets/trends.vue index 27c1860b32..c2c7636bb3 100644 --- a/src/client/app/desktop/views/widgets/trends.vue +++ b/src/client/app/desktop/views/widgets/trends.vue @@ -5,8 +5,8 @@

%fa:spinner .pulse .fw%%i18n:common.loading%

-
-

{{ post.text }}

+
+

{{ note.text }}

@{{ acct }}

%i18n:desktop.tags.mk-trends-home-widget.nothing%

@@ -25,12 +25,12 @@ export default define({ }).extend({ computed: { acct() { - return getAcct(this.post.user); + return getAcct(this.note.user); }, }, data() { return { - post: null, + note: null, fetching: true, offset: 0 }; @@ -44,23 +44,23 @@ export default define({ }, fetch() { this.fetching = true; - this.post = null; + this.note = null; - (this as any).api('posts/trend', { + (this as any).api('notes/trend', { limit: 1, offset: this.offset, - repost: false, + renote: false, reply: false, media: false, poll: false - }).then(posts => { - const post = posts ? posts[0] : null; - if (post == null) { + }).then(notes => { + const note = notes ? notes[0] : null; + if (note == null) { this.offset = 0; } else { this.offset++; } - this.post = post; + this.note = note; this.fetching = false; }); } @@ -103,7 +103,7 @@ export default define({ &:active color #999 - > .post + > .note padding 16px font-size 12px font-style oblique diff --git a/src/client/app/dev/views/new-app.vue b/src/client/app/dev/views/new-app.vue index e407ca00d7..c9d5971395 100644 --- a/src/client/app/dev/views/new-app.vue +++ b/src/client/app/dev/views/new-app.vue @@ -27,7 +27,7 @@ アカウントの情報を見る。 アカウントの情報を操作する。 - 投稿する。 + 投稿する。 リアクションしたりリアクションをキャンセルする。 フォローしたりフォロー解除する。 ドライブを見る。 diff --git a/src/client/app/mobile/api/post.ts b/src/client/app/mobile/api/post.ts index 98309ba8de..72919c6505 100644 --- a/src/client/app/mobile/api/post.ts +++ b/src/client/app/mobile/api/post.ts @@ -1,24 +1,24 @@ import PostForm from '../views/components/post-form.vue'; -//import RepostForm from '../views/components/repost-form.vue'; -import getPostSummary from '../../../../renderers/get-post-summary'; +//import RenoteForm from '../views/components/renote-form.vue'; +import getNoteSummary from '../../../../renderers/get-note-summary'; export default (os) => (opts) => { const o = opts || {}; - if (o.repost) { - /*const vm = new RepostForm({ + if (o.renote) { + /*const vm = new RenoteForm({ propsData: { - repost: o.repost + renote: o.renote } }).$mount(); vm.$once('cancel', recover); - vm.$once('post', recover); + vm.$once('note', recover); document.body.appendChild(vm.$el);*/ - const text = window.prompt(`「${getPostSummary(o.repost)}」をRepost`); + const text = window.prompt(`「${getNoteSummary(o.renote)}」をRenote`); if (text == null) return; - os.api('posts/create', { - repostId: o.repost.id, + os.api('notes/create', { + renoteId: o.renote.id, text: text == '' ? undefined : text }); } else { @@ -36,7 +36,7 @@ export default (os) => (opts) => { } }).$mount(); vm.$once('cancel', recover); - vm.$once('post', recover); + vm.$once('note', recover); document.body.appendChild(vm.$el); (vm as any).focus(); } diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts index 4776fccddb..6265d0d45f 100644 --- a/src/client/app/mobile/script.ts +++ b/src/client/app/mobile/script.ts @@ -25,7 +25,7 @@ import MkDrive from './views/pages/drive.vue'; import MkNotifications from './views/pages/notifications.vue'; import MkMessaging from './views/pages/messaging.vue'; import MkMessagingRoom from './views/pages/messaging-room.vue'; -import MkPost from './views/pages/post.vue'; +import MkNote from './views/pages/note.vue'; import MkSearch from './views/pages/search.vue'; import MkFollowers from './views/pages/followers.vue'; import MkFollowing from './views/pages/following.vue'; @@ -68,7 +68,7 @@ init((launch) => { { path: '/@:user', component: MkUser }, { path: '/@:user/followers', component: MkFollowers }, { path: '/@:user/following', component: MkFollowing }, - { path: '/@:user/:post', component: MkPost } + { path: '/@:user/:note', component: MkNote } ] }); diff --git a/src/client/app/mobile/views/components/activity.vue b/src/client/app/mobile/views/components/activity.vue index 2e44017e77..dcd319cb69 100644 --- a/src/client/app/mobile/views/components/activity.vue +++ b/src/client/app/mobile/views/components/activity.vue @@ -2,14 +2,14 @@
- - @@ -32,12 +32,12 @@ export default Vue.extend({ userId: this.user.id, limit: 30 }).then(data => { - data.forEach(d => d.total = d.posts + d.replies + d.reposts); + data.forEach(d => d.total = d.notes + d.replies + d.renotes); this.peak = Math.max.apply(null, data.map(d => d.total)); data.forEach(d => { - d.postsH = d.posts / this.peak; + d.notesH = d.notes / this.peak; d.repliesH = d.replies / this.peak; - d.repostsH = d.reposts / this.peak; + d.renotesH = d.renotes / this.peak; }); data.reverse(); this.data = data; diff --git a/src/client/app/mobile/views/components/index.ts b/src/client/app/mobile/views/components/index.ts index fb8f65f47d..9346700304 100644 --- a/src/client/app/mobile/views/components/index.ts +++ b/src/client/app/mobile/views/components/index.ts @@ -2,16 +2,16 @@ import Vue from 'vue'; import ui from './ui.vue'; import timeline from './timeline.vue'; -import post from './post.vue'; -import posts from './posts.vue'; +import note from './note.vue'; +import notes from './notes.vue'; import mediaImage from './media-image.vue'; import mediaVideo from './media-video.vue'; import drive from './drive.vue'; -import postPreview from './post-preview.vue'; -import subPostContent from './sub-post-content.vue'; -import postCard from './post-card.vue'; +import notePreview from './note-preview.vue'; +import subNoteContent from './sub-note-content.vue'; +import noteCard from './note-card.vue'; import userCard from './user-card.vue'; -import postDetail from './post-detail.vue'; +import noteDetail from './note-detail.vue'; import followButton from './follow-button.vue'; import friendsMaker from './friends-maker.vue'; import notification from './notification.vue'; @@ -25,16 +25,16 @@ import widgetContainer from './widget-container.vue'; Vue.component('mk-ui', ui); Vue.component('mk-timeline', timeline); -Vue.component('mk-post', post); -Vue.component('mk-posts', posts); +Vue.component('mk-note', note); +Vue.component('mk-notes', notes); Vue.component('mk-media-image', mediaImage); Vue.component('mk-media-video', mediaVideo); Vue.component('mk-drive', drive); -Vue.component('mk-post-preview', postPreview); -Vue.component('mk-sub-post-content', subPostContent); -Vue.component('mk-post-card', postCard); +Vue.component('mk-note-preview', notePreview); +Vue.component('mk-sub-note-content', subNoteContent); +Vue.component('mk-note-card', noteCard); Vue.component('mk-user-card', userCard); -Vue.component('mk-post-detail', postDetail); +Vue.component('mk-note-detail', noteDetail); Vue.component('mk-follow-button', followButton); Vue.component('mk-friends-maker', friendsMaker); Vue.component('mk-notification', notification); diff --git a/src/client/app/mobile/views/components/note-card.vue b/src/client/app/mobile/views/components/note-card.vue new file mode 100644 index 0000000000..9ad0d3e294 --- /dev/null +++ b/src/client/app/mobile/views/components/note-card.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/client/app/mobile/views/components/note-detail.sub.vue b/src/client/app/mobile/views/components/note-detail.sub.vue new file mode 100644 index 0000000000..38aea4ba20 --- /dev/null +++ b/src/client/app/mobile/views/components/note-detail.sub.vue @@ -0,0 +1,113 @@ + + + + + + diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue new file mode 100644 index 0000000000..e1682e58ed --- /dev/null +++ b/src/client/app/mobile/views/components/note-detail.vue @@ -0,0 +1,462 @@ + + + + + + + diff --git a/src/client/app/mobile/views/components/note-preview.vue b/src/client/app/mobile/views/components/note-preview.vue new file mode 100644 index 0000000000..8c8d8645bb --- /dev/null +++ b/src/client/app/mobile/views/components/note-preview.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/src/client/app/mobile/views/components/note.sub.vue b/src/client/app/mobile/views/components/note.sub.vue new file mode 100644 index 0000000000..a37d0dea08 --- /dev/null +++ b/src/client/app/mobile/views/components/note.sub.vue @@ -0,0 +1,119 @@ + + + + + + diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue new file mode 100644 index 0000000000..4b33c6f071 --- /dev/null +++ b/src/client/app/mobile/views/components/note.vue @@ -0,0 +1,540 @@ + + + + + + + diff --git a/src/client/app/mobile/views/components/notes.vue b/src/client/app/mobile/views/components/notes.vue new file mode 100644 index 0000000000..573026d53e --- /dev/null +++ b/src/client/app/mobile/views/components/notes.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/src/client/app/mobile/views/components/notification-preview.vue b/src/client/app/mobile/views/components/notification-preview.vue index 0492c5d86c..79ca3321e4 100644 --- a/src/client/app/mobile/views/components/notification-preview.vue +++ b/src/client/app/mobile/views/components/notification-preview.vue @@ -4,23 +4,23 @@ avatar

{{ name }}

-

%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%

+

%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%

- @@ -51,7 +51,7 @@ avatar

%fa:chart-pie%{{ name }}

-

%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%

+

%fa:quote-left%{{ getNoteSummary(notification.note) }}%fa:quote-right%

@@ -59,7 +59,7 @@ - - diff --git a/src/client/app/mobile/views/components/post-detail.sub.vue b/src/client/app/mobile/views/components/post-detail.sub.vue deleted file mode 100644 index 98d6a14cac..0000000000 --- a/src/client/app/mobile/views/components/post-detail.sub.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - diff --git a/src/client/app/mobile/views/components/post-detail.vue b/src/client/app/mobile/views/components/post-detail.vue index 0226ce081a..e1682e58ed 100644 --- a/src/client/app/mobile/views/components/post-detail.vue +++ b/src/client/app/mobile/views/components/post-detail.vue @@ -1,5 +1,5 @@
- +
- +
-
+

- avatar + avatar %fa:retweet% {{ name }} - がRepost + がRenote

@@ -38,33 +38,33 @@
- +
{{ tag }}
- + %fa:map-marker-alt% 位置情報
-
- +
+
- - - -
- +
@@ -84,9 +84,9 @@ import getAcct from '../../../../../acct/render'; import getUserName from '../../../../../renderers/get-user-name'; import parse from '../../../../../text/parse'; -import MkPostMenu from '../../../common/views/components/post-menu.vue'; +import MkNoteMenu from '../../../common/views/components/note-menu.vue'; import MkReactionPicker from '../../../common/views/components/reaction-picker.vue'; -import XSub from './post-detail.sub.vue'; +import XSub from './note-detail.sub.vue'; export default Vue.extend({ components: { @@ -94,7 +94,7 @@ export default Vue.extend({ }, props: { - post: { + note: { type: Object, required: true }, @@ -113,10 +113,10 @@ export default Vue.extend({ computed: { acct(): string { - return getAcct(this.post.user); + return getAcct(this.note.user); }, name(): string { - return getUserName(this.post.user); + return getUserName(this.note.user); }, pAcct(): string { return getAcct(this.p.user); @@ -124,14 +124,14 @@ export default Vue.extend({ pName(): string { return getUserName(this.p.user); }, - isRepost(): boolean { - return (this.post.repost && - this.post.text == null && - this.post.mediaIds == null && - this.post.poll == null); + isRenote(): boolean { + return (this.note.renote && + this.note.text == null && + this.note.mediaIds == null && + this.note.poll == null); }, p(): any { - return this.isRepost ? this.post.repost : this.post; + return this.isRenote ? this.note.renote : this.note; }, reactionsCount(): number { return this.p.reactionCounts @@ -155,8 +155,8 @@ export default Vue.extend({ mounted() { // Get replies if (!this.compact) { - (this as any).api('posts/replies', { - postId: this.p.id, + (this as any).api('notes/replies', { + noteId: this.p.id, limit: 8 }).then(replies => { this.replies = replies; @@ -187,8 +187,8 @@ export default Vue.extend({ this.contextFetching = true; // Fetch context - (this as any).api('posts/context', { - postId: this.p.replyId + (this as any).api('notes/context', { + noteId: this.p.replyId }).then(context => { this.contextFetching = false; this.context = context.reverse(); @@ -199,22 +199,22 @@ export default Vue.extend({ reply: this.p }); }, - repost() { + renote() { (this as any).apis.post({ - repost: this.p + renote: this.p }); }, react() { (this as any).os.new(MkReactionPicker, { source: this.$refs.reactButton, - post: this.p, + note: this.p, compact: true }); }, menu() { - (this as any).os.new(MkPostMenu, { + (this as any).os.new(MkNoteMenu, { source: this.$refs.menuButton, - post: this.p, + note: this.p, compact: true }); } @@ -225,7 +225,7 @@ export default Vue.extend({ diff --git a/src/client/app/mobile/views/components/post.sub.vue b/src/client/app/mobile/views/components/post.sub.vue deleted file mode 100644 index 909d5cb597..0000000000 --- a/src/client/app/mobile/views/components/post.sub.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - diff --git a/src/client/app/mobile/views/components/post.vue b/src/client/app/mobile/views/components/post.vue index eee1e80fd3..4b33c6f071 100644 --- a/src/client/app/mobile/views/components/post.vue +++ b/src/client/app/mobile/views/components/post.vue @@ -1,19 +1,19 @@ @@ -25,7 +25,7 @@ export default Vue.extend({ return { fetching: true, existMore: false, - posts: [], + notes: [], offset: 0 }; }, @@ -48,30 +48,30 @@ export default Vue.extend({ this.fetching = true; Progress.start(); - (this as any).api('posts/search', Object.assign({ + (this as any).api('notes/search', Object.assign({ limit: limit + 1 - }, parse(this.q))).then(posts => { - if (posts.length == limit + 1) { - posts.pop(); + }, parse(this.q))).then(notes => { + if (notes.length == limit + 1) { + notes.pop(); this.existMore = true; } - this.posts = posts; + this.notes = notes; this.fetching = false; Progress.done(); }); }, more() { this.offset += limit; - (this as any).api('posts/search', Object.assign({ + (this as any).api('notes/search', Object.assign({ limit: limit + 1, offset: this.offset - }, parse(this.q))).then(posts => { - if (posts.length == limit + 1) { - posts.pop(); + }, parse(this.q))).then(notes => { + if (notes.length == limit + 1) { + notes.pop(); } else { this.existMore = false; } - this.posts = this.posts.concat(posts); + this.notes = this.notes.concat(notes); }); } } @@ -79,7 +79,7 @@ export default Vue.extend({ diff --git a/src/client/app/mobile/views/pages/user/home.photos.vue b/src/client/app/mobile/views/pages/user/home.photos.vue index ecf5082072..1c59260812 100644 --- a/src/client/app/mobile/views/pages/user/home.photos.vue +++ b/src/client/app/mobile/views/pages/user/home.photos.vue @@ -5,7 +5,7 @@

%i18n:mobile.tags.mk-user-overview-photos.no-photos%

@@ -28,15 +28,15 @@ export default Vue.extend({ getAcct }, mounted() { - (this as any).api('users/posts', { + (this as any).api('users/notes', { userId: this.user.id, withMedia: true, limit: 6 - }).then(posts => { - posts.forEach(post => { - post.media.forEach(media => { + }).then(notes => { + notes.forEach(note => { + note.media.forEach(media => { if (this.images.length < 9) this.images.push({ - post, + note, media }); }); diff --git a/src/client/app/mobile/views/pages/user/home.posts.vue b/src/client/app/mobile/views/pages/user/home.posts.vue deleted file mode 100644 index 654f7f63e0..0000000000 --- a/src/client/app/mobile/views/pages/user/home.posts.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/app/mobile/views/pages/user/home.vue b/src/client/app/mobile/views/pages/user/home.vue index 1afcd1f5ba..2554084969 100644 --- a/src/client/app/mobile/views/pages/user/home.vue +++ b/src/client/app/mobile/views/pages/user/home.vue @@ -1,10 +1,10 @@