chore(koi): bumped sharkey

This commit is contained in:
alina 🌸 2024-06-19 17:55:16 +03:00
parent 07dad24175
commit e956f01761
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
3 changed files with 23 additions and 25 deletions

View file

@ -1,6 +1,6 @@
# based on https://activitypub.software/TransFem-org/Sharkey/-/blob/develop/Dockerfile # based on https://activitypub.software/TransFem-org/Sharkey/-/blob/develop/Dockerfile
ARG NODE_VERSION=20.10.0-alpine3.18 ARG NODE_VERSION=20.12.2-alpine3.19
ARG COMMIT=a9e4630cc4c6fd1e51347fdf577cfd7bbc4feec2 ARG COMMIT=717696c4728d2e507ddfbd0e4890189758ab1087
FROM node:${NODE_VERSION} as build FROM node:${NODE_VERSION} as build
@ -8,8 +8,7 @@ RUN apk add git linux-headers build-base patch
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
RUN apk add --update python3 && ln -sf python3 /usr/bin/python RUN apk add --update python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip RUN apk add py3-pip py3-setuptools
RUN pip3 install --no-cache --upgrade pip setuptools
RUN corepack enable RUN corepack enable
@ -90,7 +89,7 @@ COPY --chown=sharkey:sharkey --from=build /sharkey/sharkey-assets ./packages/fro
COPY --chown=sharkey:sharkey --from=build /sharkey/package.json ./package.json COPY --chown=sharkey:sharkey --from=build /sharkey/package.json ./package.json
COPY --chown=sharkey:sharkey --from=build /sharkey/pnpm-workspace.yaml ./pnpm-workspace.yaml COPY --chown=sharkey:sharkey --from=build /sharkey/pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/package.json ./packages/backend/package.json COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/package.json ./packages/backend/package.json
COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/check_connect.js ./packages/backend/check_connect.js COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/scripts/check_connect.js ./packages/backend/scripts/check_connect.js
COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/ormconfig.js ./packages/backend/ormconfig.js COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/ormconfig.js ./packages/backend/ormconfig.js
COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/migration ./packages/backend/migration COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/migration ./packages/backend/migration
COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/assets ./packages/backend/assets COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/assets ./packages/backend/assets

View file

