git ssb

0+

Dominic / ssb-peer-invites



Commit cb6fe8cf24dfda94e22f981ad9074b4edae061df

callback only one argument

Dominic Tarr committed on 7/5/2019, 11:04:02 AM
Parent: bce59c4f224d391e32a96cf60834cc9707a0a871

Files changed

index.jschanged
index.jsView
@@ -449,9 +449,13 @@
449449 //UPDATE REDUCE STATE.
450450 // this is a wee bit naughty, because if you rebuild the index it might not have this invite
451451 // (until you replicate it, but when you do the value won't change)
452452 state.set(reduce(state.value, {key: invite_id, value:msg}, invites.since.value))
453- cb(null, msg, opened)
453 + cb(null, {
454 + key: invite_id,
455 + value: msg,
456 + opened: opened
457 + })
454458 }
455459 })
456460 }
457461
@@ -465,9 +469,12 @@
465469 //or if the acceptance has been publish, but not yet confirmed.
466470 getAccept(invite_id, function (err, accept) {
467471 if(accept) next(accept)
468472 else {
469- invites.openInvite(invite, function (err, invite_msg, opened) {
473 + invites.openInvite(invite, function (err, data) {
474 + if(err) return cb(err)
475 + var invite_msg = data.value
476 + var opened = data.opened
470477 sbot.identities.publishAs({
471478 id: id,
472479 content: I.createAccept(invite_msg, invite.seed, id, caps)
473480 }, function (err, accept) {

Built with git-ssb-web