Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…oftware/TransFem-org/Sharkey/-/issues/154), [transfem-org/Sharkey@2f99c7e9](https://activitypub.software/TransFem-org/Sharkey/-/commit/2f99c7e9dc2e5e3ca06c9672a6ab4887eb094310))

  - 관리자가 설정한 서버의 게시글만 볼 수 있는 타임라인으로, 글로벌 타임라인의 무분별한 내용을 포함하는 게시글을 제한하는 목적으로 사용할 수 있습니다.
  • Loading branch information
noridev committed Nov 21, 2024
1 parent eaaa470 commit 91c07eb
Show file tree
Hide file tree
Showing 32 changed files with 541 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2024xx](CHANGE
기반 Misskey 버전: 2024.x.x<br>
Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2024xx](CHANGELOG.md#2024xx) 문서를 참고하십시오.

### General
- Feat: 버블 타임라인 (kokonect-link/cherrypick#512, [TransFem-org/Sharkey#154](https://activitypub.software/TransFem-org/Sharkey/-/issues/154), [TransFem-org/Sharkey@2f99c7e9](https://activitypub.software/TransFem-org/Sharkey/-/commit/2f99c7e9dc2e5e3ca06c9672a6ab4887eb094310))
- 관리자가 설정한 서버의 게시글만 볼 수 있는 타임라인으로, 글로벌 타임라인의 무분별한 내용을 포함하는 게시글을 제한하는 목적으로 사용할 수 있습니다.

### Client
- Enhance: 미디어 그리드 레이아옷 조정
- 여러 장의 이미지가 있을 때 표시되는 아이콘을 보다 명확하게 볼 수 있도록 개선됨
Expand Down
6 changes: 6 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
_lang_: "English"
bubbleTimeline: "Bubble Timeline"
bubbleTimelineDescription: "After enabling this option navigate to the Moderation section to configure which servers should be shown."
bubbleInstancesDescription: "Set the host names of servers to be displayed in the bubble timeline, separated by line breaks."
selectReaction: "Select reactions to use with the Like button"
disableRegistrationWhenInactive: "Disable new user registration when moderator is inactivated"
disablePublicNoteWhenInactive: "Disable 'Can send public notes' when moderator is inactivated"
Expand Down Expand Up @@ -1667,6 +1670,7 @@ _timelineDescription:
local: "In the Local timeline, you can see notes from all users on this server."
social: "The Social timeline displays notes from both the Home and Local timelines."
global: "In the Global timeline, you can see notes from all connected servers."
bubble: "In the Bubble timeline, you can see notes from servers set up by the administrator."
_serverRules:
description: "A set of rules to be displayed before registration. Setting a summary of the Terms of Service is recommended."
_event:
Expand Down Expand Up @@ -2020,6 +2024,7 @@ _role:
_options:
gtlAvailable: "Can view the global timeline"
ltlAvailable: "Can view the local timeline"
btlAvailable: "Can view the bubble timeline"
canPublicNote: "Can send public notes"
canEditNote: "Note editing"
scheduleNoteMax: "Maximum number of scheduled notes"
Expand Down Expand Up @@ -2695,6 +2700,7 @@ _timelines:
local: "Local"
social: "Social"
global: "Global"
bubble: "Bubble"
_play:
new: "Create Play"
edit: "Edit Play"
Expand Down
24 changes: 24 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ export interface Locale extends ILocale {
* 日本語
*/
"_lang_": string;
/**
* バブルタイムライン
*/
"bubbleTimeline": string;
/**
* このオプションを有効にし、モデレーションに移動して、表示するサーバを設定します。
*/
"bubbleTimelineDescription": string;
/**
* バブルタイムラインに表示するサーバのホスト名を改行で区切って設定します。
*/
"bubbleInstancesDescription": string;
/**
* いいねボタンで使うリアクションを選択
*/
Expand Down Expand Up @@ -6639,6 +6651,10 @@ export interface Locale extends ILocale {
* グローバルタイムラインでは、接続している他のすべてのサーバーからの投稿を見られます。
*/
"global": string;
/**
* バブルタイムラインでは、管理者が設定したサーバーの投稿を見ることができます。
*/
"bubble": string;
};
"_serverRules": {
/**
Expand Down Expand Up @@ -7898,6 +7914,10 @@ export interface Locale extends ILocale {
* ローカルタイムラインの閲覧
*/
"ltlAvailable": string;
/**
* バブルタイムラインの閲覧
*/
"btlAvailable": string;
/**
* パブリック投稿の許可
*/
Expand Down Expand Up @@ -10503,6 +10523,10 @@ export interface Locale extends ILocale {
* グローバル
*/
"global": string;
/**
* バブル
*/
"bubble": string;
};
"_play": {
/**
Expand Down
6 changes: 6 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
_lang_: "日本語"

bubbleTimeline: "バブルタイムライン"
bubbleTimelineDescription: "このオプションを有効にし、モデレーションに移動して、表示するサーバを設定します。"
bubbleInstancesDescription: "バブルタイムラインに表示するサーバのホスト名を改行で区切って設定します。"
selectReaction: "いいねボタンで使うリアクションを選択"
disableRegistrationWhenInactive: "モデレーターが一定期間非アクティブになったとき、新規登録を無効化"
disablePublicNoteWhenInactive: "モデレーターが一定期間非アクティブになったとき、「パブリック投稿の許可」を無効化"
Expand Down Expand Up @@ -1684,6 +1687,7 @@ _timelineDescription:
local: "ローカルタイムラインでは、このサーバーにいるユーザー全員の投稿を見られます。"
social: "ソーシャルタイムラインには、ホームタイムラインとローカルタイムラインの投稿が両方表示されます。"
global: "グローバルタイムラインでは、接続している他のすべてのサーバーからの投稿を見られます。"
bubble: "バブルタイムラインでは、管理者が設定したサーバーの投稿を見ることができます。"

_serverRules:
description: "新規登録前に表示する、サーバーの簡潔なルールを設定します。内容は利用規約の要約とすることを推奨します。"
Expand Down Expand Up @@ -2045,6 +2049,7 @@ _role:
_options:
gtlAvailable: "グローバルタイムラインの閲覧"
ltlAvailable: "ローカルタイムラインの閲覧"
btlAvailable: "バブルタイムラインの閲覧"
canPublicNote: "パブリック投稿の許可"
canEditNote: "ノートの編集"
scheduleNoteMax: "予約投稿の最大数"
Expand Down Expand Up @@ -2764,6 +2769,7 @@ _timelines:
local: "ローカル"
social: "ソーシャル"
global: "グローバル"
bubble: "バブル"

_play:
new: "Playの作成"
Expand Down
6 changes: 6 additions & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
_lang_: "한국어"
bubbleTimeline: "버블 타임라인"
bubbleTimelineDescription: "이 옵션을 활성화하고 모더레이션으로 이동해 버블 타임라인에 표시할 서버를 구성해 주세요."
bubbleInstancesDescription: "버블 타임라인에 표시할 인스턴스의 호스트 이름을 줄바꿈으로 구분하여 설정해요."
selectReaction: "'좋아요!' 버튼으로 사용할 리액션 선택"
disableRegistrationWhenInactive: "모더레이터 부재 시 신규 회원가입 비활성화"
disablePublicNoteWhenInactive: "모더레이터 부재 시 '공개 노트 허용' 비활성화"
Expand Down Expand Up @@ -1668,6 +1671,7 @@ _timelineDescription:
local: "로컬 타임라인에서는, 이 서버의 모든 사용자의 게시물을 볼 수 있어요."
social: "소셜 타임라인에서는, 홈 타임라인과 로컬 타임라인의 게시물을 모두 볼 수 있어요."
global: "글로벌 타임라인에서는, 여기와 연결된 다른 모든 서버의 게시물을 볼 수 있어요."
bubble: "버블 타임라인에서는, 관리자가 설정한 서버의 게시물을 볼 수 있어요."
_serverRules:
description: "회원 가입 이전에 간단하게 표시할 서버 규칙이에요. 이용 약관의 요약으로 구성하는 것을 추천해요."
_event:
Expand Down Expand Up @@ -2023,6 +2027,7 @@ _role:
_options:
gtlAvailable: "글로벌 타임라인 보이기"
ltlAvailable: "로컬 타임라인 보이기"
btlAvailable: "버블 타임라인 보이기"
canPublicNote: "공개 노트 허용"
canEditNote: "노트 편집 허용"
scheduleNoteMax: "게시를 예약한 노트의 최대 수"
Expand Down Expand Up @@ -2698,6 +2703,7 @@ _timelines:
local: "로컬"
social: "소셜"
global: "글로벌"
bubble: "버블"
_play:
new: "Play 만들기"
edit: "Play 편집하기"
Expand Down
16 changes: 16 additions & 0 deletions packages/backend/migration/1701647674000-BubbleInstances.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: marie and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class BubbleInstances1701647674000 {
name = 'BubbleInstances1701647674000'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "bubbleInstances" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "bubbleInstances"`);
}
}
3 changes: 3 additions & 0 deletions packages/backend/src/core/RoleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type { OnApplicationShutdown, OnModuleInit } from '@nestjs/common';
export type RolePolicies = {
gtlAvailable: boolean;
ltlAvailable: boolean;
btlAvailable: boolean;
canPublicNote: boolean;
canEditNote: boolean;
scheduleNoteMax: number;
Expand Down Expand Up @@ -71,6 +72,7 @@ export type RolePolicies = {
export const DEFAULT_POLICIES: RolePolicies = {
gtlAvailable: true,
ltlAvailable: true,
btlAvailable: false,
canPublicNote: true,
canEditNote: true,
scheduleNoteMax: 5,
Expand Down Expand Up @@ -381,6 +383,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
return {
gtlAvailable: calc('gtlAvailable', vs => vs.some(v => v === true)),
ltlAvailable: calc('ltlAvailable', vs => vs.some(v => v === true)),
btlAvailable: calc('btlAvailable', vs => vs.some(v => v === true)),
canPublicNote: calc('canPublicNote', vs => vs.some(v => v === true)),
canEditNote: calc('canEditNote', vs => vs.some(v => v === true)),
scheduleNoteMax: calc('scheduleNoteMax', vs => Math.max(...vs)),
Expand Down
7 changes: 7 additions & 0 deletions packages/backend/src/models/Meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,4 +823,11 @@ export class MiMeta {
default: false,
})
public disablePublicNoteWhenInactive: boolean;

@Column('varchar', {
length: 256,
array: true,
default: '{}',
})
public bubbleInstances: string[];
}
1 change: 1 addition & 0 deletions packages/backend/src/server/NodeinfoServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class NodeinfoServerService {
disableRegistration: meta.disableRegistration,
disableLocalTimeline: !basePolicies.ltlAvailable,
disableGlobalTimeline: !basePolicies.gtlAvailable,
disableBubbleTimeline: !basePolicies.btlAvailable,
emailRequiredForSignup: meta.emailRequiredForSignup,
enableHcaptcha: meta.enableHcaptcha,
enableRecaptcha: meta.enableRecaptcha,
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/server/ServerModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { RoleTimelineChannelService } from './api/stream/channels/role-timeline.
import { ReversiChannelService } from './api/stream/channels/reversi.js';
import { ReversiGameChannelService } from './api/stream/channels/reversi-game.js';
import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.js';
import { BubbleTimelineChannelService } from './api/stream/channels/bubble-timeline.js';

@Module({
imports: [
Expand Down Expand Up @@ -98,6 +99,7 @@ import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.j
UserListChannelService,
OpenApiServerService,
OAuth2ProviderService,
BubbleTimelineChannelService,
],
exports: [
ServerService,
Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/server/api/EndpointsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ import * as ep___notes_update from './endpoints/notes/update.js';
import * as ep___notes_favorites_create from './endpoints/notes/favorites/create.js';
import * as ep___notes_favorites_delete from './endpoints/notes/favorites/delete.js';
import * as ep___notes_featured from './endpoints/notes/featured.js';
import * as ep___notes_bubbleTimeline from './endpoints/notes/bubble-timeline.js';
import * as ep___notes_globalTimeline from './endpoints/notes/global-timeline.js';
import * as ep___notes_hybridTimeline from './endpoints/notes/hybrid-timeline.js';
import * as ep___notes_localTimeline from './endpoints/notes/local-timeline.js';
Expand Down Expand Up @@ -726,6 +727,7 @@ const $notes_update: Provider = { provide: 'ep:notes/update', useClass: ep___not
const $notes_favorites_create: Provider = { provide: 'ep:notes/favorites/create', useClass: ep___notes_favorites_create.default };
const $notes_favorites_delete: Provider = { provide: 'ep:notes/favorites/delete', useClass: ep___notes_favorites_delete.default };
const $notes_featured: Provider = { provide: 'ep:notes/featured', useClass: ep___notes_featured.default };
const $notes_bubbleTimeline: Provider = { provide: 'ep:notes/bubble-timeline', useClass: ep___notes_bubbleTimeline.default };
const $notes_globalTimeline: Provider = { provide: 'ep:notes/global-timeline', useClass: ep___notes_globalTimeline.default };
const $notes_hybridTimeline: Provider = { provide: 'ep:notes/hybrid-timeline', useClass: ep___notes_hybridTimeline.default };
const $notes_localTimeline: Provider = { provide: 'ep:notes/local-timeline', useClass: ep___notes_localTimeline.default };
Expand Down Expand Up @@ -1154,6 +1156,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
$notes_favorites_create,
$notes_favorites_delete,
$notes_featured,
$notes_bubbleTimeline,
$notes_globalTimeline,
$notes_hybridTimeline,
$notes_localTimeline,
Expand Down Expand Up @@ -1573,6 +1576,7 @@ const $reversi_verify: Provider = { provide: 'ep:reversi/verify', useClass: ep__
$notes_favorites_create,
$notes_favorites_delete,
$notes_featured,
$notes_bubbleTimeline,
$notes_globalTimeline,
$notes_hybridTimeline,
$notes_localTimeline,
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/src/server/api/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ import * as ep___notes_update from './endpoints/notes/update.js';
import * as ep___notes_favorites_create from './endpoints/notes/favorites/create.js';
import * as ep___notes_favorites_delete from './endpoints/notes/favorites/delete.js';
import * as ep___notes_featured from './endpoints/notes/featured.js';
import * as ep___notes_bubbleTimeline from './endpoints/notes/bubble-timeline.js';
import * as ep___notes_globalTimeline from './endpoints/notes/global-timeline.js';
import * as ep___notes_hybridTimeline from './endpoints/notes/hybrid-timeline.js';
import * as ep___notes_localTimeline from './endpoints/notes/local-timeline.js';
Expand Down Expand Up @@ -729,6 +730,7 @@ const eps = [
['notes/favorites/create', ep___notes_favorites_create],
['notes/favorites/delete', ep___notes_favorites_delete],
['notes/featured', ep___notes_featured],
['notes/bubble-timeline', ep___notes_bubbleTimeline],
['notes/global-timeline', ep___notes_globalTimeline],
['notes/hybrid-timeline', ep___notes_hybridTimeline],
['notes/local-timeline', ep___notes_localTimeline],
Expand Down
8 changes: 8 additions & 0 deletions packages/backend/src/server/api/endpoints/admin/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,13 @@ export const meta = {
type: 'boolean',
optional: false, nullable: false,
},
bubbleInstances: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
},
},
},
},
} as const;
Expand Down Expand Up @@ -798,6 +805,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
customSplashText: instance.customSplashText,
disableRegistrationWhenInactive: instance.disableRegistrationWhenInactive,
disablePublicNoteWhenInactive: instance.disablePublicNoteWhenInactive,
bubbleInstances: instance.bubbleInstances,
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export const paramDef = {
},
disableRegistrationWhenInactive: { type: 'boolean', nullable: true },
disablePublicNoteWhenInactive: { type: 'boolean', nullable: true },
bubbleInstances: { type: 'array', items: { type: 'string' } },
},
required: [],
} as const;
Expand Down Expand Up @@ -833,6 +834,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.disablePublicNoteWhenInactive = ps.disablePublicNoteWhenInactive;
}

if (ps.bubbleInstances !== undefined) {
set.bubbleInstances = ps.bubbleInstances;
}

const before = await this.metaService.fetch(true);

await this.metaService.update(set);
Expand Down
Loading

0 comments on commit 91c07eb

Please sign in to comment.