Switch to emoji status images (related: #42)

This commit is contained in:
Laura Hausmann 2023-08-31 01:09:20 +02:00
parent 17630facd8
commit 50d09a4c66
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
20 changed files with 63 additions and 18 deletions

View File

@ -44,6 +44,13 @@ export default function load() {
config.port = config.port || parseInt(process.env.PORT || "", 10); config.port = config.port || parseInt(process.env.PORT || "", 10);
config.images = {
...config.images,
info: '/twemoji/1f440.svg',
notFound: '/twemoji/2049.svg',
error: '/twemoji/1f480.svg',
};
mixin.version = meta.version; mixin.version = meta.version;
mixin.host = url.host; mixin.host = url.host;
mixin.hostname = url.hostname; mixin.hostname = url.hostname;

View File

@ -66,6 +66,12 @@ export type Source = {
keepHeaders?: boolean; keepHeaders?: boolean;
}; };
images?: {
error?: string;
notFound?: string;
info?: string;
};
proxy?: string; proxy?: string;
proxySmtp?: string; proxySmtp?: string;
proxyBypassHosts?: string[]; proxyBypassHosts?: string[];

View File

@ -4,6 +4,7 @@ import { Users, UserProfiles } from "@/models/index.js";
import { ApiError } from "../../error.js"; import { ApiError } from "../../error.js";
import { sendEmail } from "@/services/send-email.js"; import { sendEmail } from "@/services/send-email.js";
import { createNotification } from "@/services/create-notification.js"; import { createNotification } from "@/services/create-notification.js";
import config from "@/config/index.js";
export const meta = { export const meta = {
tags: ["users"], tags: ["users"],
@ -49,7 +50,7 @@ export default define(meta, paramDef, async (ps) => {
createNotification(user.id, "app", { createNotification(user.id, "app", {
customBody: ps.comment, customBody: ps.comment,
customHeader: "Moderation Notice", customHeader: "Moderation Notice",
customIcon: "/static-assets/badges/info.png", customIcon: config?.images?.info,
}); });
setImmediate(async () => { setImmediate(async () => {

View File

@ -269,6 +269,15 @@ export const meta = {
optional: false, optional: false,
nullable: true, nullable: true,
}, },
images: {
type: 'object',
optional: false, nullable: false,
properties: {
info: { type: 'string' },
notFound: { type: 'string' },
error: { type: 'string' },
},
},
features: { features: {
type: "object", type: "object",
optional: true, optional: true,
@ -441,6 +450,8 @@ export default define(meta, paramDef, async (ps, me) => {
? JSON.stringify(JSON5.parse(instance.defaultDarkTheme)) ? JSON.stringify(JSON5.parse(instance.defaultDarkTheme))
: null, : null,
images: config.images,
enableEmail: instance.enableEmail, enableEmail: instance.enableEmail,
enableTwitterIntegration: instance.enableTwitterIntegration, enableTwitterIntegration: instance.enableTwitterIntegration,

View File

@ -28,9 +28,9 @@ html
link(rel='icon' href= icon || `/favicon.ico?${ timestamp }`) link(rel='icon' href= icon || `/favicon.ico?${ timestamp }`)
link(rel='apple-touch-icon' href= icon || `/apple-touch-icon.png?${ timestamp }`) link(rel='apple-touch-icon' href= icon || `/apple-touch-icon.png?${ timestamp }`)
link(rel='manifest' href='/manifest.json') link(rel='manifest' href='/manifest.json')
link(rel='prefetch' href=`/static-assets/badges/info.png?${ timestamp }`) link(rel='prefetch' href=config.images.info)
link(rel='prefetch' href=`/static-assets/badges/not-found.png?${ timestamp }`) link(rel='prefetch' href=config.images.notFound)
link(rel='prefetch' href=`/static-assets/badges/error.png?${ timestamp }`) link(rel='prefetch' href=config.images.error)
link(rel='stylesheet' href=`/static-assets/instance.css?${ timestamp }`) link(rel='stylesheet' href=`/static-assets/instance.css?${ timestamp }`)
link(rel='modulepreload' href=`/assets/${clientEntry.file}`) link(rel='modulepreload' href=`/assets/${clientEntry.file}`)

View File

@ -3,7 +3,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/not-found.png" :src="instance.images.notFound"
class="_ghost" class="_ghost"
:alt="i18n.ts.notFound" :alt="i18n.ts.notFound"
/> />
@ -27,6 +27,7 @@ import MkChannelPreview from "@/components/MkChannelPreview.vue";
import type { Paging } from "@/components/MkPagination.vue"; import type { Paging } from "@/components/MkPagination.vue";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import {instance} from "@/instance";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{

View File

@ -3,7 +3,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -41,6 +41,7 @@ import XList from "@/components/MkDateSeparatedList.vue";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { scroll } from "@/scripts/scroll"; import { scroll } from "@/scripts/scroll";
import {instance} from "@/instance";
const tlEl = ref<HTMLElement>(); const tlEl = ref<HTMLElement>();

View File

@ -3,7 +3,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -63,6 +63,7 @@ import * as os from "@/os";
import { stream } from "@/stream"; import { stream } from "@/stream";
import { $i } from "@/account"; import { $i } from "@/account";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import {instance} from "@/instance";
const props = defineProps<{ const props = defineProps<{
includeTypes?: (typeof notificationTypes)[number][]; includeTypes?: (typeof notificationTypes)[number][];

View File

@ -8,7 +8,7 @@
<slot name="empty"> <slot name="empty">
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Error" alt="Error"
/> />
@ -84,6 +84,7 @@ import {
} from "@/scripts/scroll"; } from "@/scripts/scroll";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import {instance} from "@/instance";
export type Paging< export type Paging<
E extends keyof misskey.Endpoints = keyof misskey.Endpoints, E extends keyof misskey.Endpoints = keyof misskey.Endpoints,

View File

@ -3,7 +3,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -30,6 +30,7 @@ import MkUserInfo from "@/components/MkUserInfo.vue";
import MkPagination, { Paging } from "@/components/MkPagination.vue"; import MkPagination, { Paging } from "@/components/MkPagination.vue";
import { userPage } from "@/filters/user"; import { userPage } from "@/filters/user";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import {instance} from "@/instance";
const props = defineProps<{ const props = defineProps<{
pagination: Paging; pagination: Paging;

View File

@ -2,7 +2,7 @@
<transition :name="$store.state.animation ? 'zoom' : ''" appear> <transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div class="mjndxjcg"> <div class="mjndxjcg">
<img <img
src="/static-assets/badges/error.png" :src="instance.images.error"
class="_ghost" class="_ghost"
alt="Error" alt="Error"
/> />
@ -20,6 +20,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance";
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -3,7 +3,7 @@
<transition :name="$store.state.animation ? 'zoom' : ''" appear> <transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div v-show="loaded" class="mjndxjch"> <div v-show="loaded" class="mjndxjch">
<img <img
src="/static-assets/badges/error.png" :src="instance.images.error"
class="_ghost" class="_ghost"
alt="Error" alt="Error"
/> />
@ -43,6 +43,8 @@ import * as os from "@/os";
import { unisonReload } from "@/scripts/unison-reload"; import { unisonReload } from "@/scripts/unison-reload";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import { instance } from "@/instance";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{

View File

@ -6,7 +6,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -40,6 +40,7 @@ import XNote from "@/components/MkNote.vue";
import XList from "@/components/MkDateSeparatedList.vue"; import XList from "@/components/MkDateSeparatedList.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import {instance} from "@/instance";
const pagination = { const pagination = {
endpoint: "i/favorites" as const, endpoint: "i/favorites" as const,

View File

@ -6,7 +6,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
aria-label="none" aria-label="none"
class="_ghost" class="_ghost"
/> />
@ -89,6 +89,7 @@ import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import { $i } from "@/account"; import { $i } from "@/account";
import {instance} from "@/instance";
const paginationComponent = ref<InstanceType<typeof MkPagination>>(); const paginationComponent = ref<InstanceType<typeof MkPagination>>();

View File

@ -17,7 +17,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -116,6 +116,7 @@ import { i18n } from "@/i18n";
import { $i } from "@/account"; import { $i } from "@/account";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import {instance} from "@/instance";
const props = defineProps<{ const props = defineProps<{
userAcct?: string; userAcct?: string;

View File

@ -2,7 +2,7 @@
<transition :name="$store.state.animation ? 'zoom' : ''" appear> <transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div :class="$style.root"> <div :class="$style.root">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Error" alt="Error"
/> />
@ -16,6 +16,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import {instance} from "@/instance";
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View File

@ -2,7 +2,7 @@
<div class="ipledcug"> <div class="ipledcug">
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/not-found.png" :src="instance.images.notFound"
class="_ghost" class="_ghost"
alt="Not found" alt="Not found"
/> />
@ -14,6 +14,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import { instance } from "@/instance";
const headerActions = $computed(() => []); const headerActions = $computed(() => []);

View File

@ -32,7 +32,7 @@
<transition :name="$store.state.animation ? 'zoom' : ''" appear> <transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div class="_fullinfo" ref="notes"> <div class="_fullinfo" ref="notes">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -69,6 +69,7 @@ import { deviceKind } from "@/scripts/device-kind";
import { $i } from "@/account"; import { $i } from "@/account";
import "swiper/scss"; import "swiper/scss";
import "swiper/scss/virtual"; import "swiper/scss/virtual";
import {instance} from "@/instance";
const props = defineProps<{ const props = defineProps<{
query: string; query: string;

View File

@ -4,7 +4,7 @@
<template #empty> <template #empty>
<div class="_fullinfo"> <div class="_fullinfo">
<img <img
src="/static-assets/badges/info.png" :src="instance.images.info"
class="_ghost" class="_ghost"
alt="Info" alt="Info"
/> />
@ -60,6 +60,7 @@ import FormPagination from "@/components/MkPagination.vue";
import * as os from "@/os"; import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import {instance} from "@/instance";
const list = ref<any>(null); const list = ref<any>(null);

View File

@ -301,6 +301,11 @@ export type LiteInstanceMetadata = {
enableDiscordIntegration: boolean; enableDiscordIntegration: boolean;
enableServiceWorker: boolean; enableServiceWorker: boolean;
emojis: CustomEmoji[]; emojis: CustomEmoji[];
images: {
error: string;
notFound: string;
info: string;
};
}; };
export type DetailedInstanceMetadata = LiteInstanceMetadata & { export type DetailedInstanceMetadata = LiteInstanceMetadata & {