mirror of
https://github.com/hotomoe/hotomoe
synced 2024-11-24 23:26:17 +09:00
parent
b404ce463f
commit
6496835515
@ -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()
|
@JoinColumn()
|
||||||
public user: User | null;
|
public user: User | null;
|
||||||
|
|
||||||
@Column('boolean', {
|
|
||||||
default: false
|
|
||||||
})
|
|
||||||
public viaMobile: boolean;
|
|
||||||
|
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: false
|
default: false
|
||||||
})
|
})
|
||||||
|
@ -230,7 +230,6 @@ export class NoteRepository extends Repository<Note> {
|
|||||||
visibility: note.visibility,
|
visibility: note.visibility,
|
||||||
localOnly: note.localOnly || undefined,
|
localOnly: note.localOnly || undefined,
|
||||||
visibleUserIds: note.visibility === 'specified' ? note.visibleUserIds : undefined,
|
visibleUserIds: note.visibility === 'specified' ? note.visibleUserIds : undefined,
|
||||||
viaMobile: note.viaMobile || undefined,
|
|
||||||
renoteCount: note.renoteCount,
|
renoteCount: note.renoteCount,
|
||||||
repliesCount: note.repliesCount,
|
repliesCount: note.repliesCount,
|
||||||
reactions: convertLegacyReactions(note.reactions),
|
reactions: convertLegacyReactions(note.reactions),
|
||||||
@ -377,10 +376,6 @@ export const packedNoteSchema = {
|
|||||||
optional: true as const, nullable: true as const,
|
optional: true as const, nullable: true as const,
|
||||||
ref: 'Note' as const,
|
ref: 'Note' as const,
|
||||||
},
|
},
|
||||||
viaMobile: {
|
|
||||||
type: 'boolean' as const,
|
|
||||||
optional: true as const, nullable: false as const,
|
|
||||||
},
|
|
||||||
isHidden: {
|
isHidden: {
|
||||||
type: 'boolean' as const,
|
type: 'boolean' as const,
|
||||||
optional: true as const, nullable: false 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,
|
renoteId: note.renoteId,
|
||||||
poll: poll,
|
poll: poll,
|
||||||
cw: note.cw,
|
cw: note.cw,
|
||||||
viaMobile: note.viaMobile,
|
|
||||||
visibility: note.visibility,
|
visibility: note.visibility,
|
||||||
visibleUserIds: note.visibleUserIds,
|
visibleUserIds: note.visibleUserIds,
|
||||||
localOnly: note.localOnly,
|
localOnly: note.localOnly,
|
||||||
|
@ -250,7 +250,6 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s
|
|||||||
name: note.name,
|
name: note.name,
|
||||||
cw,
|
cw,
|
||||||
text,
|
text,
|
||||||
viaMobile: false,
|
|
||||||
localOnly: false,
|
localOnly: false,
|
||||||
visibility,
|
visibility,
|
||||||
visibleUsers,
|
visibleUsers,
|
||||||
|
@ -57,11 +57,6 @@ export const meta = {
|
|||||||
validator: $.optional.nullable.str.pipe(Notes.validateCw),
|
validator: $.optional.nullable.str.pipe(Notes.validateCw),
|
||||||
},
|
},
|
||||||
|
|
||||||
viaMobile: {
|
|
||||||
validator: $.optional.bool,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
|
|
||||||
localOnly: {
|
localOnly: {
|
||||||
validator: $.optional.bool,
|
validator: $.optional.bool,
|
||||||
default: false,
|
default: false,
|
||||||
@ -283,7 +278,6 @@ export default define(meta, async (ps, user) => {
|
|||||||
reply,
|
reply,
|
||||||
renote,
|
renote,
|
||||||
cw: ps.cw,
|
cw: ps.cw,
|
||||||
viaMobile: ps.viaMobile,
|
|
||||||
localOnly: ps.localOnly,
|
localOnly: ps.localOnly,
|
||||||
visibility: ps.visibility,
|
visibility: ps.visibility,
|
||||||
visibleUsers,
|
visibleUsers,
|
||||||
|
@ -98,7 +98,6 @@ type Option = {
|
|||||||
renote?: Note | null;
|
renote?: Note | null;
|
||||||
files?: DriveFile[] | null;
|
files?: DriveFile[] | null;
|
||||||
poll?: IPoll | null;
|
poll?: IPoll | null;
|
||||||
viaMobile?: boolean | null;
|
|
||||||
localOnly?: boolean | null;
|
localOnly?: boolean | null;
|
||||||
cw?: string | null;
|
cw?: string | null;
|
||||||
visibility?: string;
|
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.createdAt == null) data.createdAt = new Date();
|
||||||
if (data.visibility == null) data.visibility = 'public';
|
if (data.visibility == null) data.visibility = 'public';
|
||||||
if (data.viaMobile == null) data.viaMobile = false;
|
|
||||||
if (data.localOnly == null) data.localOnly = false;
|
if (data.localOnly == null) data.localOnly = false;
|
||||||
if (data.channel != null) data.visibility = 'public';
|
if (data.channel != null) data.visibility = 'public';
|
||||||
if (data.channel != null) data.visibleUsers = [];
|
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)),
|
tags: tags.map(tag => normalizeForSearch(tag)),
|
||||||
emojis,
|
emojis,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
viaMobile: data.viaMobile!,
|
|
||||||
localOnly: data.localOnly!,
|
localOnly: data.localOnly!,
|
||||||
visibility: data.visibility as any,
|
visibility: data.visibility as any,
|
||||||
visibleUserIds: data.visibility == 'specified'
|
visibleUserIds: data.visibility == 'specified'
|
||||||
|
@ -86,7 +86,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="info">
|
<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"/>
|
<MkTime class="created-at" :time="appearNote.createdAt" mode="detail"/>
|
||||||
</div>
|
</div>
|
||||||
<XReactionsViewer :note="appearNote" ref="reactionsViewer"/>
|
<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="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="moderator" v-if="!note.user.isAdmin && note.user.isModerator"><i class="far fa-bookmark"></i></div>
|
||||||
<div class="info">
|
<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)">
|
<MkA class="created-at" :to="notePage(note)">
|
||||||
<MkTime :time="note.createdAt"/>
|
<MkTime :time="note.createdAt"/>
|
||||||
</MkA>
|
</MkA>
|
||||||
@ -99,10 +98,6 @@ export default defineComponent({
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
|
|
||||||
> .mobile {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .visibility {
|
> .visibility {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,6 @@ import { noteVisibilities } from 'misskey-js';
|
|||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { selectFile } from '@/scripts/select-file';
|
import { selectFile } from '@/scripts/select-file';
|
||||||
import { defaultStore, notePostInterruptors, postFormActions } from '@/store';
|
import { defaultStore, notePostInterruptors, postFormActions } from '@/store';
|
||||||
import { isMobile } from '@/scripts/is-mobile';
|
|
||||||
import { throttle } from 'throttle-debounce';
|
import { throttle } from 'throttle-debounce';
|
||||||
import MkInfo from '@/components/ui/info.vue';
|
import MkInfo from '@/components/ui/info.vue';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
@ -648,7 +647,6 @@ export default defineComponent({
|
|||||||
localOnly: this.localOnly,
|
localOnly: this.localOnly,
|
||||||
visibility: this.visibility,
|
visibility: this.visibility,
|
||||||
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
|
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
|
||||||
viaMobile: isMobile
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.withHashtags && this.hashtags && this.hashtags.trim() !== '') {
|
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="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>
|
<span class="moderator" v-if="!note.user.isAdmin && note.user.isModerator"><i class="far fa-bookmark"></i></span>
|
||||||
<div class="info">
|
<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)">
|
<MkA class="created-at" :to="notePage(note)">
|
||||||
<MkTime :time="note.createdAt"/>
|
<MkTime :time="note.createdAt"/>
|
||||||
</MkA>
|
</MkA>
|
||||||
@ -96,10 +95,6 @@ export default defineComponent({
|
|||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
|
|
||||||
> .mobile {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .visibility {
|
> .visibility {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ import { Autocomplete } from '@/scripts/autocomplete';
|
|||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { selectFile } from '@/scripts/select-file';
|
import { selectFile } from '@/scripts/select-file';
|
||||||
import { notePostInterruptors, postFormActions } from '@/store';
|
import { notePostInterruptors, postFormActions } from '@/store';
|
||||||
import { isMobile } from '@/scripts/is-mobile';
|
|
||||||
import { throttle } from 'throttle-debounce';
|
import { throttle } from 'throttle-debounce';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@ -544,7 +543,6 @@ export default defineComponent({
|
|||||||
localOnly: this.localOnly,
|
localOnly: this.localOnly,
|
||||||
visibility: this.visibility,
|
visibility: this.visibility,
|
||||||
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
|
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
|
||||||
viaMobile: isMobile
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// plugin
|
// plugin
|
||||||
|
Loading…
Reference in New Issue
Block a user