diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-08-18 11:13:21 -0700 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-08-18 11:13:21 -0700 |
commit | 946379b16a68ffd636d8fed3925367cfa8e2e6f6 (patch) | |
tree | 00528a540c3df270122f4421cb765d57ad312a60 /lib/app.js | |
parent | 2e87d6f2847b51ee3828ea6fe18df2ebaf4957d3 (diff) | |
download | patchfoo-946379b16a68ffd636d8fed3925367cfa8e2e6f6.tar.gz patchfoo-946379b16a68ffd636d8fed3925367cfa8e2e6f6.zip |
Render some dark-crystal stuff
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1019,3 +1019,16 @@ App.prototype.getThread = function (msg) { }) ]) } + +App.prototype.getShard = function (id, cb) { + var self = this + this.getMsgDecrypted(id, function (err, msg) { + if (err) return cb(new Error('Unable to get shard message: ' + err.stack)) + var c = msg.value.content || {} + if (!c.shard) return cb(new Error('Message missing shard: ' + id)) + self.unboxContent(c.shard, function (err, shard) { + if (err) return cb(new Error('Unable to decrypt shard: ' + err.stack)) + cb(null, shard) + }) + }) +} |