From 80badf493afca026bc542260f353210e605a1715 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 6 Dec 2021 16:53:00 +0100 Subject: Add mute status in account and channel pages --- server/helpers/actors.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 server/helpers/actors.ts (limited to 'server/helpers') diff --git a/server/helpers/actors.ts b/server/helpers/actors.ts new file mode 100644 index 000000000..c31fe6f8e --- /dev/null +++ b/server/helpers/actors.ts @@ -0,0 +1,17 @@ +import { WEBSERVER } from '@server/initializers/constants' + +function handleToNameAndHost (handle: string) { + let [ name, host ] = handle.split('@') + if (host === WEBSERVER.HOST) host = null + + return { name, host, handle } +} + +function handlesToNameAndHost (handles: string[]) { + return handles.map(h => handleToNameAndHost(h)) +} + +export { + handleToNameAndHost, + handlesToNameAndHost +} -- cgit v1.2.3