mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 08:53:09 +02:00
Compare commits
No commits in common. "c2e02a4c61b37b441dd100064d458b5c120d5083" and "8197148209713d28439526f1ab0ba949e02961a6" have entirely different histories.
c2e02a4c61
...
8197148209
4 changed files with 6 additions and 18 deletions
|
@ -241,14 +241,6 @@ export class NoteEditService implements OnApplicationShutdown {
|
||||||
throw new Error('not the author');
|
throw new Error('not the author');
|
||||||
}
|
}
|
||||||
|
|
||||||
// we never want to change the replyId, so fetch the original "parent"
|
|
||||||
if (oldnote.replyId) {
|
|
||||||
data.reply = await this.notesRepository.findOneBy({ id: oldnote.replyId });
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
data.reply = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// チャンネル外にリプライしたら対象のスコープに合わせる
|
// チャンネル外にリプライしたら対象のスコープに合わせる
|
||||||
// (クライアントサイドでやっても良い処理だと思うけどとりあえずサーバーサイドで)
|
// (クライアントサイドでやっても良い処理だと思うけどとりあえずサーバーサイドで)
|
||||||
if (data.reply && data.channel && data.reply.channelId !== data.channel.id) {
|
if (data.reply && data.channel && data.reply.channelId !== data.channel.id) {
|
||||||
|
@ -443,7 +435,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
||||||
id: oldnote.id,
|
id: oldnote.id,
|
||||||
updatedAt: data.updatedAt ? data.updatedAt : new Date(),
|
updatedAt: data.updatedAt ? data.updatedAt : new Date(),
|
||||||
fileIds: data.files ? data.files.map(file => file.id) : [],
|
fileIds: data.files ? data.files.map(file => file.id) : [],
|
||||||
replyId: oldnote.replyId,
|
replyId: data.reply ? data.reply.id : null,
|
||||||
renoteId: data.renote ? data.renote.id : null,
|
renoteId: data.renote ? data.renote.id : null,
|
||||||
channelId: data.channel ? data.channel.id : null,
|
channelId: data.channel ? data.channel.id : null,
|
||||||
threadId: data.reply
|
threadId: data.reply
|
||||||
|
|
|
@ -66,11 +66,7 @@ export class NoteReadService implements OnApplicationShutdown {
|
||||||
noteUserId: note.userId,
|
noteUserId: note.userId,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* we may be called from NoteEditService, for a note that's
|
await this.noteUnreadsRepository.insert(unread);
|
||||||
already present in the `note_unread` table: `upsert` makes sure
|
|
||||||
we don't throw a "duplicate key" error, while still updating
|
|
||||||
the other columns if they've changed */
|
|
||||||
await this.noteUnreadsRepository.upsert(unread,['userId', 'noteId']);
|
|
||||||
|
|
||||||
// 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する
|
// 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する
|
||||||
setTimeout(2000, 'unread note', { signal: this.#shutdownController.signal }).then(async () => {
|
setTimeout(2000, 'unread note', { signal: this.#shutdownController.signal }).then(async () => {
|
||||||
|
|
|
@ -141,7 +141,7 @@ const replies = ref<Misskey.entities.Note[]>([]);
|
||||||
const isRenote = (
|
const isRenote = (
|
||||||
props.note.renote != null &&
|
props.note.renote != null &&
|
||||||
props.note.text == null &&
|
props.note.text == null &&
|
||||||
props.note.fileIds && props.note.fileIds.length === 0 &&
|
props.note.fileIds.length === 0 &&
|
||||||
props.note.poll == null
|
props.note.poll == null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ function react(viaKeyboard = false): void {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blur();
|
blur();
|
||||||
reactionPicker.show(reactButton.value ?? null, props.note, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
misskeyApi('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
|
|
|
@ -155,7 +155,7 @@ const replies = ref<Misskey.entities.Note[]>([]);
|
||||||
const isRenote = (
|
const isRenote = (
|
||||||
props.note.renote != null &&
|
props.note.renote != null &&
|
||||||
props.note.text == null &&
|
props.note.text == null &&
|
||||||
props.note.fileIds && props.note.fileIds.length === 0 &&
|
props.note.fileIds.length === 0 &&
|
||||||
props.note.poll == null
|
props.note.poll == null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ function react(viaKeyboard = false): void {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blur();
|
blur();
|
||||||
reactionPicker.show(reactButton.value ?? null, props.note, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
misskeyApi('notes/reactions/create', {
|
misskeyApi('notes/reactions/create', {
|
||||||
noteId: props.note.id,
|
noteId: props.note.id,
|
||||||
reaction: reaction,
|
reaction: reaction,
|
||||||
|
|
Loading…
Reference in a new issue