Compare commits
5 Commits
b63cdc2c5c
...
a773fbfd40
Author | SHA1 | Date |
---|---|---|
Derek | a773fbfd40 | |
Derek | b58d9a3056 | |
Derek | 394c91d385 | |
Derek | db3940f354 | |
Derek | d4cd641f74 |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "misskey",
|
||||
"version": "12.110.1+birb3",
|
||||
"version": "12.110.1+birb3-2",
|
||||
"codename": "indigo",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
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`);
|
||||
}
|
||||
}
|
|
@ -56,7 +56,7 @@ export class DriveFile {
|
|||
})
|
||||
public type: string;
|
||||
|
||||
@Column('integer', {
|
||||
@Column('bigint', {
|
||||
comment: 'The file size (bytes) of the DriveFile.',
|
||||
})
|
||||
public size: number;
|
||||
|
|
|
@ -60,19 +60,25 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
|
|||
let to: string[] = [];
|
||||
let cc: string[] = [];
|
||||
|
||||
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;
|
||||
if (note.channelId) {
|
||||
to = [{ type: 'Group', name: note.channelId }];
|
||||
cc = [`${attributedTo}/followers`, 'https://www.w3.org/ns/activitystreams#Public'].concat(mentions);
|
||||
} else {
|
||||
to = 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 {
|
||||
to = mentions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const mentionedUsers = note.mentions.length > 0 ? await Users.findBy({
|
||||
id: In(note.mentions),
|
||||
}) : [];
|
||||
|
|
|
@ -148,10 +148,9 @@ 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' && data.channel == null) {
|
||||
if (user.isSilenced && data.visibility === 'public') {
|
||||
data.visibility = 'home';
|
||||
}
|
||||
|
||||
|
@ -176,12 +175,12 @@ export default async (user: { id: User['id']; username: User['username']; host:
|
|||
}
|
||||
|
||||
// ローカルのみをRenoteしたらローカルのみにする
|
||||
if (data.renote && data.renote.localOnly && data.channel == null) {
|
||||
if (data.renote && data.renote.localOnly) {
|
||||
data.localOnly = true;
|
||||
}
|
||||
|
||||
// ローカルのみにリプライしたらローカルのみにする
|
||||
if (data.reply && data.reply.localOnly && data.channel == null) {
|
||||
if (data.reply && data.reply.localOnly) {
|
||||
data.localOnly = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,6 @@ if (props.reply && props.reply.text != null) {
|
|||
|
||||
if (props.channel) {
|
||||
visibility = 'public';
|
||||
localOnly = true; // TODO: チャンネルが連合するようになった折には消す
|
||||
}
|
||||
|
||||
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
||||
|
|
|
@ -554,61 +554,55 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
|
|||
return new Promise((resolve, reject) => {
|
||||
const id = Math.random().toString();
|
||||
|
||||
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)
|
||||
});
|
||||
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);
|
||||
|
||||
console.log(keepOriginal);
|
||||
const data = new FormData();
|
||||
data.append('i', $i.token);
|
||||
data.append('force', 'true');
|
||||
data.append('file', file);
|
||||
|
||||
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);
|
||||
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);
|
||||
};
|
||||
|
||||
xhr.upload.onprogress = e => {
|
||||
if (e.lengthComputable) {
|
||||
ctx.progressMax = e.total;
|
||||
ctx.progressValue = e.loaded;
|
||||
}
|
||||
};
|
||||
alert({
|
||||
type: 'error',
|
||||
text: 'upload failed'
|
||||
});
|
||||
|
||||
xhr.send(data);
|
||||
reject();
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -235,7 +235,6 @@ export default defineComponent({
|
|||
|
||||
if (this.channel) {
|
||||
this.visibility = 'public';
|
||||
this.localOnly = true; // TODO: チャンネルが連合するようになった折には消す
|
||||
}
|
||||
|
||||
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
||||
|
|
Loading…
Reference in New Issue