diff --git a/src/client/pages/welcome.entrance.b.vue b/src/client/pages/welcome.entrance.b.vue
index a5c12f09e2..163fc1e35f 100644
--- a/src/client/pages/welcome.entrance.b.vue
+++ b/src/client/pages/welcome.entrance.b.vue
@@ -12,7 +12,7 @@
diff --git a/src/client/pages/welcome.entrance.c.vue b/src/client/pages/welcome.entrance.c.vue
index 2c8db6e264..bf1c9b1998 100644
--- a/src/client/pages/welcome.entrance.c.vue
+++ b/src/client/pages/welcome.entrance.c.vue
@@ -24,7 +24,7 @@
diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts
index 10842b8943..e79d54fa6d 100644
--- a/src/client/scripts/theme.ts
+++ b/src/client/scripts/theme.ts
@@ -25,6 +25,7 @@ export const builtinThemes = [
require('@client/themes/d-persimmon.json5'),
require('@client/themes/d-astro.json5'),
require('@client/themes/d-future.json5'),
+ require('@client/themes/d-botanical.json5'),
require('@client/themes/d-black.json5'),
] as Theme[];
@@ -91,6 +92,8 @@ function compile(theme: Theme): Record
{
case 'darken': return color.darken(arg);
case 'lighten': return color.lighten(arg);
case 'alpha': return color.setAlpha(arg);
+ case 'hue': return color.spin(arg);
+ case 'saturate': return color.saturate(arg);
}
}
diff --git a/src/client/themes/_dark.json5 b/src/client/themes/_dark.json5
index 22f4dc13d4..d8be16f60a 100644
--- a/src/client/themes/_dark.json5
+++ b/src/client/themes/_dark.json5
@@ -57,6 +57,8 @@
cwHoverBg: '#707b97',
buttonBg: 'rgba(255, 255, 255, 0.05)',
buttonHoverBg: 'rgba(255, 255, 255, 0.1)',
+ buttonGradateA: '@accent',
+ buttonGradateB: ':hue<20<@accent',
inputBorder: 'rgba(255, 255, 255, 0.1)',
inputBorderHover: 'rgba(255, 255, 255, 0.2)',
listItemHoverBg: 'rgba(255, 255, 255, 0.03)',
diff --git a/src/client/themes/_light.json5 b/src/client/themes/_light.json5
index 64b92dba8a..251aa36c7a 100644
--- a/src/client/themes/_light.json5
+++ b/src/client/themes/_light.json5
@@ -57,6 +57,8 @@
cwHoverBg: '#bbc4ce',
buttonBg: 'rgba(0, 0, 0, 0.05)',
buttonHoverBg: 'rgba(0, 0, 0, 0.1)',
+ buttonGradateA: '@accent',
+ buttonGradateB: ':hue<20<@accent',
inputBorder: 'rgba(0, 0, 0, 0.1)',
inputBorderHover: 'rgba(0, 0, 0, 0.2)',
listItemHoverBg: 'rgba(0, 0, 0, 0.03)',
diff --git a/src/client/themes/d-astro.json5 b/src/client/themes/d-astro.json5
index 08846dec20..2350e3d46d 100644
--- a/src/client/themes/d-astro.json5
+++ b/src/client/themes/d-astro.json5
@@ -46,6 +46,8 @@
navIndicator: '@accent',
accentLighten: ':lighten<10<@accent',
buttonHoverBg: 'rgba(255, 255, 255, 0.1)',
+ buttonGradateA: '@accent',
+ buttonGradateB: ':hue<-20<@accent',
driveFolderBg: ':alpha<0.3<@accent',
fgHighlighted: ':lighten<3<@fg',
panelHeaderBg: ':lighten<3<@panel',
diff --git a/src/client/themes/d-botanical.json5 b/src/client/themes/d-botanical.json5
new file mode 100644
index 0000000000..f3665e22b2
--- /dev/null
+++ b/src/client/themes/d-botanical.json5
@@ -0,0 +1,26 @@
+{
+ id: '504debaf-4912-6a4c-5059-1db08a76b737',
+
+ name: 'Mi Botanical Dark',
+ author: 'syuilo',
+
+ base: 'dark',
+
+ props: {
+ accent: 'rgb(148, 179, 0)',
+ bg: 'rgb(37, 38, 36)',
+ fg: 'rgb(216, 212, 199)',
+ fgHighlighted: '#fff',
+ divider: 'rgba(255, 255, 255, 0.14)',
+ panel: 'rgb(47, 47, 44)',
+ panelHeaderBg: '@panel',
+ panelHeaderDivider: '@divider',
+ header: ':alpha<0.7<@panel',
+ navBg: '#363636',
+ renote: '@accent',
+ mention: 'rgb(212, 153, 76)',
+ mentionMe: 'rgb(212, 210, 76)',
+ hashtag: 'rgb(76, 212, 180)',
+ link: '@accent',
+ },
+}
diff --git a/src/client/themes/d-future.json5 b/src/client/themes/d-future.json5
index 05ffe87bf0..1882609121 100644
--- a/src/client/themes/d-future.json5
+++ b/src/client/themes/d-future.json5
@@ -21,5 +21,7 @@
mentionMe: '@accent',
hashtag: '#70c0e8',
link: '#e88080',
+ buttonGradateA: '@accent',
+ buttonGradateB: ':saturate<30<:hue<30<@accent',
},
}
diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue
index 33aea31c39..d00327b096 100644
--- a/src/client/ui/_common_/sidebar.vue
+++ b/src/client/ui/_common_/sidebar.vue
@@ -372,7 +372,7 @@ export default defineComponent({
right: 0;
bottom: 0;
border-radius: 999px;
- background: var(--accent);
+ background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB));
}
&:hover, &.active {
diff --git a/src/client/ui/default.sidebar.vue b/src/client/ui/default.sidebar.vue
index 745ad2d602..e36febb7fa 100644
--- a/src/client/ui/default.sidebar.vue
+++ b/src/client/ui/default.sidebar.vue
@@ -4,7 +4,7 @@
-
+
{{ $ts.note }}
diff --git a/src/server/api/endpoints/blocking/create.ts b/src/server/api/endpoints/blocking/create.ts
index 1bf5cf374b..4deaa39974 100644
--- a/src/server/api/endpoints/blocking/create.ts
+++ b/src/server/api/endpoints/blocking/create.ts
@@ -43,6 +43,12 @@ export const meta = {
code: 'ALREADY_BLOCKING',
id: '787fed64-acb9-464a-82eb-afbd745b9614'
},
+
+ cannotBlockModerator: {
+ message: 'Cannot block a moderator or an admin.',
+ code: 'CANNOT_BLOCK_MODERATOR',
+ id: '8544aaef-89fb-e470-9f6c-385d38b474f5'
+ }
},
res: {
@@ -76,8 +82,12 @@ export default define(meta, async (ps, user) => {
throw new ApiError(meta.errors.alreadyBlocking);
}
- // Create blocking
- await create(blocker, blockee);
+ try {
+ await create(blocker, blockee);
+ } catch (e) {
+ if (e.id === 'e42b7890-5e4d-9d9c-d54b-cf4dd30adfb5') throw new ApiError(meta.errors.cannotBlockModerator);
+ throw e;
+ }
NoteWatchings.delete({
userId: blocker.id,
diff --git a/src/services/blocking/create.ts b/src/services/blocking/create.ts
index 76c4bda9dc..defe377514 100644
--- a/src/services/blocking/create.ts
+++ b/src/services/blocking/create.ts
@@ -9,8 +9,13 @@ import { User } from '@/models/entities/user';
import { Blockings, Users, FollowRequests, Followings, UserListJoinings, UserLists } from '@/models/index';
import { perUserFollowingChart } from '@/services/chart/index';
import { genId } from '@/misc/gen-id';
+import { IdentifiableError } from '@/misc/identifiable-error';
export default async function(blocker: User, blockee: User) {
+ if (blockee.isAdmin || blockee.isModerator) {
+ throw new IdentifiableError('e42b7890-5e4d-9d9c-d54b-cf4dd30adfb5');
+ }
+
await Promise.all([
cancelRequest(blocker, blockee),
cancelRequest(blockee, blocker),