{{ $ts.receiveFollowRequest }} |
@@ -170,8 +171,24 @@ export default defineComponent({
}, {}, 'closed');
});
+ function openRenoteDestination(renoteNotification: misskey.entities.Notification): void {
+ if (renoteNotification.type !== 'renote') {
+ throw new Error("openRenoteDestination()の引数には type: 'renote' のNotificationが渡される必要があります");
+ }
+
+ os.api('users/show', {userId: renoteNotification.user.id}).then((user: misskey.entities.UserDetailed) => {
+ if (user.host != null && user.followersCount === 0) { // リモートユーザーかつローカルの人間が誰もフォローしていない(最新の投稿が取得できない)ユーザー
+ if (user.url === null) { throw new Error('User page URL is Null') };
+ window.open(user.url, '_blank', 'rel="nofollow noopener"');
+ } else {
+ os.pageWindow(notePage(renoteNotification.note));
+ }
+ });
+ }
+
return {
getNoteSummary: (note: misskey.entities.Note) => getNoteSummary(note),
+ openRenoteDestination: (renoteNotification: misskey.entities.Notification) => openRenoteDestination(renoteNotification),
followRequestDone,
groupInviteDone,
notePage,