Merge tag '2024.3.1-io.4c' into host
This commit is contained in:
commit
e22d6a15e8
6 changed files with 20 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "2024.3.1-host.4b",
|
"version": "2024.3.1-host.4c",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -126,13 +126,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
)
|
)
|
||||||
).map(u => [u.id, u]));
|
).map(u => [u.id, u]));
|
||||||
|
|
||||||
|
const now = new Date();
|
||||||
return birthdayUsers
|
return birthdayUsers
|
||||||
.map(item => {
|
.map(item => {
|
||||||
const birthday = new Date();
|
const birthday = new Date(
|
||||||
birthday.setMonth(Math.floor(item.birthday_date / 100) - 1);
|
now.getFullYear(),
|
||||||
birthday.setDate(item.birthday_date % 100);
|
Math.floor(item.birthday_date / 100) - 1,
|
||||||
birthday.setHours(0, 0, 0, 0);
|
item.birthday_date % 100,
|
||||||
if (birthday.getTime() < Date.now()) birthday.setFullYear(new Date().getFullYear() + 1);
|
0, 0, 0, 0,
|
||||||
|
);
|
||||||
|
if (birthday.getTime() < now.getTime()) birthday.setFullYear(now.getFullYear() + 1);
|
||||||
return { birthday: birthday.toISOString(), user: users.get(item.user_id) };
|
return { birthday: birthday.toISOString(), user: users.get(item.user_id) };
|
||||||
})
|
})
|
||||||
.filter(item => item.user !== undefined)
|
.filter(item => item.user !== undefined)
|
||||||
|
|
|
@ -281,13 +281,7 @@ function exec() {
|
||||||
|
|
||||||
emojis.value = searchEmoji(props.q, emojiDb.value);
|
emojis.value = searchEmoji(props.q, emojiDb.value);
|
||||||
} else if (props.type === 'emojiComplete') {
|
} else if (props.type === 'emojiComplete') {
|
||||||
if (!props.q || props.q === '') {
|
emojis.value = searchEmoji(props.q, unicodeEmojiDB.value, true);
|
||||||
// 最近使った絵文字をサジェスト
|
|
||||||
emojis.value = defaultStore.state.recentlyUsedEmojis.map(emoji => unicodeEmojiDB.value.find(dbEmoji => dbEmoji.emoji === emoji)).filter(x => x) as EmojiDef[];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
emojis.value = searchEmoji(props.q, unicodeEmojiDB.value);
|
|
||||||
} else if (props.type === 'mfmTag') {
|
} else if (props.type === 'mfmTag') {
|
||||||
if (!props.q || props.q === '') {
|
if (!props.q || props.q === '') {
|
||||||
mfmTags.value = MFM_TAGS;
|
mfmTags.value = MFM_TAGS;
|
||||||
|
|
|
@ -326,7 +326,7 @@ async function fetchSkebStatus() {
|
||||||
function buildSkebStatus(): string {
|
function buildSkebStatus(): string {
|
||||||
if (!userSkebStatus.value) return '';
|
if (!userSkebStatus.value) return '';
|
||||||
|
|
||||||
if (userSkebStatus.value.isCreator) {
|
if (userSkebStatus.value.isAcceptable || userSkebStatus.value.isCreator) {
|
||||||
let status = '';
|
let status = '';
|
||||||
|
|
||||||
if (userSkebStatus.value.isAcceptable) {
|
if (userSkebStatus.value.isAcceptable) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ export type EmojiDef = {
|
||||||
};
|
};
|
||||||
type EmojiScore = { emoji: EmojiDef, score: number };
|
type EmojiScore = { emoji: EmojiDef, score: number };
|
||||||
|
|
||||||
export function searchEmoji(query: string | null, emojiDb: EmojiDef[], max = 30): EmojiDef[] {
|
export function searchEmoji(query: string | null, emojiDb: EmojiDef[], exact = false, max = 30): EmojiDef[] {
|
||||||
if (!query) {
|
if (!query) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,13 @@ export function searchEmoji(query: string | null, emojiDb: EmojiDef[], max = 30)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (exact) {
|
||||||
|
return [...matched.values()]
|
||||||
|
.sort((x, y) => y.score - x.score)
|
||||||
|
.slice(0, max)
|
||||||
|
.map(it => it.emoji);
|
||||||
|
}
|
||||||
|
|
||||||
// 前方一致(エイリアスなし)
|
// 前方一致(エイリアスなし)
|
||||||
if (matched.size < max) {
|
if (matched.size < max) {
|
||||||
emojiDb.some(x => {
|
emojiDb.some(x => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"name": "misskey-js",
|
"name": "misskey-js",
|
||||||
"version": "2024.3.1-host.4b",
|
"version": "2024.3.1-host.4c",
|
||||||
"description": "Misskey SDK for JavaScript",
|
"description": "Misskey SDK for JavaScript",
|
||||||
"types": "./built/dts/index.d.ts",
|
"types": "./built/dts/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue