git ssb

0+

Dominic / ssb-peer-invites



Commit 07955dfb9c446a1c4f96ad6559ecf07c81511b0d

document cb arguments on openInvite

Dominic Tarr committed on 7/5/2019, 11:07:32 AM
Parent: 6868da9f177810f436109565b2ebf80b78fe44da

Files changed

README.mdchanged
README.mdView
@@ -120,9 +120,9 @@
120120 If `allowWithoutPubs` is set, the invite will be created without finding any pubs.
121121 if `pubs` is provided this will be used the invite's pubs. `pubs` should be a array
122122 of multiserver addresses.
123123
124-### peerInvites.openInvite(invite, cb(err, invite_msg, content)
124 +### peerInvites.openInvite(invite, cb(err, data))
125125
126126 "open" an invite. retrives the invite message created by the host (using `peerInvites.create`)
127127 and decrypt any encrypted values. since the invite may contain a welcome message, etc,
128128 peer interfaces implementing peer interfaces should process peer-invites in two steps.
@@ -130,8 +130,20 @@
130130
131131 calling openInvite will not publish a message, but may make a network connection
132132 (if you do not already possess the `invite_msg` which you won't the first time)
133133
134 +the if the invite validated, the data argument is provided.
135 +```
136 +data = {
137 + key: invite_id, //id of the invite message
138 + value: invite_msg, //the raw invite message itself
139 + opened: {
140 + private: ..., //private message from host (may be null)
141 + reveal: ... //message to be revealed from host (may be null)
142 + }
143 +}
144 +```
145 +
134146 ### peerInvites.acceptInvite(invite, cb)
135147
136148 accept the invite. this publishes a `peer-invite/accept` message locally,
137149 and then contacts a pub and asks them publish a `peer-invite/confirm` message.

Built with git-ssb-web