|
@@ -144,7 +144,7 @@ export class WriteTweetPage {
|
|
console.log("yes in if");
|
|
console.log("yes in if");
|
|
loading.setContent("Publish private tweet...");
|
|
loading.setContent("Publish private tweet...");
|
|
let result = await this.tweetPrivate();
|
|
let result = await this.tweetPrivate();
|
|
- console.log("this result is", result, result.data);
|
|
|
|
|
|
+ // console.log("this result is", result, result.data);
|
|
|
|
|
|
// this.storeIPFS(result);
|
|
// this.storeIPFS(result);
|
|
|
|
|
|
@@ -176,14 +176,15 @@ export class WriteTweetPage {
|
|
console.log('private tweet is:', tweet.full_text);
|
|
console.log('private tweet is:', tweet.full_text);
|
|
const privateKey = await this.storage.get("privateKey");
|
|
const privateKey = await this.storage.get("privateKey");
|
|
//fetch followers and their public keys
|
|
//fetch followers and their public keys
|
|
- //assuming the email id of rohit.shiva.gowda
|
|
|
|
- await this.opnpgp.lookupKeys("rohit.hosn@gmail.com");
|
|
|
|
- await this.opnpgp.lookupKeys("rohit.shiva.gowda@gmail.com");
|
|
|
|
|
|
+ //encrypting for self
|
|
|
|
+ let email = await this.storage.get("email");
|
|
|
|
+ await this.opnpgp.lookupKeys(email);
|
|
|
|
+ // await this.opnpgp.lookupKeys("rohit.shiva.gowda@gmail.com");
|
|
//encrypt the tweet with multiple keys
|
|
//encrypt the tweet with multiple keys
|
|
- let encryptedTweet = await this.opnpgp.encrypt(tweet.full_text);
|
|
|
|
|
|
+ let encryptedTweet = await this.opnpgp.encrypt(JSON.stringify(tweet));
|
|
|
|
|
|
this.storeIPFS(encryptedTweet, tweet)
|
|
this.storeIPFS(encryptedTweet, tweet)
|
|
- return await this.opnpgp.encrypt(tweet.full_text);
|
|
|
|
|
|
+ return encryptedTweet;
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|