summaryrefslogtreecommitdiff
path: root/src/remote/activitypub
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-12-11 21:16:20 +0900
committerGitHub <noreply@github.com>2020-12-11 21:16:20 +0900
commit69c3c4e3dc71c722f9d85c4d2d6a112b6ce85296 (patch)
tree276f2dfa111772f8a2be5c5cabea2a4085d0c6a3 /src/remote/activitypub
parentMerge pull request #6960 from syuilo/dependabot/npm_and_yarn/ws-7.4.1 (diff)
downloadsharkey-69c3c4e3dc71c722f9d85c4d2d6a112b6ce85296.tar.gz
sharkey-69c3c4e3dc71c722f9d85c4d2d6a112b6ce85296.tar.bz2
sharkey-69c3c4e3dc71c722f9d85c4d2d6a112b6ce85296.zip
Resolve #6806 (#6935)
* :v: * :v: * Update privacy.vue
Diffstat (limited to 'src/remote/activitypub')
-rw-r--r--src/remote/activitypub/models/person.ts2
-rw-r--r--src/remote/activitypub/renderer/index.ts1
-rw-r--r--src/remote/activitypub/renderer/person.ts1
-rw-r--r--src/remote/activitypub/type.ts1
4 files changed, 5 insertions, 0 deletions
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts
index 9f6392174b..f0a312b21a 100644
--- a/src/remote/activitypub/models/person.ts
+++ b/src/remote/activitypub/models/person.ts
@@ -153,6 +153,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise<Us
lastFetchedAt: new Date(),
name: person.name,
isLocked: !!person.manuallyApprovesFollowers,
+ isExplorable: !!person.discoverable,
username: person.preferredUsername,
usernameLower: person.preferredUsername!.toLowerCase(),
host,
@@ -336,6 +337,7 @@ export async function updatePerson(uri: string, resolver?: Resolver | null, hint
isBot: object.type === 'Service',
isCat: (person as any).isCat === true,
isLocked: !!person.manuallyApprovesFollowers,
+ isExplorable: !!person.discoverable,
} as Partial<User>;
if (avatar) {
diff --git a/src/remote/activitypub/renderer/index.ts b/src/remote/activitypub/renderer/index.ts
index cf0fd8d85a..a34febff2f 100644
--- a/src/remote/activitypub/renderer/index.ts
+++ b/src/remote/activitypub/renderer/index.ts
@@ -38,6 +38,7 @@ export const attachLdSignature = async (activity: any, user: ILocalUser): Promis
toot: 'http://joinmastodon.org/ns#',
Emoji: 'toot:Emoji',
featured: 'toot:featured',
+ discoverable: 'toot:discoverable',
// schema
schema: 'http://schema.org#',
PropertyValue: 'schema:PropertyValue',
diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts
index 87dca19acd..4462f88315 100644
--- a/src/remote/activitypub/renderer/person.ts
+++ b/src/remote/activitypub/renderer/person.ts
@@ -70,6 +70,7 @@ export async function renderPerson(user: ILocalUser) {
image: banner ? renderImage(banner) : null,
tag,
manuallyApprovesFollowers: user.isLocked,
+ discoverable: !!user.isExplorable,
publicKey: renderKey(user, keypair, `#main-key`),
isCat: user.isCat,
attachment: attachment.length ? attachment : undefined
diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts
index 5c01c24b53..db866ae67a 100644
--- a/src/remote/activitypub/type.ts
+++ b/src/remote/activitypub/type.ts
@@ -135,6 +135,7 @@ export interface IPerson extends IObject {
name?: string;
preferredUsername?: string;
manuallyApprovesFollowers?: boolean;
+ discoverable?: boolean;
inbox?: string;
sharedInbox?: string; // 後方互換性のため
publicKey: {