From f261284117ebd8f67f3537ccdddef185966688bb Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 13 Dec 2017 19:09:00 -0800 Subject: [PATCH] get creation-time out of marks --- app/collections.hoon | 40 ++++++++++++++++++++---------------- mar/collections/comment.hoon | 6 ++---- mar/collections/topic.hoon | 6 ++---- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/collections.hoon b/app/collections.hoon index 44e7fd4824..52a22e1f58 100644 --- a/app/collections.hoon +++ b/app/collections.hoon @@ -57,7 +57,6 @@ == :: ++ comment :: $: who/ship :: author - wen/@da :: created wed/@da :: editted wat/wain :: content == :: @@ -116,12 +115,15 @@ ::[~ ..prep(+<+ u.old)] :: ++ poke-noun - |= a=?(~ @da) + |= a=$@(?(~ @da) [p=@da q=@da]) ^- (quip move _+>) ~& %poked + =< ta-done ?~ a - ta-done:(ta-create:ta %fora ['a description' pub=& vis=& [~palzod ~ ~]]) - ta-done:(ta-submit:ta a 'a topic' ~['with contents']) + (ta-create:ta %fora ['a description' pub=& vis=& [~palzod ~ ~]]) + ?@ a + (ta-submit:ta a 'a topic' ~['with contents']) + (ta-comment:ta p.a q.a now.bol ~['a comment' 'yo']) :: ++ writ |= {wir/wire rit/riot:clay} @@ -200,8 +202,8 @@ :: ++ ta-submit |= {col/time tit/cord wat/wain} - =/ top/topic [tit src.bol now.bol now.bol wat] - (ta-change-topic col top %poke) + =/ top/topic [tit src.bol now.bol wat] + (ta-change-topic col now.bol top %poke) :: ++ ta-comment |= {col/time top/@da com/@da wat/wain} @@ -211,10 +213,11 @@ ?. (~(has by tops.cos) top) +>.$ =/ old/comment %+ fall (get-comment col top com) - [src.bol now.bol now.bol wat] + [src.bol now.bol wat] ?. =(who.old src.bol) +>.$ :: error? %^ ta-write-comment col top - [who.old wen.old now.bol wat] + :- com + [who.old now.bol wat] :: ++ ta-delete |= col/time @@ -288,9 +291,9 @@ == :: ++ ta-change-topic - |= {col/time top/topic src/?($file $poke)} + |= {col/time wen/@da top/topic src/?($file $poke)} ^+ +> - =/ old (get-topic col wen.top) + =/ old (get-topic col wen) :: only original poster and host can edit. ?. |(?=(~ old) =(who.u.old src.bol) ?=($file src)) +>.$ :: @@ -298,15 +301,16 @@ =? who.top ?=($poke src) src.bol :: ensure legit author =. wed.top now.bol :: change last edit date :: store in state + ~| ~(key by cols) =/ cos (~(got by cols) col) - =. tops.cos (~(put by tops.cos) wen.top top) + =. tops.cos (~(put by tops.cos) wen top) =. cols (~(put by cols) col cos) :: =/ new =(~ old) =? +>.$ new - (ta-hall-create-topic col wen.top conf.cos) - =. +>.$ (ta-write-topic col top) - (ta-hall-notify col wen.top ~ new wat.top) + (ta-hall-create-topic col wen conf.cos) + =. +>.$ (ta-write-topic col wen top) + (ta-hall-notify col wen ~ new wat.top) :: ::REVIEW never called ::++ ta-change-comment @@ -339,17 +343,17 @@ [%collections-config !>(cof)] :: ++ ta-write-topic - |= {col/time top/topic} + |= {col/time wen/@da top/topic} ^+ +> %^ ta-write /topic - (dray /[%da]/[%da] col wen.top) + (dray /[%da]/[%da] col wen) [%collections-topic !>(top)] :: ++ ta-write-comment - |= {col/time top/@da com/comment} + |= {col/time top/@da wen/@da com/comment} ^+ +> %^ ta-write /comment - (dray /[%da]/[%da]/[%da] col top wen.com) + (dray /[%da]/[%da]/[%da] col top wen) [%collections-comment !>(com)] :: :: %hall-changes diff --git a/mar/collections/comment.hoon b/mar/collections/comment.hoon index 9dce6b7706..5941e98f20 100644 --- a/mar/collections/comment.hoon +++ b/mar/collections/comment.hoon @@ -2,7 +2,6 @@ :: |_ $= com $: who/ship :: author - wen/@da :: created wed/@da :: editted wat/wain :: content == :: @@ -15,7 +14,7 @@ (of-wain:format txt) ++ txt ^- (list @t) - :- (crip <[by=who.com on=wen.com ed=wed.com]>) + :- (crip <[by=who.com ed=wed.com]>) wat.com -- :: @@ -31,12 +30,11 @@ %- %- hard $: %cltr [%ktts %by [%sand %p who=@p]] - [%ktts %on [%sand %da wen=@da]] [%ktts %ed [%sand %da wed=@da]] ~ == (ream inf.txs) - [who.inf wen.inf wed.inf wat.txs] + [who.inf wed.inf wat.txs] -- ++ grad %txt -- diff --git a/mar/collections/topic.hoon b/mar/collections/topic.hoon index ee51155c8d..38bfddb2e7 100644 --- a/mar/collections/topic.hoon +++ b/mar/collections/topic.hoon @@ -3,7 +3,6 @@ |_ $= top $: tit/cord :: title who/ship :: author - wen/@da :: created wed/@da :: editted wat/wain :: content == :: @@ -17,7 +16,7 @@ ++ txt ^- (list @t) :+ (cat 3 '> ' tit.top) - (crip <[by=who.top on=wen.top ed=wed.top]>) + (crip <[by=who.top ed=wed.top]>) wat.top -- :: @@ -35,12 +34,11 @@ %- %- hard $: %cltr [%ktts %by [%sand %p who=@p]] - [%ktts %on [%sand %da wen=@da]] [%ktts %ed [%sand %da wed=@da]] ~ == (ream inf.txs) - [tit who.inf wen.inf wed.inf wat.txs] + [tit who.inf wed.inf wat.txs] -- ++ grad %txt --