This commit is contained in:
syuilo 2018-03-17 17:53:35 +09:00
parent 24d7700094
commit 7bb19f5b9b
2 changed files with 15 additions and 0 deletions

View File

@ -54,6 +54,13 @@ export default function(type, data): Notification {
icon: data.user.avatar_url + '?thumbnail&size=64'
};
case 'othello_invited':
return {
title: '対局への招待があります',
body: `${data.parent.name}さんから`,
icon: data.parent.avatar_url + '?thumbnail&size=64'
};
default:
return null;
}

View File

@ -150,5 +150,13 @@ function registerNotifications(stream: HomeStreamManager) {
};
setTimeout(n.close.bind(n), 7000);
});
connection.on('othello_invited', matching => {
const _n = composeNotification('othello_invited', matching);
const n = new Notification(_n.title, {
body: _n.body,
icon: _n.icon
});
});
}
}