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.images = {
...config.images,
info: '/twemoji/1f440.svg',
notFound: '/twemoji/2049.svg',
error: '/twemoji/1f480.svg',
};
mixin.version = meta.version;
mixin.host = url.host;
mixin.hostname = url.hostname;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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