@ -11,18 +11,18 @@ index bd81989..8aaf8ca 100644
if (ps.userIds) { if (ps.userIds) {
if (ps.userIds.length === 0) { if (ps.userIds.length === 0) {
return []; return [];
@@ -112,7 +114,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- @@ -112,7 +114,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
// リクエストされた通りに並べ替え
const _users: MiUser[] = []; const _users: MiUser[] = [];
for (const id of ps.userIds) { for (const id of ps.userIds) {
- _users.push(users.find(x => x.id === id)!); - const user = users.find(x => x.id === id);
- if (user != null) _users.push(user);
+ const user = users.find(x => x.id === id) + const user = users.find(x => x.id === id)
+ if (user && (authed || user.host === null)) { + if (user && (authed || user.host === null)) {
+ _users.push(user); + _users.push(user);
+ } + }
} }
return await Promise.all(_users.map(u => this.userEntityService.pack(u, me, { const _userMap = await this.userEntityService.packMany(_users, me, { schema: 'UserDetailed' })
@@ -137,6 +142,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- @@ -137,6 +142,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchUser); throw new ApiError(meta.errors.noSuchUser);
} }

View file

@ -1,16 +1,15 @@
diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts
index deeecde..02beb42 100644 index deeecde..2770ecb 100644
--- a/packages/backend/src/core/UserFollowingService.ts --- a/packages/backend/src/core/UserFollowingService.ts
+++ b/packages/backend/src/core/UserFollowingService.ts +++ b/packages/backend/src/core/UserFollowingService.ts
@@ -403,6 +403,8 @@ export class UserFollowingService implements OnModuleInit { @@ -388,6 +388,7 @@ export class UserFollowingService implements OnModuleInit {
}); this.cacheService.userFollowingsCache.refresh(follower.id);
}
});
+
+ this.notificationService.createNotification(followee.id, 'unfollow', {}, follower.id);
}
if (this.userEntityService.isLocalUser(follower) && this.userEntityService.isRemoteUser(followee)) { this.decrementFollowing(following.follower, following.followee);
+ this.notificationService.createNotification(followee.id, 'unfollow', {}, follower.id);
if (!silent && this.userEntityService.isLocalUser(follower)) {
// Publish unfollow event
diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts
index 4ed71a1..0bbd0ca 100644 index 4ed71a1..0bbd0ca 100644
--- a/packages/backend/src/models/Notification.ts --- a/packages/backend/src/models/Notification.ts
@ -25,10 +24,10 @@ index 4ed71a1..0bbd0ca 100644
createdAt: string; createdAt: string;
notifierId: MiUser['id']; notifierId: MiUser['id'];
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
index 562cc38..6ea1598 100644 index f849e94..9ba8351 100644
--- a/packages/frontend/src/components/MkNotification.vue --- a/packages/frontend/src/components/MkNotification.vue
+++ b/packages/frontend/src/components/MkNotification.vue +++ b/packages/frontend/src/components/MkNotification.vue
@@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<img v-else-if="notification.icon" :class="[$style.icon, $style.icon_app]" :src="notification.icon" alt=""/> <img v-else-if="notification.icon" :class="[$style.icon, $style.icon_app]" :src="notification.icon" alt=""/>
<div <div
:class="[$style.subIcon, { :class="[$style.subIcon, {
@ -37,7 +36,7 @@ index 562cc38..6ea1598 100644
[$style.t_followRequestAccepted]: notification.type === 'followRequestAccepted', [$style.t_followRequestAccepted]: notification.type === 'followRequestAccepted',
[$style.t_receiveFollowRequest]: notification.type === 'receiveFollowRequest', [$style.t_receiveFollowRequest]: notification.type === 'receiveFollowRequest',
[$style.t_renote]: notification.type === 'renote', [$style.t_renote]: notification.type === 'renote',
@@ -29,6 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -30,6 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
}]" }]"
> <!-- we re-use t_pollEnded for "edited" instead of making an identical style --> > <!-- we re-use t_pollEnded for "edited" instead of making an identical style -->
<i v-if="notification.type === 'follow'" class="ph-plus ph-bold ph-lg"></i> <i v-if="notification.type === 'follow'" class="ph-plus ph-bold ph-lg"></i>
@ -45,15 +44,15 @@ index 562cc38..6ea1598 100644
<i v-else-if="notification.type === 'receiveFollowRequest'" class="ph-clock ph-bold ph-lg"></i> <i v-else-if="notification.type === 'receiveFollowRequest'" class="ph-clock ph-bold ph-lg"></i>
<i v-else-if="notification.type === 'followRequestAccepted'" class="ph-check ph-bold ph-lg"></i> <i v-else-if="notification.type === 'followRequestAccepted'" class="ph-check ph-bold ph-lg"></i>
<i v-else-if="notification.type === 'renote'" class="ph-rocket-launch ph-bold ph-lg"></i> <i v-else-if="notification.type === 'renote'" class="ph-rocket-launch ph-bold ph-lg"></i>
@@ -60,6 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only @@ -61,6 +62,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<span v-else-if="notification.type === 'achievementEarned'">{{ i18n.ts._notification.achievementEarned }}</span> <span v-else-if="notification.type === 'achievementEarned'">{{ i18n.ts._notification.achievementEarned }}</span>
<span v-else-if="notification.type === 'test'">{{ i18n.ts._notification.testNotification }}</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 === '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> + <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>
<span v-else-if="notification.type === 'reaction:grouped'">{{ i18n.tsx._notification.reactedBySomeUsers({ n: notification.reactions.length }) }}</span> <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>
<span v-else-if="notification.type === 'renote:grouped'">{{ i18n.tsx._notification.renotedBySomeUsers({ n: notification.users.length }) }}</span> <span v-else-if="notification.type === 'renote:grouped'">{{ i18n.tsx._notification.renotedBySomeUsers({ n: notification.users.length }) }}</span>
<span v-else-if="notification.type === 'app'">{{ notification.header }}</span> @@ -105,6 +107,9 @@ SPDX-License-Identifier: AGPL-3.0-only
@@ -103,6 +105,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<template v-else-if="notification.type === 'follow'"> <template v-else-if="notification.type === 'follow'">
<span :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.youGotNewFollower }}</span> <span :class="$style.text" style="opacity: 0.6;">{{ i18n.ts.youGotNewFollower }}</span>
</template> </template>