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",
"version": "12.110.1+birb3-2",
"version": "12.110.1+birb3",
"codename": "indigo",
"repository": {
"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;
@Column('bigint', {
@Column('integer', {
comment: 'The file size (bytes) of the DriveFile.',
})
public size: number;

View File

@ -60,25 +60,19 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
let to: string[] = [];
let cc: string[] = [];
if (note.channelId) {
to = [{ type: 'Group', name: note.channelId }];
cc = [`${attributedTo}/followers`, 'https://www.w3.org/ns/activitystreams#Public'].concat(mentions);
if (note.visibility === 'public') {
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 {
if (note.visibility === 'public') {
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;
}
to = mentions;
}
const mentionedUsers = note.mentions.length > 0 ? await Users.findBy({
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.channel != null) data.visibility = 'public';
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';
}
@ -175,12 +176,12 @@ export default async (user: { id: User['id']; username: User['username']; host:
}
// ローカルのみをRenoteしたらローカルのみにする
if (data.renote && data.renote.localOnly) {
if (data.renote && data.renote.localOnly && data.channel == null) {
data.localOnly = true;
}
// ローカルのみにリプライしたらローカルのみにする
if (data.reply && data.reply.localOnly) {
if (data.reply && data.reply.localOnly && data.channel == null) {
data.localOnly = true;
}

View File

@ -255,6 +255,7 @@ if (props.reply && props.reply.text != null) {
if (props.channel) {
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) => {
const id = Math.random().toString();
const ctx = reactive({
id: id,
name: name || file.name || 'untitled',
progressMax: undefined,
progressValue: undefined,
img: window.URL.createObjectURL(file)
});
const reader = new FileReader();
reader.onload = (e) => {
const ctx = reactive({
id: id,
name: name || file.name || 'untitled',
progressMax: undefined,
progressValue: undefined,
img: window.URL.createObjectURL(file)
});
uploads.value.push(ctx);
uploads.value.push(ctx);
const data = new FormData();
data.append('i', $i.token);
data.append('force', 'true');
data.append('file', file);
console.log(keepOriginal);
if (folder) data.append('folderId', folder);
if (name) data.append('name', name);
const data = new FormData();
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);
};
alert({
type: 'error',
text: 'upload failed'
});
xhr.upload.onprogress = e => {
if (e.lengthComputable) {
ctx.progressMax = e.total;
ctx.progressValue = e.loaded;
}
};
reject();
return;
}
const driveFile = JSON.parse(ev.target.response);
resolve(driveFile);
uploads.value = uploads.value.filter(x => x.id != id);
xhr.send(data);
};
xhr.upload.onprogress = e => {
if (e.lengthComputable) {
ctx.progressMax = e.total;
ctx.progressValue = e.loaded;
}
};
xhr.send(data);
reader.readAsArrayBuffer(file);
});
}

View File

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