viaMobileフラグ廃止

Close #7965
This commit is contained in:
syuilo
2021-11-12 15:11:20 +09:00
parent b404ce463f
commit 6496835515
12 changed files with 13 additions and 36 deletions

View File

@ -81,11 +81,6 @@ export class Note {
@JoinColumn()
public user: User | null;
@Column('boolean', {
default: false
})
public viaMobile: boolean;
@Column('boolean', {
default: false
})

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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'