2023-07-27 05:31:52 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { $i } from '@/account.js';
|
2023-01-21 04:14:55 +00:00
|
|
|
|
|
|
|
export const ACHIEVEMENT_TYPES = [
|
|
|
|
'notes1',
|
|
|
|
'notes10',
|
|
|
|
'notes100',
|
|
|
|
'notes500',
|
|
|
|
'notes1000',
|
|
|
|
'notes5000',
|
|
|
|
'notes10000',
|
|
|
|
'notes20000',
|
|
|
|
'notes30000',
|
|
|
|
'notes40000',
|
|
|
|
'notes50000',
|
|
|
|
'notes60000',
|
|
|
|
'notes70000',
|
|
|
|
'notes80000',
|
|
|
|
'notes90000',
|
|
|
|
'notes100000',
|
|
|
|
'login3',
|
|
|
|
'login7',
|
|
|
|
'login15',
|
|
|
|
'login30',
|
|
|
|
'login60',
|
|
|
|
'login100',
|
|
|
|
'login200',
|
|
|
|
'login300',
|
|
|
|
'login400',
|
|
|
|
'login500',
|
|
|
|
'login600',
|
|
|
|
'login700',
|
|
|
|
'login800',
|
|
|
|
'login900',
|
|
|
|
'login1000',
|
|
|
|
'passedSinceAccountCreated1',
|
|
|
|
'passedSinceAccountCreated2',
|
|
|
|
'passedSinceAccountCreated3',
|
|
|
|
'loggedInOnBirthday',
|
2023-01-21 07:06:49 +00:00
|
|
|
'loggedInOnNewYearsDay',
|
2023-01-21 04:14:55 +00:00
|
|
|
'noteClipped1',
|
|
|
|
'noteFavorited1',
|
2023-01-21 23:00:42 +00:00
|
|
|
'myNoteFavorited1',
|
2023-01-21 04:14:55 +00:00
|
|
|
'profileFilled',
|
|
|
|
'markedAsCat',
|
|
|
|
'following1',
|
|
|
|
'following10',
|
|
|
|
'following50',
|
|
|
|
'following100',
|
|
|
|
'following300',
|
|
|
|
'followers1',
|
|
|
|
'followers10',
|
|
|
|
'followers50',
|
|
|
|
'followers100',
|
|
|
|
'followers300',
|
|
|
|
'followers500',
|
|
|
|
'followers1000',
|
|
|
|
'collectAchievements30',
|
2023-01-21 07:06:49 +00:00
|
|
|
'viewAchievements3min',
|
2023-01-21 04:14:55 +00:00
|
|
|
'iLoveMisskey',
|
2023-01-22 11:22:38 +00:00
|
|
|
'foundTreasure',
|
2023-01-21 04:14:55 +00:00
|
|
|
'client30min',
|
2023-04-20 10:40:02 +00:00
|
|
|
'client60min',
|
2023-01-21 04:14:55 +00:00
|
|
|
'noteDeletedWithin1min',
|
|
|
|
'postedAtLateNight',
|
|
|
|
'postedAt0min0sec',
|
|
|
|
'selfQuote',
|
|
|
|
'htl20npm',
|
2023-01-22 11:30:56 +00:00
|
|
|
'viewInstanceChart',
|
2023-01-21 06:30:29 +00:00
|
|
|
'outputHelloWorldOnScratchpad',
|
|
|
|
'open3windows',
|
2023-01-21 04:14:55 +00:00
|
|
|
'driveFolderCircularReference',
|
|
|
|
'reactWithoutRead',
|
|
|
|
'clickedClickHere',
|
|
|
|
'justPlainLucky',
|
|
|
|
'setNameToSyuilo',
|
|
|
|
'cookieClicked',
|
|
|
|
'brainDiver',
|
2023-09-12 06:48:19 +00:00
|
|
|
'smashTestNotificationButton',
|
2023-01-21 04:14:55 +00:00
|
|
|
] as const;
|
|
|
|
|
|
|
|
export const ACHIEVEMENT_BADGES = {
|
|
|
|
'notes1': {
|
|
|
|
img: '/fluent-emoji/1f4dd.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'notes10': {
|
|
|
|
img: '/fluent-emoji/1f4d1.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'notes100': {
|
|
|
|
img: '/fluent-emoji/1f4d2.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'notes500': {
|
|
|
|
img: '/fluent-emoji/1f4da.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'notes1000': {
|
|
|
|
img: '/fluent-emoji/1f5c3.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'notes5000': {
|
|
|
|
img: '/fluent-emoji/1f304.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'notes10000': {
|
|
|
|
img: '/fluent-emoji/1f3d9.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'notes20000': {
|
|
|
|
img: '/fluent-emoji/1f307.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'notes30000': {
|
|
|
|
img: '/fluent-emoji/1f306.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'notes40000': {
|
|
|
|
img: '/fluent-emoji/1f303.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(197 69 192), rgb(2 112 155))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'notes50000': {
|
|
|
|
img: '/fluent-emoji/1fa90.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'notes60000': {
|
|
|
|
img: '/fluent-emoji/2604.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(197 69 192), rgb(2 112 155))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'notes70000': {
|
|
|
|
img: '/fluent-emoji/1f30c.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'notes80000': {
|
|
|
|
img: '/fluent-emoji/1f30c.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(197 69 192), rgb(2 112 155))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'notes90000': {
|
|
|
|
img: '/fluent-emoji/1f30c.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 232 119), rgb(255 140 41))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'notes100000': {
|
|
|
|
img: '/fluent-emoji/267e.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 232 119), rgb(255 140 41))',
|
|
|
|
frame: 'platinum',
|
|
|
|
},
|
|
|
|
'login3': {
|
|
|
|
img: '/fluent-emoji/1f331.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'login7': {
|
|
|
|
img: '/fluent-emoji/1f331.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'login15': {
|
|
|
|
img: '/fluent-emoji/1f331.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'login30': {
|
|
|
|
img: '/fluent-emoji/1fab4.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'login60': {
|
|
|
|
img: '/fluent-emoji/1fab4.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'login100': {
|
|
|
|
img: '/fluent-emoji/1fab4.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'login200': {
|
|
|
|
img: '/fluent-emoji/1f333.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'login300': {
|
|
|
|
img: '/fluent-emoji/1f333.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'login400': {
|
|
|
|
img: '/fluent-emoji/1f333.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'login500': {
|
|
|
|
img: '/fluent-emoji/1f304.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'login600': {
|
|
|
|
img: '/fluent-emoji/1f304.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'login700': {
|
|
|
|
img: '/fluent-emoji/1f304.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'login800': {
|
|
|
|
img: '/fluent-emoji/1f307.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'login900': {
|
|
|
|
img: '/fluent-emoji/1f307.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'login1000': {
|
|
|
|
img: '/fluent-emoji/1f307.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
|
|
|
frame: 'platinum',
|
|
|
|
},
|
|
|
|
'noteClipped1': {
|
|
|
|
img: '/fluent-emoji/1f587.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'noteFavorited1': {
|
|
|
|
img: '/fluent-emoji/1f31f.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
2023-01-21 23:00:42 +00:00
|
|
|
'myNoteFavorited1': {
|
|
|
|
img: '/fluent-emoji/1f320.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
2023-01-21 04:14:55 +00:00
|
|
|
'profileFilled': {
|
|
|
|
img: '/fluent-emoji/1f44c.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'markedAsCat': {
|
|
|
|
img: '/fluent-emoji/1f408.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'following1': {
|
|
|
|
img: '/fluent-emoji/2618.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'following10': {
|
|
|
|
img: '/fluent-emoji/1f6b8.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'following50': {
|
|
|
|
img: '/fluent-emoji/1f91d.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'following100': {
|
|
|
|
img: '/fluent-emoji/1f4af.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 53 184), rgb(255 206 69))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'following300': {
|
|
|
|
img: '/fluent-emoji/1f970.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'followers1': {
|
|
|
|
img: '/fluent-emoji/2618.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'followers10': {
|
|
|
|
img: '/fluent-emoji/1f44b.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(59 187 116), rgb(199 211 102))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'followers50': {
|
|
|
|
img: '/fluent-emoji/1f411.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'followers100': {
|
2023-01-21 07:06:49 +00:00
|
|
|
img: '/fluent-emoji/1f60e.png',
|
2023-01-21 04:14:55 +00:00
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'followers300': {
|
|
|
|
img: '/fluent-emoji/1f3c6.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'followers500': {
|
|
|
|
img: '/fluent-emoji/1f4e1.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'followers1000': {
|
|
|
|
img: '/fluent-emoji/1f451.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 232 119), rgb(255 140 41))',
|
|
|
|
frame: 'platinum',
|
|
|
|
},
|
|
|
|
'collectAchievements30': {
|
|
|
|
img: '/fluent-emoji/1f3c5.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 77 77), rgb(247 155 214))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
2023-01-21 07:06:49 +00:00
|
|
|
'viewAchievements3min': {
|
|
|
|
img: '/fluent-emoji/1f3c5.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
2023-01-21 04:14:55 +00:00
|
|
|
'iLoveMisskey': {
|
|
|
|
img: '/fluent-emoji/2764.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 77 77), rgb(247 155 214))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
2023-01-22 11:22:38 +00:00
|
|
|
'foundTreasure': {
|
|
|
|
img: '/fluent-emoji/1f3c6.png',
|
2023-01-22 11:25:10 +00:00
|
|
|
bg: 'linear-gradient(0deg, rgb(197 69 192), rgb(2 112 155))',
|
2023-01-22 11:22:38 +00:00
|
|
|
frame: 'gold',
|
|
|
|
},
|
2023-01-21 04:14:55 +00:00
|
|
|
'client30min': {
|
|
|
|
img: '/fluent-emoji/1f552.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
2023-04-20 10:40:02 +00:00
|
|
|
'client60min': {
|
|
|
|
img: '/fluent-emoji/1f552.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
2023-01-21 04:14:55 +00:00
|
|
|
'noteDeletedWithin1min': {
|
|
|
|
img: '/fluent-emoji/1f5d1.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'postedAtLateNight': {
|
|
|
|
img: '/fluent-emoji/1f319.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(197 69 192), rgb(2 112 155))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'postedAt0min0sec': {
|
|
|
|
img: '/fluent-emoji/1f55b.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(58 231 198), rgb(37 194 255))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'selfQuote': {
|
|
|
|
img: '/fluent-emoji/1f4dd.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'htl20npm': {
|
|
|
|
img: '/fluent-emoji/1f30a.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(220 223 225), rgb(172 192 207))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
2023-01-22 11:30:56 +00:00
|
|
|
'viewInstanceChart': {
|
|
|
|
img: '/fluent-emoji/1f4ca.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(58 231 198), rgb(37 194 255))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
2023-01-21 06:30:29 +00:00
|
|
|
'outputHelloWorldOnScratchpad': {
|
|
|
|
img: '/fluent-emoji/1f530.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(58 231 198), rgb(37 194 255))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'open3windows': {
|
|
|
|
img: '/fluent-emoji/1f5a5.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
2023-01-21 04:14:55 +00:00
|
|
|
'driveFolderCircularReference': {
|
|
|
|
img: '/fluent-emoji/1f4c2.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'reactWithoutRead': {
|
|
|
|
img: '/fluent-emoji/2753.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'clickedClickHere': {
|
|
|
|
img: '/fluent-emoji/2757.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144 224 255), rgb(255 168 252))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'justPlainLucky': {
|
|
|
|
img: '/fluent-emoji/1f340.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'setNameToSyuilo': {
|
|
|
|
img: '/fluent-emoji/1f36e.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'passedSinceAccountCreated1': {
|
|
|
|
img: '/fluent-emoji/0031-20e3.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'passedSinceAccountCreated2': {
|
|
|
|
img: '/fluent-emoji/0032-20e3.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'passedSinceAccountCreated3': {
|
|
|
|
img: '/fluent-emoji/0033-20e3.png',
|
|
|
|
bg: null,
|
|
|
|
frame: 'gold',
|
|
|
|
},
|
|
|
|
'loggedInOnBirthday': {
|
|
|
|
img: '/fluent-emoji/1f382.png',
|
2023-01-21 07:06:49 +00:00
|
|
|
bg: 'linear-gradient(0deg, rgb(255 77 77), rgb(247 155 214))',
|
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'loggedInOnNewYearsDay': {
|
|
|
|
img: '/fluent-emoji/1f38d.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(255 144 144), rgb(255 232 168))',
|
2023-01-21 04:14:55 +00:00
|
|
|
frame: 'silver',
|
|
|
|
},
|
|
|
|
'cookieClicked': {
|
|
|
|
img: '/fluent-emoji/1f36a.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
|
|
|
frame: 'bronze',
|
|
|
|
},
|
|
|
|
'brainDiver': {
|
|
|
|
img: '/fluent-emoji/1f9e0.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(144, 224, 255), rgb(255, 168, 252))',
|
|
|
|
frame: 'bronze',
|
2023-09-12 06:48:19 +00:00
|
|
|
},
|
|
|
|
'smashTestNotificationButton': {
|
|
|
|
img: '/fluent-emoji/1f514.png',
|
|
|
|
bg: 'linear-gradient(0deg, rgb(187 183 59), rgb(255 143 77))',
|
|
|
|
frame: 'bronze',
|
2023-01-21 04:14:55 +00:00
|
|
|
},
|
2023-04-04 00:38:34 +00:00
|
|
|
/* @see <https://github.com/misskey-dev/misskey/pull/10365#discussion_r1155511107>
|
2023-01-21 04:14:55 +00:00
|
|
|
} as const satisfies Record<typeof ACHIEVEMENT_TYPES[number], {
|
|
|
|
img: string;
|
|
|
|
bg: string | null;
|
|
|
|
frame: 'bronze' | 'silver' | 'gold' | 'platinum';
|
|
|
|
}>;
|
2023-04-04 00:38:34 +00:00
|
|
|
*/
|
|
|
|
} as const;
|
2023-01-21 04:14:55 +00:00
|
|
|
|
2023-01-22 11:22:38 +00:00
|
|
|
export const claimedAchievements: typeof ACHIEVEMENT_TYPES[number][] = ($i && $i.achievements) ? $i.achievements.map(x => x.name) : [];
|
2023-01-21 04:14:55 +00:00
|
|
|
|
2023-01-21 19:24:38 +00:00
|
|
|
const claimingQueue = new Set<string>();
|
|
|
|
|
|
|
|
export async function claimAchievement(type: typeof ACHIEVEMENT_TYPES[number]) {
|
2023-01-22 11:30:56 +00:00
|
|
|
if ($i == null) return;
|
enhance: account migration (#10592)
* copy block and mute then create follow and unfollow jobs
* copy block and mute and update lists when detecting an account has moved
* no need to care promise orders
* refactor updating actor and target
* automatically accept if a locked account had accepted an old account
* fix exception format
* prevent the old account from calling some endpoints
* do not unfollow when moving
* adjust following and follower counts
* check movedToUri when receiving a follow request
* skip if no need to adjust
* Revert "disable account migration"
This reverts commit 2321214c98591bcfe1385c1ab5bf0ff7b471ae1d.
* fix translation specifier
* fix checking alsoKnownAs and uri
* fix updating account
* fix refollowing locked account
* decrease followersCount if followed by the old account
* adjust following and followers counts when unfollowing
* fix copying mutings
* prohibit moved account from moving again
* fix move service
* allow app creation after moving
* fix lint
* remove unnecessary field
* fix cache update
* add e2e test
* add e2e test of accepting the new account automatically
* force follow if any error happens
* remove unnecessary joins
* use Array.map instead of for const of
* ユーザーリストの移行は追加のみを行う
* nanka iroiro
* fix misskey-js?
* :v:
* 移行を行ったアカウントからのフォローリクエストの自動許可を調整
* newUriを外に出す
* newUriを外に出す2
* clean up
* fix newUri
* prevent moving if the destination account has already moved
* set alsoKnownAs via /i/update
* fix database initialization
* add return type
* prohibit updating alsoKnownAs after moving
* skip to add to alsoKnownAs if toUrl is known
* skip adding to the list if it already has
* use Acct.parse instead
* rename error code
* :art:
* 制限を5から10に緩和
* movedTo(Uri), alsoKnownAsはユーザーidを返すように
* test api res
* fix
* 元アカウントはミュートし続ける
* :art:
* unfollow
* fix
* getUserUriをUserEntityServiceに
* ?
* job!
* :art:
* instance => server
* accountMovedShort, forbiddenBecauseYouAreMigrated
* accountMovedShort
* fix test
* import, pin禁止
* 実績を凍結する
* clean up
* :v:
* change message
* ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに
* Revert "ブロック, フォロー, ミュート, リストのインポートファイルの制限を32MiBに"
This reverts commit 3bd7be35d8aa455cb01ae58f8172a71a50485db1.
* validateAlsoKnownAs
* 移行後2時間以内はインポート可能なファイルサイズを拡大
* clean up
* どうせactorをupdatePersonで更新するならupdatePersonしか移行処理を発行しないことにする
* handle error?
* リモートからの移行処理の条件を是正
* log, port
* fix
* fix
* enhance(dev): non-production環境でhttpサーバー間でもユーザー、ノートの連合が可能なように
* refactor (use checkHttps)
* MISSKEY_WEBFINGER_USE_HTTP
* Environment Variable readme
* NEVER USE IN PRODUCTION
* fix punyHost
* fix indent
* fix
* experimental
---------
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-04-29 15:09:29 +00:00
|
|
|
if ($i.movedTo) return;
|
2023-01-21 04:14:55 +00:00
|
|
|
if (claimedAchievements.includes(type)) return;
|
2023-01-21 19:24:38 +00:00
|
|
|
claimingQueue.add(type);
|
2023-01-21 04:14:55 +00:00
|
|
|
claimedAchievements.push(type);
|
2023-01-21 19:24:38 +00:00
|
|
|
await new Promise(resolve => setTimeout(resolve, (claimingQueue.size - 1) * 500));
|
|
|
|
window.setTimeout(() => {
|
|
|
|
claimingQueue.delete(type);
|
|
|
|
}, 500);
|
|
|
|
os.api('i/claim-achievement', { name: type });
|
2023-01-21 04:14:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (_DEV_) {
|
2023-01-21 19:24:38 +00:00
|
|
|
(window as any).unlockAllAchievements = () => {
|
2023-01-21 04:14:55 +00:00
|
|
|
for (const t of ACHIEVEMENT_TYPES) {
|
|
|
|
claimAchievement(t);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|