Skip to content

Commit

Permalink
Showing 141 changed files with 1,119 additions and 266 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-cherrypick-js.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
- run: corepack enable

- name: Setup Node.js
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version-file: '.node-version'
cache: 'pnpm'
2 changes: 1 addition & 1 deletion .github/workflows/get-api-diff.yml
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
with:
version: 8
run_install: false
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
node-version-file: '.node-version'
cache: 'pnpm'
@@ -46,7 +46,7 @@ jobs:
with:
version: 7
run_install: false
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
node-version-file: '.node-version'
cache: 'pnpm'
@@ -72,7 +72,7 @@ jobs:
with:
version: 7
run_install: false
- uses: actions/[email protected].0
- uses: actions/[email protected].1
with:
node-version-file: '.node-version'
cache: 'pnpm'
4 changes: 2 additions & 2 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:

services:
postgres:
image: postgres:13
image: postgres:15
ports:
- 54312:5432
env:
@@ -38,7 +38,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
2 changes: 1 addition & 1 deletion .github/workflows/test-cherrypick-js.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ jobs:
- run: corepack enable

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
6 changes: 3 additions & 3 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
@@ -56,7 +56,7 @@ jobs:

services:
postgres:
image: postgres:13
image: postgres:15
ports:
- 54312:5432
env:
@@ -83,7 +83,7 @@ jobs:
version: 7
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
2 changes: 1 addition & 1 deletion .github/workflows/test-production.yml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

### Note
- Node.js 20.10.0が最小要件になりました
- 絵文字の追加辞書を既にインストールしている場合は、お手数ですが再インストールのほどお願いします
- 絵文字ピッカーにピン留め表示する絵文字設定が「リアクション用」と「絵文字入力用」に分かれました。以前の設定は「リアクション用」として使用されます。

**影響:**
@@ -31,9 +32,12 @@
- Feat: メールアドレスの認証にverifymail.ioを使えるように (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/971ba07a44550f68d2ba31c62066db2d43a0caed)
- Feat: モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能を追加 (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/e0eb5a752f6e5616d6312bb7c9790302f9dbff83)
- Feat: TL上からノートが見えなくなるワードミュートであるハードミュートを追加
- Enhance: 公開ロールにアサインされたときに通知が作成されるように
- Enhance: アイコンデコレーションを複数設定できるように
- Enhance: アイコンデコレーションの位置を微調整できるように
- Enhance: つながりの公開範囲をフォロー/フォロワーで個別に設定可能に #12072
- Enhance: ローカリゼーションの更新
- Enhance: 依存関係の更新
- Fix: MFM `$[unixtime ]` に不正な値を入力した際に発生する各種エラーを修正

### Client
@@ -79,6 +83,7 @@
- Fix: AiScriptの`readline`が不正な値を返すことがある問題を修正
- Fix: 投票のみ/画像のみの引用RNが、通知欄でただのRNとして判定されるバグを修正
- Fix: CWをつけて引用RNしても、普通のRNとして扱われてしまうバグを修正しました。
- Fix: 「画像が1枚のみのメディアリストの高さ」を「デフォルト」以外に設定していると、CWの中などに添付された画像が見られないバグを修正

### Server
- Enhance: MFM `$[ruby ]` が他ソフトウェアと連合されるように
@@ -97,6 +102,7 @@
- Fix: 「みつける」が年越し時に壊れる問題を修正
- Fix: アカウントをブロックした際に、自身のユーザーのページでノートが相手に表示される問題を修正
- Fix: モデレーションログがモデレーターは閲覧できないように修正
- Fix: ハッシュタグのトレンド除外設定が即時に効果を持つように修正
- Fix: HTTP Digestヘッダのアルゴリズム部分に大文字の"SHA-256"しか使えない
- Fix: 管理者用APIのアクセス権限が適切に設定されていない問題を修正

