MCPcopy
hub / github.com/mailvelope/mailvelope / add

Method add

src/modules/keyringSync.js:42–58  ·  view source on GitHub ↗
(keyFpr, type)

Source from the content-addressed store, hash-verified

40 }
41
42 async add(keyFpr, type) {
43 await this.initialized;
44 if (!this.data || this.muted) {
45 return;
46 }
47 if (!(type === INSERT || type === DELETE || type === UPDATE)) {
48 throw new Error('Unknown log entry type');
49 }
50 this.data.modified = true;
51 if (type === UPDATE) {
52 return;
53 }
54 this.data.changeLog[keyFpr] = {
55 type,
56 time: Math.floor(Date.now() / 1000)
57 };
58 }
59
60 async save() {
61 await this.initialized;

Callers 15

test-harness.jsFile · 0.80
importPublicKeyMethod · 0.80
importPrivateKeyMethod · 0.80
removeKeyMethod · 0.80
removeUserMethod · 0.80
revokeUserMethod · 0.80
addUserMethod · 0.80
updateKeyMethod · 0.80
setKeyPwdMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected