|
54 | 54 | open-describes=(set token:reel)
|
55 | 55 | stable-id=(map cord token:reel)
|
56 | 56 | ==
|
| 57 | +++ flag ;~((glue fas) ;~(pfix sig fed:ag) sym) |
57 | 58 | :: url with old style token
|
58 | 59 | ++ url-for-token
|
59 | 60 | |= [vic=cord token=cord]
|
|
79 | 80 | =/ old !<(versioned-state old-state)
|
80 | 81 | ?- -.old
|
81 | 82 | %4
|
82 |
| - `this(state old) |
| 83 | + =. state old |
| 84 | + =^ new-md stable-id |
| 85 | + %+ roll |
| 86 | + ~(tap by our-metadata) |
| 87 | + |= [[=token:reel =metadata:reel] [md=_our-metadata id=_stable-id]] |
| 88 | + ?^ (slaw %uv token) [md id] |
| 89 | + ?^ (rush token flag) |
| 90 | + :- md |
| 91 | + ?: (~(has by id) token) id |
| 92 | + (~(put by id) token token) |
| 93 | + =/ new (rap 3 (scot %p our.bowl) '/' token ~) |
| 94 | + :- (~(put by md) new metadata) |
| 95 | + (~(put by id) new new) |
| 96 | + `this(our-metadata new-md) |
83 | 97 | %3
|
84 | 98 | `this(state [%4 vic.old civ.old our-metadata.old outstanding-pokes.old ~ ~])
|
85 | 99 | %2
|
|
174 | 188 | %reel-want-token-link
|
175 | 189 | =+ !<(=token:reel vase)
|
176 | 190 | :_ this
|
| 191 | + =/ full-token |
| 192 | + ?^ (rush token flag) token |
| 193 | + (rap 3 (scot %p our.bowl) '/' token ~) |
177 | 194 | =/ result=(unit [cord cord])
|
178 |
| - ?. (~(has by our-metadata) token) `[token ''] |
179 |
| - `[token (url-for-token vic token)] |
| 195 | + ?. (~(has by our-metadata) full-token) `[full-token ''] |
| 196 | + `[full-token (url-for-token vic full-token)] |
180 | 197 | ~[[%pass [%token-link-want token ~] %agent [src dap]:bowl %poke %reel-give-token-link !>(result)]]
|
181 | 198 | %reel-give-token-link
|
182 | 199 | =+ !<(result=(unit [cord cord]) vase)
|
183 | 200 | ?~ result `this
|
184 | 201 | :_ this
|
185 | 202 | =/ [token=cord url=cord] u.result
|
186 |
| - ?: =('' url) |
187 |
| - ~[[%give %fact ~[[%token-link (scot %p src.bowl) token ~]] %json !>(~)]] |
188 |
| - ~[[%give %fact ~[[%token-link (scot %p src.bowl) token ~]] %json !>(s+url)]] |
| 203 | + =/ path (stab (cat 3 '/token-link/' token)) |
| 204 | + ~[[%give %fact ~[path] %json !>(?:(=('' url) ~ s+url))]] |
189 | 205 | ==
|
190 | 206 | ::
|
191 | 207 | ++ on-agent
|
|
0 commit comments