(id, { role = 'friend', online = false } = {})
| 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 => { |
no outgoing calls
no test coverage detected