diff options
-rw-r--r-- | lib/app.js | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -343,9 +343,19 @@ App.prototype.getNameSync = function (name) { return about && about.name } +function sbotGet(sbot, id, cb) { + // try sbot.get via ssb-ooo a50da3928500f3ac0fbead0a1b335a3dd5bbc096 first + sbot.get({id: id, raw: true}, function (err, value) { + if (err && err.message === 'Param 0 must by of type number') { + return sbot.get(id, cb) + } + cb(err, value) + }) +} + function getMsgWithValue(sbot, id, cb) { if (!id) return cb() - sbot.get(id, function (err, value) { + sbotGet(sbot, id, function (err, value) { if (err) return cb(err) cb(null, {key: id, value: value}) }) |