Skip to content

Commit

Permalink
feat: note update federation
Browse files Browse the repository at this point in the history
libnare#1

ellelle
  • Loading branch information
caipira113 authored and yunochi committed Sep 30, 2024
1 parent 33d47d6 commit e363d32
Show file tree
Hide file tree
Showing 37 changed files with 846 additions and 11 deletions.
2 changes: 2 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ fromX: "From {x}"
genEmbedCode: "Generate embed code"
noteOfThisUser: "Notes by this user"
clipNoteLimitExceeded: "No more notes can be added to this clip."
noteUpdatedAt: "Edited: {date} {time}"
_delivery:
status: "Delivery status"
stop: "Suspended"
Expand Down Expand Up @@ -1709,6 +1710,7 @@ _role:
gtlAvailable: "Can view the global timeline"
ltlAvailable: "Can view the local timeline"
canPublicNote: "Can send public notes"
canEditNote: "Note editing"
mentionMax: "Maximum number of mentions in a note"
canInvite: "Can create instance invite codes"
inviteLimit: "Invite limit"
Expand Down
8 changes: 8 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5148,6 +5148,10 @@ export interface Locale extends ILocale {
* パスキーの検証に成功しましたが、パスワードレスログインが無効になっています。
*/
"passkeyVerificationSucceededButPasswordlessLoginDisabled": string;
/**
* 編集済み: {date} {time}
*/
"noteUpdatedAt": ParameterizedString<"date" | "time">;
"_delivery": {
/**
* 配信状態
Expand Down Expand Up @@ -6726,6 +6730,10 @@ export interface Locale extends ILocale {
* パブリック投稿の許可
*/
"canPublicNote": string;
/**
* ノートの編集
*/
"canEditNote": string;
/**
* ノート内の最大メンション数
*/
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,7 @@ signinWithPasskey: "パスキーでログイン"
unknownWebAuthnKey: "登録されていないパスキーです。"
passkeyVerificationFailed: "パスキーの検証に失敗しました。"
passkeyVerificationSucceededButPasswordlessLoginDisabled: "パスキーの検証に成功しましたが、パスワードレスログインが無効になっています。"
noteUpdatedAt: "編集済み: {date} {time}"

_delivery:
status: "配信状態"
Expand Down Expand Up @@ -1738,6 +1739,7 @@ _role:
gtlAvailable: "グローバルタイムラインの閲覧"
ltlAvailable: "ローカルタイムラインの閲覧"
canPublicNote: "パブリック投稿の許可"
canEditNote: "ノートの編集"
mentionMax: "ノート内の最大メンション数"
canInvite: "サーバー招待コードの発行"
inviteLimit: "招待コードの作成可能数"
Expand Down
2 changes: 2 additions & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,7 @@ signinWithPasskey: "패스키로 로그인"
unknownWebAuthnKey: "등록되지 않은 패스키입니다."
passkeyVerificationFailed: "패스키 검증을 실패했습니다."
passkeyVerificationSucceededButPasswordlessLoginDisabled: "패스키를 검증했으나, 비밀번호 없이 로그인하기가 꺼져 있습니다."
noteUpdatedAt: "편집됨: {date} {time}"
_delivery:
status: "전송 상태"
stop: "정지됨"
Expand Down Expand Up @@ -1727,6 +1728,7 @@ _role:
gtlAvailable: "글로벌 타임라인 보이기"
ltlAvailable: "로컬 타임라인 보이기"
canPublicNote: "공개 노트 허용"
canEditNote: "노트 편집 허용"
mentionMax: "노트에 넣을 수 있는 멘션 수"
canInvite: "서버 초대 코드 발행"
inviteLimit: "초대 한도"
Expand Down
16 changes: 16 additions & 0 deletions packages/backend/migration/1724072711475-NoteEdit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/

export class NoteEdit1724072711475 {
name = 'NoteEdit1724072711475'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "note" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`);
}

async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "updatedAt"`);
}
}
6 changes: 6 additions & 0 deletions packages/backend/src/core/CoreModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { MetaService } from './MetaService.js';
import { MfmService } from './MfmService.js';
import { ModerationLogService } from './ModerationLogService.js';
import { NoteCreateService } from './NoteCreateService.js';
import { NoteUpdateService } from './NoteUpdateService.js';
import { NoteDeleteService } from './NoteDeleteService.js';
import { NotePiningService } from './NotePiningService.js';
import { NoteReadService } from './NoteReadService.js';
Expand Down Expand Up @@ -185,6 +186,7 @@ const $MetaService: Provider = { provide: 'MetaService', useExisting: MetaServic
const $MfmService: Provider = { provide: 'MfmService', useExisting: MfmService };
const $ModerationLogService: Provider = { provide: 'ModerationLogService', useExisting: ModerationLogService };
const $NoteCreateService: Provider = { provide: 'NoteCreateService', useExisting: NoteCreateService };
const $NoteUpdateService: Provider = { provide: 'NoteUpdateService', useExisting: NoteUpdateService };
const $NoteDeleteService: Provider = { provide: 'NoteDeleteService', useExisting: NoteDeleteService };
const $NotePiningService: Provider = { provide: 'NotePiningService', useExisting: NotePiningService };
const $NoteReadService: Provider = { provide: 'NoteReadService', useExisting: NoteReadService };
Expand Down Expand Up @@ -335,6 +337,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
MfmService,
ModerationLogService,
NoteCreateService,
NoteUpdateService,
NoteDeleteService,
NotePiningService,
NoteReadService,
Expand Down Expand Up @@ -481,6 +484,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
$MfmService,
$ModerationLogService,
$NoteCreateService,
$NoteUpdateService,
$NoteDeleteService,
$NotePiningService,
$NoteReadService,
Expand Down Expand Up @@ -628,6 +632,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
MfmService,
ModerationLogService,
NoteCreateService,
NoteUpdateService,
NoteDeleteService,
NotePiningService,
NoteReadService,
Expand Down Expand Up @@ -773,6 +778,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
$MfmService,
$ModerationLogService,
$NoteCreateService,
$NoteUpdateService,
$NoteDeleteService,
$NotePiningService,
$NoteReadService,
Expand Down
5 changes: 4 additions & 1 deletion packages/backend/src/core/GlobalEventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ export interface NoteEventTypes {
};
updated: {
cw: string | null;
text: string;
text: string | null;
files: Packed<'DriveFile'>[];
fileIds: string[];
poll: any | null;
};
reacted: {
reaction: string;
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/core/NoteCreateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ type MinimumUser = {

type Option = {
createdAt?: Date | null;
updatedAt?: Date | null;
name?: string | null;
text?: string | null;
reply?: MiNote | null;
Expand Down
Loading

0 comments on commit e363d32

Please sign in to comment.