mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 14:03:10 +02:00
parent
b404ce463f
commit
6496835515
12 changed files with 13 additions and 36 deletions
|
@ -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`);
|
||||
}
|
||||
}
|
|
@ -81,11 +81,6 @@ export class Note {
|
|||
@JoinColumn()
|
||||
public user: User | null;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false
|
||||
})
|
||||
public viaMobile: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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() !== '') {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue