|
|
@@ -29,7 +29,7 @@ listen('state', ({detail}) => { |
|
|
|
delete detail.kind |
|
|
|
Object.assign(State, detail) |
|
|
|
}) |
|
|
|
const doNotLog = new Set(['login', 'state', 'post', 'peerInfo', 'join', 'leave']) |
|
|
|
const doNotLog = new Set(['login', 'state', 'post', 'peerInfo']) |
|
|
|
/* |
|
|
|
* |
|
|
|
* UTILS |
|
|
@@ -58,12 +58,12 @@ const connect = (username) => { |
|
|
|
if(message.online) { |
|
|
|
const difference = (l1, l2) => l1.filter(u => !l2.includes(u)) |
|
|
|
difference(message.online, State.online).forEach(username => { |
|
|
|
if(username === State.username) return |
|
|
|
signal({kind: 'post', ts: message.ts, value: `${username} joined`}) |
|
|
|
signal({kind: 'join', username: username}) |
|
|
|
}) |
|
|
|
difference(State.online, message.online).forEach(username => { |
|
|
|
if(username === State.username) return |
|
|
|
signal({kind: 'post', ts: message.ts, value: `${username} left`}) |
|
|
|
signal({kind: 'leave', username: username}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|