(privateKey, userId)
| 223 | } |
| 224 | |
| 225 | async removeUser(privateKey, userId) { |
| 226 | const index = privateKey.users.findIndex(({userID: {userID}}) => userID === userId); |
| 227 | if (index !== -1) { |
| 228 | privateKey.users.splice(index, 1); |
| 229 | } |
| 230 | const fingerprint = privateKey.getFingerprint(); |
| 231 | const defaultKeyFpr = await this.keystore.getDefaultKeyFpr(); |
| 232 | const isDefault = fingerprint === defaultKeyFpr; |
| 233 | await this.removeKey(fingerprint, 'private'); |
| 234 | await this.sync.add(fingerprint, keyringSync.INSERT); |
| 235 | this.addKey(privateKey); |
| 236 | await this.keystore.store(); |
| 237 | await this.sync.commit(); |
| 238 | if (isDefault) { |
| 239 | await this.setDefaultKey(fingerprint); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | async revokeUser(unlockedKey, userId) { |
| 244 | const user = unlockedKey.users.find(({userID: {userID}}) => userID === userId); |
nothing calls this directly
no test coverage detected