Skip to content

Commit

Permalink
Merge branch 'develop' into a
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net authored Dec 3, 2024
2 parents f93d337 + 4c7a281 commit 1f53e53
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

### Client
- Fix: 絵文字情報表示でローカルのものに絵文字URLが表示されない [#562](https://github.com/yojo-art/cherrypick/pull/562)
- Enhance: 表示中のタグTLをお気に入り登録するボタンを追加 [#561](https://github.com/yojo-art/cherrypick/pull/561)

### Server
- Fix: PersonのserchableByが正しく連合できていないのを修正[#556](https://github.com/yojo-art/cherrypick/pull/556)
Expand Down
5 changes: 3 additions & 2 deletions packages/backend/src/core/AdvancedSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ export class AdvancedSearchService {
.where('reac.id > :latestid', { latestid })
.innerJoin('reac.user', 'user')
.leftJoin('reac.note', 'note')
.select(['reac', 'user.host', 'note.searchableBy'])
.select(['reac', 'note.searchableBy'])
.andWhere('user.host IS NULL')
.orderBy('reac.id', 'ASC')
.limit(limit)
.getMany();
Expand All @@ -581,7 +582,7 @@ export class AdvancedSearchService {
noteId: reac.noteId,
userId: reac.userId,
reaction: reac.reaction,
remote: reac.user === null ? false : true, //user.host===nullなら userがnullになる
remote: false,
reactionIncrement: false,
searchableBy: reac.note?.searchableBy === null ? undefined : reac.note?.searchableBy,
});
Expand Down
9 changes: 4 additions & 5 deletions packages/backend/src/core/DriveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Inject, Injectable } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
import sharp from 'sharp';
import { sharpBmp } from '@misskey-dev/sharp-read-bmp';
import { IsNull } from 'typeorm';
import { In, IsNull } from 'typeorm';
import { DeleteObjectCommandInput, PutObjectCommandInput, NoSuchKey } from '@aws-sdk/client-s3';
import { DI } from '@/di-symbols.js';
import type { DriveFilesRepository, UsersRepository, DriveFoldersRepository, UserProfilesRepository, MiMeta } from '@/models/_.js';
Expand Down Expand Up @@ -973,11 +973,10 @@ export class DriveService {
if (FileIds.length === 0) return 0;
let SensitiveCount = 0;

for (const FileId of FileIds) {
const file = await this.driveFilesRepository.findOneBy({ id: FileId });
if (file?.isSensitive) SensitiveCount++;
const files = await this.driveFilesRepository.findBy({ id: In(FileIds) });
for (const file of files) {
if (file.isSensitive) SensitiveCount++;
}

return SensitiveCount;
}
}
52 changes: 48 additions & 4 deletions packages/frontend/src/pages/tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<template #header><MkPageHeader :key="headerActions" :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :contentMax="800">
<MkNotes ref="notes" class="" :pagination="pagination"/>
</MkSpacer>
Expand All @@ -31,6 +31,8 @@ import { defaultStore } from '@/store.js';
import { useStream } from '@/stream.js';
import * as os from '@/os.js';
import { genEmbedCode } from '@/scripts/get-embed-code.js';
import { misskeyApi } from '@/scripts/misskey-api';
import { MenuItem } from '@/types/menu';

const props = defineProps<{
tag: string;
Expand All @@ -56,17 +58,59 @@ async function post() {
// notes.value?.pagingComponent?.reload();
}

const invalidChars = [' ', ' ', '#', ':', '\'', '"', '!'];

const headerActions = computed(() => [{
icon: 'ti ti-dots',
label: i18n.ts.more,
handler: (ev: MouseEvent) => {
os.popupMenu([{
handler: async (ev: MouseEvent) => {
const registryTags = await (misskeyApi('i/registry/get', {
scope: ['client', 'base'],
key: 'hashTag',
}).catch(() => null)) as string[] | null;
const menuList:MenuItem[] = [];
menuList.push({
text: i18n.ts.genEmbedCode,
icon: 'ti ti-code',
action: () => {
genEmbedCode('tags', props.tag);
},
}], ev.currentTarget ?? ev.target);
});
if (registryTags !== null) {
let tags:string[] = registryTags;
const is_my_tag = tags.includes(props.tag);
menuList.push({
text: is_my_tag ? i18n.ts.unfavorite : i18n.ts.favorite,
icon: is_my_tag ? 'ti ti-heart-off' : 'ti ti-heart',
action: async () => {
if (is_my_tag) {
tags = tags.filter(x => props.tag !== x);
} else {
const input = props.tag;
if (input === '' || invalidChars.includes(input)) {
os.alert(
{
type: 'error',
title: i18n.ts.invalidTagName,
},
);
return;
}
if (tags.includes(input)) {
//既に登録済なら無視
} else {
tags.push(input);
}
}
await misskeyApi('i/registry/set', {
scope: ['client', 'base'],
key: 'hashTag',
value: tags,
});
},
});
}
os.popupMenu(menuList, ev.currentTarget ?? ev.target);
},
}]);

Expand Down

0 comments on commit 1f53e53

Please sign in to comment.