Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

569 B
Raw Blame
import type { RoomInteraction } from "./room-interactions";

/** Export received text only: no invite, peer IDs, reactions or pending sends. */
export function formatChatTranscript(messages: readonly RoomInteraction[]): string {
  const lines = messages.flatMap(message => message.payload.kind === "chat"
    ? [`[${new Date(message.occurredAt).toISOString()}] ${message.sender.displayName}`, message.payload.text, ""]
    : []);
  // Explicit UTF-8 signature and CRLF also work in older Windows text viewers.
  return "\uFEFFPiik chat\r\n\r\n" + lines.join("\r\n");
}