2015-11-26 01:39:24 +03:00
|
|
|
::
|
2016-02-05 06:05:37 +03:00
|
|
|
:::: /hoon/ask/app
|
2015-11-26 01:39:24 +03:00
|
|
|
::
|
2016-02-18 01:57:46 +03:00
|
|
|
/? 310
|
2016-08-20 01:26:31 +03:00
|
|
|
/+ sole, womb
|
2015-11-26 01:39:24 +03:00
|
|
|
[. sole]
|
|
|
|
|%
|
|
|
|
++ card
|
2016-01-26 03:52:58 +03:00
|
|
|
$% {$diff $sole-effect sole-effect}
|
2016-08-20 02:41:32 +03:00
|
|
|
{$poke wire {ship $hood} $womb-invite {cord reference invite}:womb}
|
2015-11-26 01:39:24 +03:00
|
|
|
==
|
2016-08-19 04:10:55 +03:00
|
|
|
++ invited ?($new $sent $ignored)
|
|
|
|
++ email @t
|
2015-11-26 01:39:24 +03:00
|
|
|
--
|
|
|
|
!:
|
2016-08-20 01:26:31 +03:00
|
|
|
|_ {bow/bowl adr/(map email {time invited}) sos/(map bone sole-share) wom/(unit ship)}
|
|
|
|
++ prompt
|
2016-08-20 02:29:11 +03:00
|
|
|
^- sole-prompt
|
2016-08-20 01:26:31 +03:00
|
|
|
?~ wom [& %ask-ship ":womb-ship? ~"]
|
2016-08-20 02:29:11 +03:00
|
|
|
=/ new new-adrs
|
|
|
|
?~ new [& %$ "<listening> (0) [l,a,w,?]"]
|
|
|
|
[& %$ ": approve {<ask.i.new>}? ({<(lent new)>}) [y,n,l,a,w,?]"]
|
2016-08-20 01:26:31 +03:00
|
|
|
::
|
2015-11-26 01:39:24 +03:00
|
|
|
++ peer-sole
|
|
|
|
|= path
|
2016-01-26 03:52:58 +03:00
|
|
|
^- (quip {bone card} +>)
|
2015-11-26 01:39:24 +03:00
|
|
|
~| [%not-in-whitelist src.bow]
|
2016-08-20 01:26:31 +03:00
|
|
|
?> (~(has in (sy ~zod our.bow ~wisdyr-holpeg ~)) src.bow)
|
2015-11-26 01:39:24 +03:00
|
|
|
:_ +>.$(sos (~(put by sos) ost.bow *sole-share))
|
2016-08-20 01:26:31 +03:00
|
|
|
=- [(effect %mor pro+prompt -)]~
|
2015-11-26 01:39:24 +03:00
|
|
|
=+ all=adrs
|
2016-08-20 02:33:16 +03:00
|
|
|
[tan+(turn (flop all) message) (turn all put-mail)]
|
2015-11-26 01:39:24 +03:00
|
|
|
::
|
2016-08-20 02:29:11 +03:00
|
|
|
++ adrs
|
|
|
|
=- (sort - lor)
|
|
|
|
%+ turn (~(tap by adr))
|
|
|
|
|=({a/email b/time c/invited} [tym=b ask=a inv=c])
|
|
|
|
::
|
|
|
|
++ new-adrs (skim adrs |=({@ @ inv/invited} =(%new inv)))
|
2016-01-26 03:52:58 +03:00
|
|
|
++ effect |=(fec/sole-effect [ost.bow %diff %sole-effect fec])
|
2016-08-19 04:10:55 +03:00
|
|
|
++ message
|
|
|
|
|= {now/time ask/@t inv/invited} ^- tank
|
|
|
|
=. now (sub now (mod now ~s1))
|
|
|
|
leaf+"ask: {<inv>} {<now>} {(trip ask)}"
|
|
|
|
::
|
|
|
|
++ put-mail |=({@ ask/@t inv/invited} =+(pax=(rash ask unix-path) [%sav pax `@t`inv]))
|
2015-11-26 01:39:24 +03:00
|
|
|
++ unix-path :: split into path of "name" and "extension"
|
|
|
|
;~ (glue dot)
|
|
|
|
(cook crip (star ;~(less dot next)))
|
|
|
|
;~(plug (cook crip (star next)) (easy ~))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ poke-ask-mail
|
2016-01-26 03:52:58 +03:00
|
|
|
|= ask/@t
|
|
|
|
^- (quip {bone card} +>)
|
|
|
|
~| have-mail+ask
|
2016-08-19 04:10:55 +03:00
|
|
|
?< (~(has by adr) ask)
|
2016-08-20 02:29:11 +03:00
|
|
|
=. adr (~(put by adr) ask now.bow %new) :: XX electroplating
|
|
|
|
:_ +>.$
|
2016-08-19 04:10:55 +03:00
|
|
|
=/ new [now.bow ask %new]
|
2016-08-20 02:29:11 +03:00
|
|
|
=+ [mez=[(message new)]~ pro=prompt sav=(put-mail new)]
|
2015-11-26 01:39:24 +03:00
|
|
|
%+ turn (prey /sole bow)
|
2016-08-20 02:29:11 +03:00
|
|
|
|=({ost/bone ^} (effect(ost.bow ost) %mor tan+mez pro+prompt sav ~))
|
2015-11-26 01:39:24 +03:00
|
|
|
::
|
|
|
|
++ poke-sole-action
|
2016-01-26 03:52:58 +03:00
|
|
|
|= act/sole-action
|
2016-08-20 01:26:31 +03:00
|
|
|
^- (quip {bone card} +>)
|
|
|
|
=/ som (~(got by sos) ost.bow)
|
|
|
|
?- -.act
|
|
|
|
$clr `+>.$
|
|
|
|
$ret
|
|
|
|
?^ wom [[(effect mor+help)]~ +>.$] :: show help
|
2016-08-20 01:41:48 +03:00
|
|
|
?: =(~ buf.som) [[(effect txt+"Please enter womb ship")]~ +>.$]
|
2016-08-20 01:26:31 +03:00
|
|
|
=/ try (rose (tufa buf.som) fed:ag)
|
|
|
|
?. ?=({$& ^} try)
|
|
|
|
[[(effect bel+~)]~ +>.$]
|
|
|
|
=> .(wom p.try) :: XX TMI
|
2016-08-20 01:41:48 +03:00
|
|
|
(transmit set+~ pro+prompt ~) :: XX handle multiple links?
|
2016-08-20 01:26:31 +03:00
|
|
|
::
|
|
|
|
$det :: reject all input
|
|
|
|
=^ inv som (~(transceive sole som) +.act)
|
2016-08-20 01:41:48 +03:00
|
|
|
=. sos (~(put by sos) ost.bow som)
|
2016-08-20 01:26:31 +03:00
|
|
|
?~ wom
|
|
|
|
=/ try (rose (tufa buf.som) fed:ag)
|
2016-08-20 01:41:48 +03:00
|
|
|
?: -.try `+>.$
|
|
|
|
(transmit inv bel+~ ~)
|
|
|
|
?: =(`*`"?" buf.som) (transmit inv help)
|
2016-08-20 02:33:16 +03:00
|
|
|
?: =(`*`"a" buf.som) (transmit inv tan+(turn (flop adrs) message) ~)
|
|
|
|
?: =(`*`"l" buf.som) (transmit inv tan+(turn (flop new-adrs) message) ~)
|
|
|
|
?: =(`*`"n" buf.som)
|
|
|
|
=/ new new-adrs
|
|
|
|
?~ new (transmit inv bel+~ ~)
|
|
|
|
=. inv.i.new %ignored
|
|
|
|
=. adr (~(put by adr) ask.i.new [tym inv]:i.new)
|
|
|
|
(transmit inv tan+[(message i.new)]~ pro+prompt ~)
|
2016-08-20 02:41:32 +03:00
|
|
|
?: =(`*`"y" buf.som)
|
|
|
|
=/ new new-adrs
|
|
|
|
?~ new (transmit inv bel+~ ~)
|
|
|
|
=. inv.i.new %sent :: XX pending
|
|
|
|
=- [[(invite ask.i.new) -<] ->]
|
|
|
|
=. adr (~(put by adr) ask.i.new [tym inv]:i.new)
|
|
|
|
(transmit inv tan+[(message i.new)]~ pro+prompt ~)
|
2016-08-20 01:42:04 +03:00
|
|
|
?: =(`*`"w" buf.som)
|
|
|
|
=> .(wom ~) :: XX TMI
|
|
|
|
(transmit inv pro+prompt ~)
|
2016-08-20 02:29:11 +03:00
|
|
|
(transmit inv bel+~ ~)
|
2015-11-26 01:39:24 +03:00
|
|
|
==
|
2016-08-20 01:41:48 +03:00
|
|
|
++ transmit
|
|
|
|
|= {inv/sole-edit mor/(list sole-effect)}
|
|
|
|
=/ som (~(got by sos) ost.bow)
|
|
|
|
=^ det som (~(transmit sole som) inv)
|
|
|
|
=. sos (~(put by sos) ost.bow som)
|
|
|
|
[[(effect mor+[det+det mor])]~ +>.$]
|
2016-08-20 00:36:09 +03:00
|
|
|
::
|
2016-08-19 04:10:55 +03:00
|
|
|
++ help
|
|
|
|
^- (list sole-effect)
|
|
|
|
=- (scan - (more (just '\0a') (stag %txt (star prn))))
|
2016-08-20 02:29:11 +03:00
|
|
|
%+ welp
|
|
|
|
?~ [new-adrs] ""
|
|
|
|
"""
|
|
|
|
y - invite current ask
|
|
|
|
n - ignore current ask
|
|
|
|
|
|
|
|
"""
|
2016-08-19 04:10:55 +03:00
|
|
|
"""
|
2016-08-20 00:36:09 +03:00
|
|
|
l - list new asks
|
2016-08-19 22:37:09 +03:00
|
|
|
a - list all asks
|
2016-08-20 01:42:04 +03:00
|
|
|
w - reset womb ship
|
2016-08-19 22:37:09 +03:00
|
|
|
? - print help
|
2016-08-19 04:10:55 +03:00
|
|
|
"""
|
2016-08-20 01:26:31 +03:00
|
|
|
::
|
|
|
|
++ invite
|
2016-08-20 02:29:11 +03:00
|
|
|
|= ask/email
|
2016-08-20 02:41:32 +03:00
|
|
|
:- ost.bow
|
|
|
|
^- card
|
|
|
|
:^ %poke /invite/(scot %t ask) [(need wom) %hood]
|
2016-08-20 01:26:31 +03:00
|
|
|
:- %womb-invite
|
|
|
|
^- {cord reference invite}:womb
|
|
|
|
=+ inv=(scot %uv (end 7 1 eny.bow))
|
2016-08-20 02:29:11 +03:00
|
|
|
[inv `&+our.bow [ask 1 0 "You have been invited to Urbit: {(trip inv)}" ""]]
|
2015-11-26 01:39:24 +03:00
|
|
|
--
|