summaryrefslogtreecommitdiff
path: root/src/server/activitypub/outbox.ts
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2019-02-13 23:45:35 +0900
committerGitHub <noreply@github.com>2019-02-13 23:45:35 +0900
commit4b6c11325158b7c2410b4fd940b6bec986341588 (patch)
treebf843fe9af081329bc6cd83aed4c1e4682311d1c /src/server/activitypub/outbox.ts
parentFix tslint.json styles (#4219) (diff)
downloadmisskey-4b6c11325158b7c2410b4fd940b6bec986341588.tar.gz
misskey-4b6c11325158b7c2410b4fd940b6bec986341588.tar.bz2
misskey-4b6c11325158b7c2410b4fd940b6bec986341588.zip
Add prelude function for URL Query (#4135)
* Update string.ts * Refactor * Update string.ts * Update wrap-url.ts * Update string.ts * Update get-static-image-url.ts * Use querystring.stringify * Update outbox.ts * Back to the urlQuery * Update followers.ts * Update following.ts * Update outbox.ts * Update string.ts * Update get-static-image-url.ts * Update string.ts * Update string.ts * Separate prelude files
Diffstat (limited to 'src/server/activitypub/outbox.ts')
-rw-r--r--src/server/activitypub/outbox.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/server/activitypub/outbox.ts b/src/server/activitypub/outbox.ts
index 508e7e5ec9..8b65ce993a 100644
--- a/src/server/activitypub/outbox.ts
+++ b/src/server/activitypub/outbox.ts
@@ -14,6 +14,7 @@ import renderNote from '../../remote/activitypub/renderer/note';
import renderCreate from '../../remote/activitypub/renderer/create';
import renderAnnounce from '../../remote/activitypub/renderer/announce';
import { countIf } from '../../prelude/array';
+import * as url from '../../prelude/url';
export default async (ctx: Router.IRouterContext) => {
if (!ObjectID.isValid(ctx.params.user)) {
@@ -88,10 +89,20 @@ export default async (ctx: Router.IRouterContext) => {
const activities = await Promise.all(notes.map(note => packActivity(note)));
const rendered = renderOrderedCollectionPage(
- `${partOf}?page=true${sinceId ? `&since_id=${sinceId}` : ''}${untilId ? `&until_id=${untilId}` : ''}`,
+ `${partOf}?${url.query({
+ page: 'true',
+ since_id: sinceId,
+ until_id: untilId
+ })}`,
user.notesCount, activities, partOf,
- notes.length > 0 ? `${partOf}?page=true&since_id=${notes[0]._id}` : null,
- notes.length > 0 ? `${partOf}?page=true&until_id=${notes[notes.length - 1]._id}` : null
+ notes.length ? `${partOf}?${url.query({
+ page: 'true',
+ since_id: notes[0]._id.toHexString()
+ })}` : null,
+ notes.length ? `${partOf}?${url.query({
+ page: 'true',
+ until_id: notes[notes.length - 1]._id.toHexString()
+ })}` : null
);
ctx.body = renderActivity(rendered);