diff --git a/src/api/endpoints.ts b/src/api/endpoints.ts index 37e3348b8..0ce51e9a5 100644 --- a/src/api/endpoints.ts +++ b/src/api/endpoints.ts @@ -81,6 +81,7 @@ export default [ { name: 'following/create', shouldBeSignin: true, limitDuration: hour, limitMax: 100, kind: 'following-write' }, { name: 'following/delete', shouldBeSignin: true, limitDuration: hour, limitMax: 100, kind: 'following-write' }, + { name: 'posts', shouldBeSignin: false }, { name: 'posts/show', shouldBeSignin: false }, { name: 'posts/replies', shouldBeSignin: false }, { name: 'posts/context', shouldBeSignin: false }, diff --git a/src/api/endpoints/posts.js b/src/api/endpoints/posts.js index 9bc25315a..59cfb8a44 100644 --- a/src/api/endpoints/posts.js +++ b/src/api/endpoints/posts.js @@ -15,6 +15,22 @@ import serialize from '../serializers/post'; module.exports = (params) => new Promise(async (res, rej) => { + // Get 'include_replies' parameter + let includeReplies = params.include_replies; + if (includeReplies === true) { + includeReplies = true; + } else { + includeReplies = false; + } + + // Get 'include_reposts' parameter + let includeReposts = params.include_reposts; + if (includeReposts === true) { + includeReposts = true; + } else { + includeReposts = false; + } + // Get 'limit' parameter let limit = params.limit; if (limit !== undefined && limit !== null) { @@ -52,6 +68,14 @@ module.exports = (params) => }; } + if (!includeReplies) { + query.reply_to_id = null; + } + + if (!includeReposts) { + query.repost_id = null; + } + // Issue query const posts = await Post .find(query, { diff --git a/src/web/app/common/tags/index.js b/src/web/app/common/tags/index.js index 90f03825e..58027d4e9 100644 --- a/src/web/app/common/tags/index.js +++ b/src/web/app/common/tags/index.js @@ -24,3 +24,4 @@ require('./messaging/message.tag'); require('./messaging/index.tag'); require('./messaging/form.tag'); require('./stream-indicator.tag'); +require('./public-timeline.tag'); diff --git a/src/web/app/common/tags/public-timeline.tag b/src/web/app/common/tags/public-timeline.tag new file mode 100644 index 000000000..1bc18e5a8 --- /dev/null +++ b/src/web/app/common/tags/public-timeline.tag @@ -0,0 +1,80 @@ + +
+ avatar +
+
+ { user.name } + @{ user.username } +
+
+
{ text }
+
+
+
+ + +
diff --git a/src/web/app/desktop/tags/pages/entrance.tag b/src/web/app/desktop/tags/pages/entrance.tag index 014637933..c6f0f5c90 100644 --- a/src/web/app/desktop/tags/pages/entrance.tag +++ b/src/web/app/desktop/tags/pages/entrance.tag @@ -1,5 +1,6 @@ -
Misskey +
+ Misskey
@@ -8,6 +9,10 @@
+
+

投稿を見てみよう

+ +
@@ -26,6 +31,7 @@ > main display block + padding-bottom 16px > img display block @@ -53,6 +59,21 @@ &:hover text-decoration underline + > .tl + padding 32px 0 + background #fff + + > h2 + display block + margin 0 + padding 0 + text-align center + font-size 20px + color #5b6b73 + + > mk-public-timeline + max-width 500px + margin 0 auto > footer > mk-copyright margin 0