From 6496835515f12c8221e6e852edba1e0ba4fdf663 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 12 Nov 2021 15:11:20 +0900 Subject: [PATCH] =?UTF-8?q?viaMobile=E3=83=95=E3=83=A9=E3=82=B0=E5=BB=83?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #7965 --- .../migration/1636697408073-remove-via-mobile.js | 13 +++++++++++++ packages/backend/src/models/entities/note.ts | 5 ----- packages/backend/src/models/repositories/note.ts | 5 ----- .../backend/src/queue/processors/db/export-notes.ts | 1 - .../backend/src/remote/activitypub/models/note.ts | 1 - .../src/server/api/endpoints/notes/create.ts | 6 ------ packages/backend/src/services/note/create.ts | 3 --- packages/client/src/components/note-detailed.vue | 1 - packages/client/src/components/note-header.vue | 5 ----- packages/client/src/components/post-form.vue | 2 -- packages/client/src/ui/chat/note-header.vue | 5 ----- packages/client/src/ui/chat/post-form.vue | 2 -- 12 files changed, 13 insertions(+), 36 deletions(-) create mode 100644 packages/backend/migration/1636697408073-remove-via-mobile.js diff --git a/packages/backend/migration/1636697408073-remove-via-mobile.js b/packages/backend/migration/1636697408073-remove-via-mobile.js new file mode 100644 index 0000000000..bb5157cf1d --- /dev/null +++ b/packages/backend/migration/1636697408073-remove-via-mobile.js @@ -0,0 +1,13 @@ +const { MigrationInterface, QueryRunner } = require("typeorm"); + +module.exports = class removeViaMobile1636697408073 { + name = 'removeViaMobile1636697408073' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "viaMobile"`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" ADD "viaMobile" boolean NOT NULL DEFAULT false`); + } +} diff --git a/packages/backend/src/models/entities/note.ts b/packages/backend/src/models/entities/note.ts index 4a5411f93d..9dee25ea2a 100644 --- a/packages/backend/src/models/entities/note.ts +++ b/packages/backend/src/models/entities/note.ts @@ -81,11 +81,6 @@ export class Note { @JoinColumn() public user: User | null; - @Column('boolean', { - default: false - }) - public viaMobile: boolean; - @Column('boolean', { default: false }) diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 0f00c34c9c..c076cb31e8 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -230,7 +230,6 @@ export class NoteRepository extends Repository { visibility: note.visibility, localOnly: note.localOnly || undefined, visibleUserIds: note.visibility === 'specified' ? note.visibleUserIds : undefined, - viaMobile: note.viaMobile || undefined, renoteCount: note.renoteCount, repliesCount: note.repliesCount, reactions: convertLegacyReactions(note.reactions), @@ -377,10 +376,6 @@ export const packedNoteSchema = { optional: true as const, nullable: true as const, ref: 'Note' as const, }, - viaMobile: { - type: 'boolean' as const, - optional: true as const, nullable: false as const, - }, isHidden: { type: 'boolean' as const, optional: true as const, nullable: false as const, diff --git a/packages/backend/src/queue/processors/db/export-notes.ts b/packages/backend/src/queue/processors/db/export-notes.ts index bd178556df..761f4d827b 100644 --- a/packages/backend/src/queue/processors/db/export-notes.ts +++ b/packages/backend/src/queue/processors/db/export-notes.ts @@ -125,7 +125,6 @@ function serialize(note: Note, poll: Poll | null = null): Record { reply, renote, cw: ps.cw, - viaMobile: ps.viaMobile, localOnly: ps.localOnly, visibility: ps.visibility, visibleUsers, diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 69d854ab1a..8f6c2fe3a5 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -98,7 +98,6 @@ type Option = { renote?: Note | null; files?: DriveFile[] | null; poll?: IPoll | null; - viaMobile?: boolean | null; localOnly?: boolean | null; cw?: string | null; visibility?: string; @@ -131,7 +130,6 @@ export default async (user: { id: User['id']; username: User['username']; host: if (data.createdAt == null) data.createdAt = new Date(); if (data.visibility == null) data.visibility = 'public'; - if (data.viaMobile == null) data.viaMobile = false; if (data.localOnly == null) data.localOnly = false; if (data.channel != null) data.visibility = 'public'; if (data.channel != null) data.visibleUsers = []; @@ -478,7 +476,6 @@ async function insertNote(user: { id: User['id']; host: User['host']; }, data: O tags: tags.map(tag => normalizeForSearch(tag)), emojis, userId: user.id, - viaMobile: data.viaMobile!, localOnly: data.localOnly!, visibility: data.visibility as any, visibleUserIds: data.visibility == 'specified' diff --git a/packages/client/src/components/note-detailed.vue b/packages/client/src/components/note-detailed.vue index 8b6905a0e4..7550153521 100644 --- a/packages/client/src/components/note-detailed.vue +++ b/packages/client/src/components/note-detailed.vue @@ -86,7 +86,6 @@