aboutsummaryrefslogtreecommitdiff
path: root/lib/app.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-08-18 11:13:21 -0700
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-08-18 11:13:21 -0700
commit946379b16a68ffd636d8fed3925367cfa8e2e6f6 (patch)
tree00528a540c3df270122f4421cb765d57ad312a60 /lib/app.js
parent2e87d6f2847b51ee3828ea6fe18df2ebaf4957d3 (diff)
downloadpatchfoo-946379b16a68ffd636d8fed3925367cfa8e2e6f6.tar.gz
patchfoo-946379b16a68ffd636d8fed3925367cfa8e2e6f6.zip
Render some dark-crystal stuff
Diffstat (limited to 'lib/app.js')
-rw-r--r--lib/app.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/app.js b/lib/app.js
index b63a13e..5b3035a 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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)
+ })
+ })
+}