4 changes: 2 additions & 2 deletions chart/templates/Deployment.yml
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ spec:
ports:
- containerPort: 3000
- name: postgres
image: postgres:14-alpine
image: postgres:15-alpine
env:
- name: POSTGRES_USER
value: "example-cherrypick-user"
@@ -38,7 +38,7 @@ spec:
ports:
- containerPort: 5432
- name: redis
image: redis:alpine
image: redis:7-alpine
ports:
- containerPort: 6379
volumes:
1 change: 1 addition & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
@@ -2642,6 +2642,7 @@ export interface Locale {
"pollEnded": string;
"newNote": string;
"unreadAntennaNote": string;
"roleAssigned": string;
"emptyPushNotificationMessage": string;
"achievementEarned": string;
"testNotification": string;
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
@@ -2540,6 +2540,7 @@ _notification:
pollEnded: "アンケートの結果が出ました"
newNote: "新しい投稿"
unreadAntennaNote: "アンテナ {name}"
roleAssigned: "ロールが付与されました"
emptyPushNotificationMessage: "プッシュ通知の更新をしました"
achievementEarned: "実績を獲得"
testNotification: "通知テスト"
9 changes: 5 additions & 4 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
@@ -974,8 +974,8 @@ makeReactionsPublicDescription: "나의 리액션을 누구나 볼 수 있게
classic: "클래식"
muteThread: "이 글타래 뮤트"
unmuteThread: "글타래 뮤트 해제"
ffVisibility: "내 인맥의 공개 범위"
ffVisibilityDescription: "나의 팔로우와 팔로워 정보에 대한 공개 범위를 설정할 수 있어요."
followingVisibility: "팔로우의 공개 범위"
followersVisibility: "팔로워의 공개 범위"
continueThread: "이 글타래 이어서 보기"
deleteAccountConfirm: "계정이 삭제되고 되돌릴 수 없게 돼요. 그래도 계속할까요? "
incorrectPassword: "비밀번호가 다른 것 같아요!"
@@ -1281,7 +1281,8 @@ code: "코드"
reloadRequiredToApplySettings: "설정을 반영하려면 페이지를 다시 불러와야 해요."
remainingN: "남음: {n}"
overwriteContentConfirm: "현재 내용을 덮어쓰기 하게 돼요. 그래도 계속 진행할까요?"
seasonalScreenEffect: "계절 따른 화면 연출"
seasonalScreenEffect: "계절에 따른 화면 연출"
decorate: "장식하기"
showUnreadNotificationsCount: "읽지 않은 알림 수 표시"
showCatOnly: "고양이만 보기"
additionalPermissionsForFlash: "Play에 대한 추가 권한"
@@ -2134,7 +2135,7 @@ _sfx:
channel: "채널 알림"
reaction: "리액션 선택"
_soundSettings:
driveFile: "드라이브에 있는 오디오 사용"
driveFile: "드라이브에 있는 오디오 파일 사용"
driveFileWarn: "드라이브에 있는 파일을 선택해 주세요."
driveFileTypeWarn: "이 파일은 지원되지 않는 형식이에요."
driveFileTypeWarnDescription: "오디오 파일을 선택해 주세요."
2 changes: 1 addition & 1 deletion locales/zh-TW.yml
Original file line number Diff line number Diff line change
@@ -1231,7 +1231,7 @@ _initialTutorial:
skipAreYouSure: "結束教學模式?"
_landing:
title: "歡迎使用本教學課程"
description: "在這裡您可以查看CherryPick的基本使用方法和功能"
description: "在這裡您可以查看 CherryPick 的基本使用方法和功能"
_note:
title: "什麼是貼文?"
description: "在CherryPick上發布的內容稱為「貼文」。貼文在時間軸上按時間順序排列,並即時更新。"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cherrypick",
"version": "4.6.0-beta.5",
"basedMisskeyVersion": "2023.12.0-beta.5",
"basedMisskeyVersion": "2023.12.0-beta.6",
"codename": "nasubi",
"repository": {
"type": "git",
16 changes: 16 additions & 0 deletions packages/backend/src/core/FeaturedService.ts
Original file line number Diff line number Diff line change
@@ -77,6 +77,17 @@ export class FeaturedService {
return Array.from(ranking.keys());
}

@bindThis
private async removeFromRanking(name: string, windowRange: number, element: string): Promise<void> {
const currentWindow = this.getCurrentWindow(windowRange);
const previousWindow = currentWindow - 1;

const redisPipeline = this.redisClient.pipeline();
redisPipeline.zrem(`${name}:${currentWindow}`, element);
redisPipeline.zrem(`${name}:${previousWindow}`, element);
await redisPipeline.exec();
}

@bindThis
public updateGlobalNotesRanking(noteId: MiNote['id'], score = 1): Promise<void> {
return this.updateRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
@@ -126,4 +137,9 @@ export class FeaturedService {
public getHashtagsRanking(threshold: number): Promise<string[]> {
return this.getRankingOf('featuredHashtagsRanking', HASHTAG_RANKING_WINDOW, threshold);
}

@bindThis
public removeHashtagsFromRanking(hashtag: string): Promise<void> {
return this.removeFromRanking('featuredHashtagsRanking', HASHTAG_RANKING_WINDOW, hashtag);
}
}
25 changes: 22 additions & 3 deletions packages/backend/src/core/MetaService.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import { MiMeta } from '@/models/Meta.js';
import { GlobalEventService } from '@/core/GlobalEventService.js';
import { bindThis } from '@/decorators.js';
import type { GlobalEvents } from '@/core/GlobalEventService.js';
import { FeaturedService } from '@/core/FeaturedService.js';
import type { OnApplicationShutdown } from '@nestjs/common';

@Injectable()
@@ -25,6 +26,7 @@ export class MetaService implements OnApplicationShutdown {
@Inject(DI.db)
private db: DataSource,

private featuredService: FeaturedService,
private globalEventService: GlobalEventService,
) {
//this.onMessage = this.onMessage.bind(this);
@@ -95,17 +97,19 @@ export class MetaService implements OnApplicationShutdown {

@bindThis
public async update(data: Partial<MiMeta>): Promise<MiMeta> {
let before: MiMeta | undefined;

const updated = await this.db.transaction(async transactionalEntityManager => {
const metas = await transactionalEntityManager.find(MiMeta, {
order: {
id: 'DESC',
},
});

const meta = metas[0];
before = metas[0];

if (meta) {
await transactionalEntityManager.update(MiMeta, meta.id, data);
if (before) {
await transactionalEntityManager.update(MiMeta, before.id, data);

const metas = await transactionalEntityManager.find(MiMeta, {
order: {
@@ -119,6 +123,21 @@ export class MetaService implements OnApplicationShutdown {
}
});

if (data.hiddenTags) {
process.nextTick(() => {
const hiddenTags = new Set<string>(data.hiddenTags);
if (before) {
for (const previousHiddenTag of before.hiddenTags) {
hiddenTags.delete(previousHiddenTag);
}
}

for (const hiddenTag of hiddenTags) {
this.featuredService.removeHashtagsFromRanking(hiddenTag);
}
});
}

this.globalEventService.publishInternalEvent('metaUpdated', updated);

return updated;
29 changes: 25 additions & 4 deletions packages/backend/src/core/RoleService.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,14 @@
import { Inject, Injectable } from '@nestjs/common';
import * as Redis from 'ioredis';
import { In } from 'typeorm';
import type { MiRole, MiRoleAssignment, RoleAssignmentsRepository, RolesRepository, UsersRepository } from '@/models/_.js';
import { ModuleRef } from '@nestjs/core';
import type {
MiRole,
MiRoleAssignment,
RoleAssignmentsRepository,
RolesRepository,
UsersRepository,
} from '@/models/_.js';
import { MemoryKVCache, MemorySingleCache } from '@/misc/cache.js';
import type { MiUser } from '@/models/User.js';
import { DI } from '@/di-symbols.js';
@@ -16,12 +23,13 @@ import { CacheService } from '@/core/CacheService.js';
import type { RoleCondFormulaValue } from '@/models/Role.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import type { GlobalEvents } from '@/core/GlobalEventService.js';
import { IdService } from '@/core/IdService.js';
import { GlobalEventService } from '@/core/GlobalEventService.js';
import { IdService } from '@/core/IdService.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import type { Packed } from '@/misc/json-schema.js';
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
import type { OnApplicationShutdown } from '@nestjs/common';
import { NotificationService } from '@/core/NotificationService.js';
import type { OnApplicationShutdown, OnModuleInit } from '@nestjs/common';

export type RolePolicies = {
gtlAvailable: boolean;
@@ -80,14 +88,17 @@ export const DEFAULT_POLICIES: RolePolicies = {
};

@Injectable()
export class RoleService implements OnApplicationShutdown {
export class RoleService implements OnApplicationShutdown, OnModuleInit {
private rolesCache: MemorySingleCache<MiRole[]>;
private roleAssignmentByUserIdCache: MemoryKVCache<MiRoleAssignment[]>;
private notificationService: NotificationService;

public static AlreadyAssignedError = class extends Error {};
public static NotAssignedError = class extends Error {};

constructor(
private moduleRef: ModuleRef,

@Inject(DI.redis)
private redisClient: Redis.Redis,

@@ -122,6 +133,10 @@ export class RoleService implements OnApplicationShutdown {
this.redisForSub.on('message', this.onMessage);
}

async onModuleInit() {
this.notificationService = this.moduleRef.get(NotificationService.name);
}

@bindThis
private async onMessage(_: string, data: string): Promise<void> {
const obj = JSON.parse(data);
@@ -430,6 +445,12 @@ export class RoleService implements OnApplicationShutdown {

this.globalEventService.publishInternalEvent('userRoleAssigned', created);

if (role.isPublic) {
this.notificationService.createNotification(userId, 'roleAssigned', {
roleId: roleId,
});
}

if (moderator) {
const user = await this.usersRepository.findOneByOrFail({ id: userId });
this.moderationLogService.log(moderator, 'assignRole', {
Loading

0 comments on commit 0a3e741

Please sign in to comment.