Compare commits

..

No commits in common. "a773fbfd40af63f4d8094e64cd234b5edfe0ea36" and "b63cdc2c5cfff921cc6ba51b5fd7f9b343018f39" have entirely different histories.

8 changed files with 66 additions and 74 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "12.110.1+birb3-2", "version": "12.110.1+birb3",
"codename": "indigo", "codename": "indigo",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,11 +0,0 @@
export class largeFile1653167275806 {
name = 'largeFile1653167275806'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN size TYPE bigint`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "drive_file" ALTER COLUMN size TYPE integer`);
}
}

View File

@ -56,7 +56,7 @@ export class DriveFile {
}) })
public type: string; public type: string;
@Column('bigint', { @Column('integer', {
comment: 'The file size (bytes) of the DriveFile.', comment: 'The file size (bytes) of the DriveFile.',
}) })
public size: number; public size: number;

View File

@ -60,25 +60,19 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
let to: string[] = []; let to: string[] = [];
let cc: string[] = []; let cc: string[] = [];
if (note.channelId) { if (note.visibility === 'public') {
to = [{ type: 'Group', name: note.channelId }]; to = ['https://www.w3.org/ns/activitystreams#Public'];
cc = [`${attributedTo}/followers`, 'https://www.w3.org/ns/activitystreams#Public'].concat(mentions); cc = [`${attributedTo}/followers`].concat(mentions);
} else if (note.visibility === 'home') {
to = [`${attributedTo}/followers`];
cc = ['https://www.w3.org/ns/activitystreams#Public'].concat(mentions);
} else if (note.visibility === 'followers') {
to = [`${attributedTo}/followers`];
cc = mentions;
} else { } else {
if (note.visibility === 'public') { to = mentions;
to = ['https://www.w3.org/ns/activitystreams#Public'];
cc = [`${attributedTo}/followers`].concat(mentions);
} else if (note.visibility === 'home') {
to = [`${attributedTo}/followers`];
cc = ['https://www.w3.org/ns/activitystreams#Public'].concat(mentions);
} else if (note.visibility === 'followers') {
to = [`${attributedTo}/followers`];
cc = mentions;
} else {
to = mentions;
}
} }
const mentionedUsers = note.mentions.length > 0 ? await Users.findBy({ const mentionedUsers = note.mentions.length > 0 ? await Users.findBy({
id: In(note.mentions), id: In(note.mentions),
}) : []; }) : [];

View File

@ -148,9 +148,10 @@ export default async (user: { id: User['id']; username: User['username']; host:
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 = [];
if (data.channel != null) data.localOnly = true;
// サイレンス // サイレンス
if (user.isSilenced && data.visibility === 'public') { if (user.isSilenced && data.visibility === 'public' && data.channel == null) {
data.visibility = 'home'; data.visibility = 'home';
} }
@ -175,12 +176,12 @@ export default async (user: { id: User['id']; username: User['username']; host:
} }
// ローカルのみをRenoteしたらローカルのみにする // ローカルのみをRenoteしたらローカルのみにする
if (data.renote && data.renote.localOnly) { if (data.renote && data.renote.localOnly && data.channel == null) {
data.localOnly = true; data.localOnly = true;
} }
// ローカルのみにリプライしたらローカルのみにする // ローカルのみにリプライしたらローカルのみにする
if (data.reply && data.reply.localOnly) { if (data.reply && data.reply.localOnly && data.channel == null) {
data.localOnly = true; data.localOnly = true;
} }

View File

@ -255,6 +255,7 @@ if (props.reply && props.reply.text != null) {
if (props.channel) { if (props.channel) {
visibility = 'public'; visibility = 'public';
localOnly = true; // TODO:
} }
// //

View File

@ -554,55 +554,61 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const id = Math.random().toString(); const id = Math.random().toString();
const ctx = reactive({ const reader = new FileReader();
id: id, reader.onload = (e) => {
name: name || file.name || 'untitled', const ctx = reactive({
progressMax: undefined, id: id,
progressValue: undefined, name: name || file.name || 'untitled',
img: window.URL.createObjectURL(file) progressMax: undefined,
}); progressValue: undefined,
img: window.URL.createObjectURL(file)
});
uploads.value.push(ctx); uploads.value.push(ctx);
const data = new FormData(); console.log(keepOriginal);
data.append('i', $i.token);
data.append('force', 'true');
data.append('file', file);
if (folder) data.append('folderId', folder); const data = new FormData();
if (name) data.append('name', name); data.append('i', $i.token);
data.append('force', 'true');
data.append('file', file);
if (folder) data.append('folderId', folder);
if (name) data.append('name', name);
const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true);
xhr.onload = (ev) => {
if (xhr.status !== 200 || ev.target == null || ev.target.response == null) {
// TODO: 消すのではなくて再送できるようにしたい
uploads.value = uploads.value.filter(x => x.id != id);
alert({
type: 'error',
text: 'upload failed'
});
reject();
return;
}
const driveFile = JSON.parse(ev.target.response);
resolve(driveFile);
const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true);
xhr.onload = (ev) => {
if (xhr.status !== 200 || ev.target == null || ev.target.response == null) {
// TODO: 消すのではなくて再送できるようにしたい
uploads.value = uploads.value.filter(x => x.id != id); uploads.value = uploads.value.filter(x => x.id != id);
};
alert({ xhr.upload.onprogress = e => {
type: 'error', if (e.lengthComputable) {
text: 'upload failed' ctx.progressMax = e.total;
}); ctx.progressValue = e.loaded;
}
};
reject(); xhr.send(data);
return;
}
const driveFile = JSON.parse(ev.target.response);
resolve(driveFile);
uploads.value = uploads.value.filter(x => x.id != id);
}; };
reader.readAsArrayBuffer(file);
xhr.upload.onprogress = e => {
if (e.lengthComputable) {
ctx.progressMax = e.total;
ctx.progressValue = e.loaded;
}
};
xhr.send(data);
}); });
} }

View File

@ -235,6 +235,7 @@ export default defineComponent({
if (this.channel) { if (this.channel) {
this.visibility = 'public'; this.visibility = 'public';
this.localOnly = true; // TODO:
} }
// //