function localHandle
localHandle(
handle: string,
isSelfHost: (host: string) => boolean
): string

Returns handle as this instance writes it, isSelfHost telling its own host. Another instance writes a user from here with this one's host, bob@gerbeur.example, who is bob here: a mention or a link copied from there names them so. Any other handle is returned as it is. The server resolves names by it (resolveUsername, the mention notifications), and the chat's highlight (mentionsUser) reads mentions by it.

Parameters

handle: string
isSelfHost: (host: string) => boolean

Return Type

string

Usage

import { localHandle } from "shared/validation.ts";