mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-23 06:22:29 +00:00
20 lines
410 B
JavaScript
20 lines
410 B
JavaScript
'use strict';
|
|
|
|
const Encryption = require('orbit-common/lib/Encryption');
|
|
|
|
// Simplest type of post: a string
|
|
class TextPost {
|
|
constructor(content) {
|
|
this.content = content;
|
|
this.type = "text";
|
|
this.ts = new Date().getTime();
|
|
}
|
|
|
|
// TODO: make sure this works
|
|
encrypt(privkey, pubkey) {
|
|
this.content = Encryption.encrypt(this.content, privkey, pubkey);
|
|
}
|
|
}
|
|
|
|
module.exports = TextPost;
|