2024-05-17 03:19:58 +03:00
|
|
|
diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts
|
2024-06-19 17:55:16 +03:00
|
|
|
index deeecde..2770ecb 100644
|
2024-05-17 03:19:58 +03:00
|
|
|
--- a/packages/backend/src/core/UserFollowingService.ts
|
|
|
|
+++ b/packages/backend/src/core/UserFollowingService.ts
|
2024-06-19 17:55:16 +03:00
|
|
|
@@ -388,6 +388,7 @@ export class UserFollowingService implements OnModuleInit {
|
|
|
|
this.cacheService.userFollowingsCache.refresh(follower.id);
|
2024-05-17 03:19:58 +03:00
|
|
|
|
2024-06-19 17:55:16 +03:00
|
|
|
this.decrementFollowing(following.follower, following.followee);
|
|
|
|
+ this.notificationService.createNotification(followee.id, 'unfollow', {}, follower.id);
|
|
|
|
|
|
|
|
if (!silent && this.userEntityService.isLocalUser(follower)) {
|
|
|
|
// Publish unfollow event
|
2024-05-17 03:19:58 +03:00
|
|
|
diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts
|
|
|
|
index 4ed71a1..0bbd0ca 100644
|
|
|
|
--- a/packages/backend/src/models/Notification.ts
|
|
|
|
+++ b/packages/backend/src/models/Notification.ts
|
|
|
|
@@ -15,7 +15,7 @@ export type MiNotification = {
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
noteId: MiNote['id'];
|
|
|
|
} | {
|
|
|
|
- type: 'follow';
|
|
|
|
+ type: 'follow' | 'unfollow';
|
|
|
|
id: string;
|
|
|
|
createdAt: string;
|
|
|
|
notifierId: MiUser['id'];
|
|
|
|
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
|
2024-06-19 17:55:16 +03:00
|
|
|
index f849e94..9ba8351 100644
|
2024-05-17 03:19:58 +03:00
|
|
|
--- a/packages/frontend/src/components/MkNotification.vue
|
|
|
|
+++ b/packages/frontend/src/components/MkNotification.vue
|
2024-06-19 17:55:16 +03:00
|
|
|
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
2024-05-17 03:19:58 +03:00
|
|
|
<img v-else-if="notification.icon" :class="[$style.icon, $style.icon_app]" :src="notification.icon" alt=""/>
|
|
|
|
<div
|
|
|
|
:class="[$style.subIcon, {
|
|
|
|
- [$style.t_follow]: notification.type === 'follow',
|
|
|
|
+ [$style.t_follow]: notification.type === 'follow' || notification.type === 'unfollow',
|
|
|
|
[$style.t_followRequestAccepted]: notification.type === 'followRequestAccepted',
|
|
|
|
[$style.t_receiveFollowRequest]: notification.type === 'receiveFollowRequest',
|
|
|
|
[$style.t_renote]: notification.type === 'renote',
|
2024-06-19 17:55:16 +03:00
|
|
|
@@ -30,6 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
2024-05-17 03:19:58 +03:00
|
|
|
}]"
|
|
|
|
> <!-- we re-use t_pollEnded for "edited" instead of making an identical style -->
|
2024-07-27 21:01:44 +03:00
|
|
|
<i v-if="notification.type === 'follow'" class="ti ti-plus"></i>
|
|
|
|
+ <i v-else-if="notification.type === 'unfollow'" class="ti ti-minus"></i>
|
|
|
|
<i v-else-if="notification.type === 'receiveFollowRequest'" class="ti ti-clock"></i>
|
|
|
|
<i v-else-if="notification.type === 'followRequestAccepted'" class="ti ti-check"></i>
|
|
|
|
<i v-else-if="notification.type === 'renote'" class="ti ti-repeat"></i>
|
2024-06-19 17:55:16 +03:00
|
|
|
@@ -61,6 +62,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
2024-05-17 03:19:58 +03:00
|
|
|
<span v-else-if="notification.type === 'achievementEarned'">{{ i18n.ts._notification.achievementEarned }}</span>
|
|
|
|
<span v-else-if="notification.type === 'test'">{{ i18n.ts._notification.testNotification }}</span>
|
|
|
|
<MkA v-else-if="notification.type === 'follow' || notification.type === 'mention' || notification.type === 'reply' || notification.type === 'renote' || notification.type === 'quote' || notification.type === 'reaction' || notification.type === 'receiveFollowRequest' || notification.type === 'followRequestAccepted'" v-user-preview="notification.user.id" :class="$style.headerName" :to="userPage(notification.user)"><MkUserName :user="notification.user"/></MkA>
|
|
|
|
+ <MkA v-else-if="notification.type === 'unfollow'" v-user-preview="notification.user.id" :class="$style.headerName" :to="userPage(notification.user)"><MkUserName :user="notification.user"/></MkA>
|
2024-06-19 17:55:16 +03:00
|
|
|
<span v-else-if="notification.type === 'reaction:grouped' && notification.note.reactionAcceptance === 'likeOnly'">{{ i18n.tsx._notification.likedBySomeUsers({ n: getActualReactedUsersCount(notification) }) }}</span>
|
|
|
|
<span v-else-if="notification.type === 'reaction:grouped'">{{ i18n.tsx._notification.reactedBySomeUsers({ n: getActualReactedUsersCount(notification) }) }}</span>
|
2024-05-17 03:19:58 +03:00
|
|
|
<span v-else-if="notification.type === 'renote:grouped'">{{ i18n.tsx._notification.renotedBySomeUsers({ n: notification.users.length }) }}</span>
|
2024-06-19 17:55:16 +03:00
|
|
|
@@ -105,6 +107,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
2024-05-17 03:19:58 +03:00
|
|
|
<template v-else-if="notification.type === 'follow'">
|
|
|
|
<span :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.youGotNewFollower }}</span>
|
|
|
|
</template>
|
|
|
|
+ <template v-else-if="notification.type === 'unfollow'">
|
|
|
|
+ <span :class="$style.text" style="opacity: 0.6;">unfollowed you</span>
|
|
|
|
+ </template>
|
|
|
|
<span v-else-if="notification.type === 'followRequestAccepted'" :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.followRequestAccepted }}</span>
|
|
|
|
<template v-else-if="notification.type === 'receiveFollowRequest'">
|
|
|
|
<span :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.receiveFollowRequest }}</span>
|