added comment hash identifier

This commit is contained in:
Anton Dyudin 2016-02-25 18:40:19 -08:00
parent a5a058d7da
commit 1cf56bd06b
3 changed files with 17 additions and 5 deletions

View File

@ -3,7 +3,7 @@
:: :: ::
/? 310
/- talk, sole
/+ talk, sole
/+ talk, sole, time-to-id
/= seed /~ !>(.)
::
::::
@ -1303,14 +1303,15 @@
[our.hid %hood]
[%write-comment pax src.hid txt]
==
=+ =+(xap=(flop pax) ?~(xap nam="/" nam=<i.xap>))
=+ =+(xap=(flop pax) ?~(xap nam="" nam=<i.xap>)) :: file name
=+ fra=(crip (time-to-id now.hid)) :: url fragment
%+ ra-record (main our.hid)
:^ src.hid (shaf %comt eny.hid)
[[[%& our.hid (main our.hid)] *envelope %pending] ~ ~]
:+ now.hid (sy /comment eyre+pax ~)
:- %mor :~
[%app %tree (crip "comment on {nam}")]
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] ~]]
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] `fra]]
[%app %tree (crip "comment on /{nam}")]
==
::
++ ra-know :: story monad

10
lib/time-to-id.hoon Normal file
View File

@ -0,0 +1,10 @@
:: Use lower bits of @da as hash identifier
::
:::: /hoon/time-to-id/lib
::
/? 310
!:
:::: ~fyr
::
|= a/time ^- tape
['c' (s-co:co f:(yell a))]

View File

@ -2,7 +2,7 @@
:::: /hoon/comments/tree/mar
::
/? 310
/+ react
/+ react, time-to-id
!:
::::
::
@ -15,6 +15,7 @@
%+ turn
(sort all |=({a/* b/*} (lor b a)))
|= {a/time b/manx} ^- ^json
=. a.g.b [id+(time-to-id a) a.g.b]
(jobe time+(jode a) body+(react-to-json:react b) ~)
--
++ grab |% :: convert from