Skip to content

Commit

Permalink
feat: note update federation (#1)
Browse files Browse the repository at this point in the history
ellelle
  • Loading branch information
caipira113 authored and HotoRas committed Sep 13, 2024
1 parent 3e19a7c commit 6d98408
Show file tree
Hide file tree
Showing 29 changed files with 517 additions and 461 deletions.
2 changes: 2 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,7 @@ confirmWhenRevealingSensitiveMedia: "Confirm when revealing sensitive media"
sensitiveMediaRevealConfirm: "This might be a sensitive media. Are you sure to reveal?"
createdLists: "Created lists"
createdAntennas: "Created antennas"
noteUpdatedAt: "Edited: {date} {time}"
_delivery:
status: "Delivery status"
stop: "Suspended"
Expand Down Expand Up @@ -1707,6 +1708,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 @@ -5072,6 +5072,10 @@ export interface Locale extends ILocale {
* 作成したアンテナ
*/
"createdAntennas": string;
/**
* 編集済み: {date} {time}
*/
"noteUpdatedAt": ParameterizedString<"date" | "time">;
"_delivery": {
/**
* 配信状態
Expand Down Expand Up @@ -6646,6 +6650,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 @@ -1264,6 +1264,7 @@ confirmWhenRevealingSensitiveMedia: "センシティブなメディアを表示
sensitiveMediaRevealConfirm: "センシティブなメディアです。表示しますか?"
createdLists: "作成したリスト"
createdAntennas: "作成したアンテナ"
noteUpdatedAt: "編集済み: {date} {time}"

_delivery:
status: "配信状態"
Expand Down Expand Up @@ -1718,6 +1719,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 @@ -1250,6 +1250,7 @@ alwaysConfirmFollow: "팔로우일 때 항상 확인하기"
inquiry: "문의하기"
tryAgain: "다시 시도해 주세요."
confirmWhenRevealingSensitiveMedia: "민감한 미디어를 열 때 두 번 확인"
noteUpdatedAt: "편집됨: {date} {time}"
_delivery:
status: "전송 상태"
stop: "정지됨"
Expand Down Expand Up @@ -1693,6 +1694,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"`);
}
}
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 @@ -128,6 +128,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 6d98408

Please sign in to comment.