|
|
@@ -1,5 +1,6 @@
|
|
|
import crypto = require('libp2p-crypto');
|
|
|
import WebSocket from 'ws';
|
|
|
+import { ContactItem } from './contact-item';
|
|
|
import { ContentItem } from './content-item';
|
|
|
import { ContentParams } from './content-params';
|
|
|
import RsaPrivateKey = crypto.keys;
|
|
|
@@ -7,7 +8,6 @@ import { Storage } from './storage';
|
|
|
import { UploadItemParameters } from './upload-item-parameters';
|
|
|
import { encodeHex, mergeDeep, uuid } from './util';
|
|
|
import { IWebClient } from './webclient';
|
|
|
-import { ContactItem } from './contact-item';
|
|
|
|
|
|
export class BankClient {
|
|
|
|
|
|
@@ -182,7 +182,7 @@ export class BankClient {
|
|
|
return uploadResponse.hash;
|
|
|
}
|
|
|
|
|
|
- public async appendPrivate(dontLogToAll: boolean, peerAddr: string, topic: string, hash?: string, replaceHash?: string, deleteHash?: string) {
|
|
|
+ public async appendPrivate(peerAddr: string, topic: string, hash?: string, replaceHash?: string, deleteHash?: string) {
|
|
|
const nonce = await this.getNonce();
|
|
|
const payload = await this.makePlaintextPayload(JSON.stringify({
|
|
|
_date: new Date().toISOString(),
|
|
|
@@ -200,9 +200,6 @@ export class BankClient {
|
|
|
method: 'PUT',
|
|
|
url: topicURL
|
|
|
});
|
|
|
- if (!dontLogToAll && topic !== 'all' && !deleteHash) {
|
|
|
- await this.appendPrivate(true, peerAddr, 'all', hash, undefined, undefined);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public async retrievePrivate(peerAddr: string, topic: string) {
|
|
|
@@ -243,7 +240,7 @@ export class BankClient {
|
|
|
id: contactId
|
|
|
};
|
|
|
const newItemHash = await this.uploadSlimJSON(newItem);
|
|
|
- await this.appendPrivate(true, peerId, '📇', newItemHash);
|
|
|
+ await this.appendPrivate(peerId, '📇', newItemHash);
|
|
|
return await this.getContactById(peerId, contactId);
|
|
|
}
|
|
|
|
|
|
@@ -269,7 +266,7 @@ export class BankClient {
|
|
|
const newItem: any = mergeDeep(existing, newProps);
|
|
|
delete newItem.hash;
|
|
|
const newItemHash = await this.uploadSlimJSON(newItem);
|
|
|
- await this.appendPrivate(true, peerId, '📇', newItemHash, existing.hash);
|
|
|
+ await this.appendPrivate(peerId, '📇', newItemHash, existing.hash);
|
|
|
return await this.getContactById(peerId, contactId);
|
|
|
}
|
|
|
|