diff --git a/hosts/koi/containers/sharkey/Dockerfile b/hosts/koi/containers/sharkey/Dockerfile index 773bf6f..7440998 100644 --- a/hosts/koi/containers/sharkey/Dockerfile +++ b/hosts/koi/containers/sharkey/Dockerfile @@ -1,6 +1,6 @@ # based on https://activitypub.software/TransFem-org/Sharkey/-/blob/develop/Dockerfile -ARG NODE_VERSION=20.10.0-alpine3.18 -ARG COMMIT=a9e4630cc4c6fd1e51347fdf577cfd7bbc4feec2 +ARG NODE_VERSION=20.12.2-alpine3.19 +ARG COMMIT=717696c4728d2e507ddfbd0e4890189758ab1087 FROM node:${NODE_VERSION} as build @@ -8,8 +8,7 @@ RUN apk add git linux-headers build-base patch ENV PYTHONUNBUFFERED=1 RUN apk add --update python3 && ln -sf python3 /usr/bin/python -RUN python3 -m ensurepip -RUN pip3 install --no-cache --upgrade pip setuptools +RUN apk add py3-pip py3-setuptools 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/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/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/migration ./packages/backend/migration COPY --chown=sharkey:sharkey --from=build /sharkey/packages/backend/assets ./packages/backend/assets diff --git a/hosts/koi/containers/sharkey/patches/no-remote-users.patch b/hosts/koi/containers/sharkey/patches/no-remote-users.patch index 9e6a971..64ed15d 100644 --- a/hosts/koi/containers/sharkey/patches/no-remote-users.patch +++ b/hosts/koi/containers/sharkey/patches/no-remote-users.patch @@ -11,18 +11,18 @@ index bd81989..8aaf8ca 100644 if (ps.userIds) { if (ps.userIds.length === 0) { return []; -@@ -112,7 +114,10 @@ export default class extends Endpoint { // eslint- - // リクエストされた通りに並べ替え +@@ -112,7 +114,9 @@ export default class extends Endpoint { // eslint- const _users: MiUser[] = []; 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) + if (user && (authed || user.host === null)) { + _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 { // eslint- throw new ApiError(meta.errors.noSuchUser); } diff --git a/hosts/koi/containers/sharkey/patches/unfollow-notification.patch b/hosts/koi/containers/sharkey/patches/unfollow-notification.patch index 6375de3..b5da31b 100644 --- a/hosts/koi/containers/sharkey/patches/unfollow-notification.patch +++ b/hosts/koi/containers/sharkey/patches/unfollow-notification.patch @@ -1,16 +1,15 @@ 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 +++ b/packages/backend/src/core/UserFollowingService.ts -@@ -403,6 +403,8 @@ export class UserFollowingService implements OnModuleInit { - }); - } - }); -+ -+ this.notificationService.createNotification(followee.id, 'unfollow', {}, follower.id); - } +@@ -388,6 +388,7 @@ export class UserFollowingService implements OnModuleInit { + this.cacheService.userFollowingsCache.refresh(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 index 4ed71a1..0bbd0ca 100644 --- a/packages/backend/src/models/Notification.ts @@ -25,10 +24,10 @@ index 4ed71a1..0bbd0ca 100644 createdAt: string; notifierId: MiUser['id']; 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 +++ 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
@@ -45,15 +44,15 @@ index 562cc38..6ea1598 100644 -@@ -60,6 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only +@@ -61,6 +62,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._notification.achievementEarned }} {{ i18n.ts._notification.testNotification }} + - {{ i18n.tsx._notification.reactedBySomeUsers({ n: notification.reactions.length }) }} + {{ i18n.tsx._notification.likedBySomeUsers({ n: getActualReactedUsersCount(notification) }) }} + {{ i18n.tsx._notification.reactedBySomeUsers({ n: getActualReactedUsersCount(notification) }) }} {{ i18n.tsx._notification.renotedBySomeUsers({ n: notification.users.length }) }} - {{ notification.header }} -@@ -103,6 +105,9 @@ SPDX-License-Identifier: AGPL-3.0-only +@@ -105,6 +107,9 @@ SPDX-License-Identifier: AGPL-3.0-only