0
0
Fork 0

ノートとして投稿すると公開範囲がダイレクトになるバグを修正

This commit is contained in:
Xeltica 2020-09-10 00:57:11 +09:00
parent 93831fd27b
commit 50d32d467d

View file

@ -19,15 +19,16 @@ export default (): void => {
await updateScore(user); await updateScore(user);
if (user.alertMode === 'note') { if (user.alertMode === 'note') {
console.info(`send ${user.username}@${user.host}'s misshaialert as a note`);
const res = await api<Record<string, unknown>>(user.host, 'notes/create', { const res = await api<Record<string, unknown>>(user.host, 'notes/create', {
text, text,
visibility: 'specified'
}, user.token); }, user.token);
if (res.error) { if (res.error) {
throw res.error; throw res.error;
} }
break; break;
} else if (user.alertMode === 'notification') { } else if (user.alertMode === 'notification') {
console.log(`send ${user.username}@${user.host}'s misshaialert as a notification`);
const res = await api(user.host, 'notifications/create', { const res = await api(user.host, 'notifications/create', {
header: 'みす廃あらーと', header: 'みす廃あらーと',
icon: 'https://i.imgur.com/B991yTl.png', icon: 'https://i.imgur.com/B991yTl.png',
@ -36,6 +37,8 @@ export default (): void => {
if (res.error) { if (res.error) {
throw res.error; throw res.error;
} }
} else {
console.info(`will not send ${user.username}@${user.host}'s misshaialert`);
} }
} catch (e) { } catch (e) {
if (e.code === 'NO_SUCH_USER' || e.code === 'AUTHENTICATION_FAILED') { if (e.code === 'NO_SUCH_USER' || e.code === 'AUTHENTICATION_FAILED') {