PageSourceSearch

https://pooled.run/room/visibility.js

js pooled.run collected 2026-10-09 22:55:14 UTC 760 bytes, 16 lines download raw bytes

1// Who sees the chat text. Every device in the chain still computes the answer; this only decides
2// which screens get the question and the streamed answer. DOM-free so it can be unit tested.
3//   all   — everyone in the room
4//   host  — only the host's screen
5//   asker — the host's screen and the device that asked (by peer id, names are not unique)
6export const VISIBILITY = ["all", "host", "asker"];
7
8// ids: every connected peer. Returns who gets the full message and who gets the hidden stand-in.
9export function chatRecipients(mode, askerId, ids) {
10  const full = [], hidden = [];
11  for (const id of ids) {
12    if (mode === "all" || (mode === "asker" && id === askerId)) full.push(id);
13    else hidden.push(id);
14  }
15  return { full, hidden };
16}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.