diff options
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) + }) + }) +} |