add "nobody" follower visibility
Adds a new follower/following visibility that hides followers even from yourself. Changelog: Added
This commit is contained in:
parent
ef4055840b
commit
fe65cba9be
|
@ -843,6 +843,7 @@ _ffVisibility:
|
||||||
public: "Public"
|
public: "Public"
|
||||||
followers: "Visible to followers only"
|
followers: "Visible to followers only"
|
||||||
private: "Private"
|
private: "Private"
|
||||||
|
nobody: "Nobody (not even you)"
|
||||||
_signup:
|
_signup:
|
||||||
almostThere: "Almost there"
|
almostThere: "Almost there"
|
||||||
emailAddressInfo: "Please enter your email address. It will not be made public."
|
emailAddressInfo: "Please enter your email address. It will not be made public."
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
export class ffVisibilityNobody1684536337602 {
|
||||||
|
name = 'ffVisibilityNobody1684536337602';
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`ALTER TYPE "public"."user_profile_ffvisibility_enum" RENAME TO "user_profile_ffvisibility_enum_old"`);
|
||||||
|
await queryRunner.query(`CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private', 'nobody')`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" DROP DEFAULT`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" TYPE "public"."user_profile_ffvisibility_enum" USING "ffVisibility"::"text"::"public"."user_profile_ffvisibility_enum"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" SET DEFAULT 'public'`);
|
||||||
|
await queryRunner.query(`DROP TYPE "public"."user_profile_ffvisibility_enum_old"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`CREATE TYPE "public"."user_profile_ffvisibility_enum_old" AS ENUM('public', 'followers', 'private')`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" DROP DEFAULT`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" TYPE "public"."user_profile_ffvisibility_enum_old" USING "ffVisibility"::"text"::"public"."user_profile_ffvisibility_enum_old"`);
|
||||||
|
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "ffVisibility" SET DEFAULT 'public'`);
|
||||||
|
await queryRunner.query(`DROP TYPE "public"."user_profile_ffvisibility_enum"`);
|
||||||
|
await queryRunner.query(`ALTER TYPE "public"."user_profile_ffvisibility_enum_old" RENAME TO "user_profile_ffvisibility_enum"`);
|
||||||
|
}
|
||||||
|
}
|
|
@ -255,6 +255,8 @@ export const UserRepository = db.getRepository(User).extend({
|
||||||
}
|
}
|
||||||
case 'private':
|
case 'private':
|
||||||
return me?.id === user.id;
|
return me?.id === user.id;
|
||||||
|
case 'nobody':
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<option value="public">{{ i18n.ts._ffVisibility.public }}</option>
|
<option value="public">{{ i18n.ts._ffVisibility.public }}</option>
|
||||||
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
|
<option value="followers">{{ i18n.ts._ffVisibility.followers }}</option>
|
||||||
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
|
<option value="private">{{ i18n.ts._ffVisibility.private }}</option>
|
||||||
|
<option vlaue="nobody">{{ i18n.ts._ffVisibility.nobody }}</option>
|
||||||
<template #caption>{{ i18n.ts.ffVisibilityDescription }}</template>
|
<template #caption>{{ i18n.ts.ffVisibilityDescription }}</template>
|
||||||
</FormSelect>
|
</FormSelect>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ export const noteNotificationTypes = ['mention', 'reply', 'renote', 'quote', 're
|
||||||
|
|
||||||
export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const;
|
export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const;
|
||||||
|
|
||||||
export const ffVisibility = ['public', 'followers', 'private'] as const;
|
export const ffVisibility = ['public', 'followers', 'private', 'nobody'] as const;
|
||||||
|
|
||||||
export const permissions = [
|
export const permissions = [
|
||||||
'read:account',
|
'read:account',
|
||||||
|
|
|
@ -38,7 +38,7 @@ export type UserDetailed = UserLite & {
|
||||||
birthday: string | null;
|
birthday: string | null;
|
||||||
createdAt: DateString;
|
createdAt: DateString;
|
||||||
description: string | null;
|
description: string | null;
|
||||||
ffVisibility: 'public' | 'followers' | 'private';
|
ffVisibility: 'public' | 'followers' | 'private' | 'nobody';
|
||||||
fields: {name: string; value: string}[];
|
fields: {name: string; value: string}[];
|
||||||
followersCount: number;
|
followersCount: number;
|
||||||
followingCount: number;
|
followingCount: number;
|
||||||
|
|
Loading…
Reference in a new issue