MCPcopy Create free account
hub / github.com/codecombat/codecombat / addFriend

Method addFriend

app/lib/wsBus.js:161–168  ·  view source on GitHub ↗
(id, { role = 'friend', online = false } = {})

Source from the content-addressed store, hash-verified

159 }
160
161 addFriend (id, { role = 'friend', online = false } = {}) {
162 const state = { role, online }
163 let oldFriend = {}
164 if (id in this.wsInfos.friends) {
165 oldFriend = this.wsInfos.friends[id]
166 }
167 this.wsInfos.friends[id] = _.assign(state, oldFriend) // do not override the friend here
168 }
169
170 updateOnlineFriends (friends) {
171 friends.forEach(f => {

Callers 2

resetWSInfosMethod · 0.95
onLoadedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected