MCPcopy Create free account
hub / github.com/ShareDropio/sharedrop / _onRoomUserChanged

Function _onRoomUserChanged

app/controllers/index.js:57–74  ·  view source on GitHub ↗
(event, data)

Source from the content-addressed store, hash-verified

55 },
56
57 _onRoomUserChanged(event, data) {
58 const peers = this.model;
59 const peer = peers.findBy('uuid', data.uuid);
60 const peerAttrs = data.peer;
61 const defaults = {
62 uuid: null,
63 public_ip: null,
64 };
65
66 if (peer) {
67 // eslint-disable-next-line no-param-reassign
68 delete data.peer;
69 // Firebase doesn't return keys with null values,
70 // so we have to add them back.
71 peer.setProperties($.extend({}, defaults, data));
72 peer.get('peer').setProperties(peerAttrs);
73 }
74 },
75
76 _onRoomUserRemoved(event, data) {
77 const peers = this.model;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected