MCPcopy Create free account
hub / github.com/mscdex/ssh2 / userBroadcast

Function userBroadcast

examples/server-chat.js:30–41  ·  view source on GitHub ↗
(msg, source)

Source from the content-addressed store, hash-verified

28}
29
30function userBroadcast(msg, source) {
31 const sourceMsg = `> ${msg}`;
32 const name = `{cyan-fg}{bold}${source.name}{/}`;
33 msg = `: ${msg}`;
34 for (const user of users) {
35 const output = user.output;
36 if (source === user)
37 output.add(sourceMsg);
38 else
39 output.add(formatMessage(name, output) + msg);
40 }
41}
42
43function localMessage(msg, source) {
44 const output = source.output;

Callers 1

server-chat.jsFile · 0.85

Calls 2

formatMessageFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…