diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-11-12 15:11:20 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-11-12 15:11:20 +0900 |
| commit | 6496835515f12c8221e6e852edba1e0ba4fdf663 (patch) | |
| tree | 908c09bc02d21f33a6d908886ff48a04373e07f2 | |
| parent | refactor (diff) | |
| download | misskey-6496835515f12c8221e6e852edba1e0ba4fdf663.tar.gz misskey-6496835515f12c8221e6e852edba1e0ba4fdf663.tar.bz2 misskey-6496835515f12c8221e6e852edba1e0ba4fdf663.zip | |
viaMobileフラグ廃止
Close #7965
12 files changed, 13 insertions, 36 deletions
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 @@ -84,11 +84,6 @@ export class Note { @Column('boolean', { default: false }) - public viaMobile: boolean; - - @Column('boolean', { - default: false - }) public localOnly: boolean; @Column('smallint', { 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<Note> { 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<string, unknown renoteId: note.renoteId, poll: poll, cw: note.cw, - viaMobile: note.viaMobile, visibility: note.visibility, visibleUserIds: note.visibleUserIds, localOnly: note.localOnly, diff --git a/packages/backend/src/remote/activitypub/models/note.ts b/packages/backend/src/remote/activitypub/models/note.ts index 492dc05248..39efadc65b 100644 --- a/packages/backend/src/remote/activitypub/models/note.ts +++ b/packages/backend/src/remote/activitypub/models/note.ts @@ -250,7 +250,6 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s name: note.name, cw, text, - viaMobile: false, localOnly: false, visibility, visibleUsers, diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 751673f955..8257ea1d0f 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -57,11 +57,6 @@ export const meta = { validator: $.optional.nullable.str.pipe(Notes.validateCw), }, - viaMobile: { - validator: $.optional.bool, - default: false, - }, - localOnly: { validator: $.optional.bool, default: false, @@ -283,7 +278,6 @@ export default define(meta, async (ps, user) => { 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 @@ </div> <footer class="footer"> <div class="info"> - <span class="mobile" v-if="appearNote.viaMobile"><i class="fas fa-mobile-alt"></i></span> <MkTime class="created-at" :time="appearNote.createdAt" mode="detail"/> </div> <XReactionsViewer :note="appearNote" ref="reactionsViewer"/> diff --git a/packages/client/src/components/note-header.vue b/packages/client/src/components/note-header.vue index c61ec41dd1..c228869039 100644 --- a/packages/client/src/components/note-header.vue +++ b/packages/client/src/components/note-header.vue @@ -8,7 +8,6 @@ <div class="admin" v-if="note.user.isAdmin"><i class="fas fa-bookmark"></i></div> <div class="moderator" v-if="!note.user.isAdmin && note.user.isModerator"><i class="far fa-bookmark"></i></div> <div class="info"> - <span class="mobile" v-if="note.viaMobile"><i class="fas fa-mobile-alt"></i></span> <MkA class="created-at" :to="notePage(note)"> <MkTime :time="note.createdAt"/> </MkA> @@ -99,10 +98,6 @@ export default defineComponent({ margin-left: auto; font-size: 0.9em; - > .mobile { - margin-right: 8px; - } - > .visibility { margin-left: 8px; } diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue index ce6b7db3ee..6d3cae39b1 100644 --- a/packages/client/src/components/post-form.vue +++ b/packages/client/src/components/post-form.vue @@ -76,7 +76,6 @@ import { noteVisibilities } from 'misskey-js'; import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { defaultStore, notePostInterruptors, postFormActions } from '@/store'; -import { isMobile } from '@/scripts/is-mobile'; import { throttle } from 'throttle-debounce'; import MkInfo from '@/components/ui/info.vue'; import { defaultStore } from '@/store'; @@ -648,7 +647,6 @@ export default defineComponent({ localOnly: this.localOnly, visibility: this.visibility, visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined, - viaMobile: isMobile }; if (this.withHashtags && this.hashtags && this.hashtags.trim() !== '') { diff --git a/packages/client/src/ui/chat/note-header.vue b/packages/client/src/ui/chat/note-header.vue index 8ab03501b2..f0c9adee35 100644 --- a/packages/client/src/ui/chat/note-header.vue +++ b/packages/client/src/ui/chat/note-header.vue @@ -8,7 +8,6 @@ <span class="admin" v-if="note.user.isAdmin"><i class="fas fa-bookmark"></i></span> <span class="moderator" v-if="!note.user.isAdmin && note.user.isModerator"><i class="far fa-bookmark"></i></span> <div class="info"> - <span class="mobile" v-if="note.viaMobile"><i class="fas fa-mobile-alt"></i></span> <MkA class="created-at" :to="notePage(note)"> <MkTime :time="note.createdAt"/> </MkA> @@ -96,10 +95,6 @@ export default defineComponent({ font-size: 0.9em; opacity: 0.7; - > .mobile { - margin-right: 8px; - } - > .visibility { margin-left: 8px; } diff --git a/packages/client/src/ui/chat/post-form.vue b/packages/client/src/ui/chat/post-form.vue index 44461c4a58..9debee2603 100644 --- a/packages/client/src/ui/chat/post-form.vue +++ b/packages/client/src/ui/chat/post-form.vue @@ -61,7 +61,6 @@ import { Autocomplete } from '@/scripts/autocomplete'; import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; -import { isMobile } from '@/scripts/is-mobile'; import { throttle } from 'throttle-debounce'; export default defineComponent({ @@ -544,7 +543,6 @@ export default defineComponent({ localOnly: this.localOnly, visibility: this.visibility, visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined, - viaMobile: isMobile }; // plugin |