Compare commits

..

5 Commits

Author SHA1 Message Date
Derek a773fbfd40 Federate channels at a very basic and prob stupid level 2022-05-22 09:16:19 -04:00
Derek b58d9a3056 *sigh* bump again
i should test better locally
2022-05-21 17:17:18 -04:00
Derek 394c91d385 Allow big files in db 2022-05-21 17:16:48 -04:00
Derek db3940f354 Bump 2022-05-21 16:05:55 -04:00
Derek d4cd641f74 Do not read the ENTIRE file before
uploading 

No idea if this code is supposed to serve a purpose, but it breaks on 
files larger than 4GB in firefox and chrome, and the read file-as-buffer 
is never used
2022-05-21 16:05:33 -04:00
8 changed files with 74 additions and 66 deletions

View File

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

View File

@ -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`);
}
}

View File

@ -56,7 +56,7 @@ export class DriveFile {
}) })
public type: string; public type: string;
@Column('integer', { @Column('bigint', {
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,6 +60,10 @@ 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) {
to = [{ type: 'Group', name: note.channelId }];
cc = [`${attributedTo}/followers`, 'https://www.w3.org/ns/activitystreams#Public'].concat(mentions);
} else {
if (note.visibility === 'public') { if (note.visibility === 'public') {
to = ['https://www.w3.org/ns/activitystreams#Public']; to = ['https://www.w3.org/ns/activitystreams#Public'];
cc = [`${attributedTo}/followers`].concat(mentions); cc = [`${attributedTo}/followers`].concat(mentions);
@ -72,6 +76,8 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
} else { } else {
to = mentions; 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,10 +148,9 @@ 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' && data.channel == null) { if (user.isSilenced && data.visibility === 'public') {
data.visibility = 'home'; data.visibility = 'home';
} }
@ -176,12 +175,12 @@ export default async (user: { id: User['id']; username: User['username']; host:
} }
// ローカルのみをRenoteしたらローカルのみにする // ローカルのみをRenoteしたらローカルのみにする
if (data.renote && data.renote.localOnly && data.channel == null) { if (data.renote && data.renote.localOnly) {
data.localOnly = true; data.localOnly = true;
} }
// ローカルのみにリプライしたらローカルのみにする // ローカルのみにリプライしたらローカルのみにする
if (data.reply && data.reply.localOnly && data.channel == null) { if (data.reply && data.reply.localOnly) {
data.localOnly = true; data.localOnly = true;
} }

View File

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

View File

@ -554,8 +554,6 @@ 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 reader = new FileReader();
reader.onload = (e) => {
const ctx = reactive({ const ctx = reactive({
id: id, id: id,
name: name || file.name || 'untitled', name: name || file.name || 'untitled',
@ -566,8 +564,6 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
uploads.value.push(ctx); uploads.value.push(ctx);
console.log(keepOriginal);
const data = new FormData(); const data = new FormData();
data.append('i', $i.token); data.append('i', $i.token);
data.append('force', 'true'); data.append('force', 'true');
@ -607,8 +603,6 @@ export function upload(file: File, folder?: any, name?: string, keepOriginal: bo
}; };
xhr.send(data); xhr.send(data);
};
reader.readAsArrayBuffer(file);
}); });
} }

View File

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