Commit 07955dfb9c446a1c4f96ad6559ecf07c81511b0d
document cb arguments on openInvite
Dominic Tarr committed on 7/5/2019, 11:07:32 AMParent: 6868da9f177810f436109565b2ebf80b78fe44da
Files changed
README.md | changed |
README.md | |||
---|---|---|---|
@@ -120,9 +120,9 @@ | |||
120 | 120 … | If `allowWithoutPubs` is set, the invite will be created without finding any pubs. | |
121 | 121 … | if `pubs` is provided this will be used the invite's pubs. `pubs` should be a array | |
122 | 122 … | of multiserver addresses. | |
123 | 123 … | ||
124 | -### peerInvites.openInvite(invite, cb(err, invite_msg, content) | ||
124 … | +### peerInvites.openInvite(invite, cb(err, data)) | ||
125 | 125 … | ||
126 | 126 … | "open" an invite. retrives the invite message created by the host (using `peerInvites.create`) | |
127 | 127 … | and decrypt any encrypted values. since the invite may contain a welcome message, etc, | |
128 | 128 … | peer interfaces implementing peer interfaces should process peer-invites in two steps. | |
@@ -130,8 +130,20 @@ | |||
130 | 130 … | ||
131 | 131 … | calling openInvite will not publish a message, but may make a network connection | |
132 | 132 … | (if you do not already possess the `invite_msg` which you won't the first time) | |
133 | 133 … | ||
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 … | + | ||
134 | 146 … | ### peerInvites.acceptInvite(invite, cb) | |
135 | 147 … | ||
136 | 148 … | accept the invite. this publishes a `peer-invite/accept` message locally, | |
137 | 149 … | and then contacts a pub and asks them publish a `peer-invite/confirm` message. |
Built with git-ssb-web