summaryrefslogtreecommitdiff
path: root/desk/sur/post.hoon
blob: 75f2aa3843639dc7e6abe6ce2dbcbfaf2cc4f2bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/-  gate
|%
+$  id  @da
+$  pid  [=ship =id]
:: anon post type?
+$  tag  @t
+$  post
  $:  =id
      host=ship
      author=ship
      thread=id
      parent=(unit id)
      children=(set id)
      contents=content-map
      read=lock:gate
      write=lock:gate
      =engagement
      =hash
      =signature
      tags=(set tag) ::TODO  make sure it's not infinite
  ==
+$  sent-post
  $:  host=ship
      author=ship
      thread=(unit id)
      parent=(unit id)
      contents=content-list
      read=lock:gate
      write=lock:gate
      tags=(set tag) 
  ==
+$  full-node
  $:  =id
      host=ship
      author=ship
      thread=id
      parent=(unit id)
      children=internal-graph
      contents=content-map
      read=lock:gate
      write=lock:gate
      =engagement
      =hash
      =signature
      tags=(set tag) 
  ==
::  recursive types crash
+$  internal-graph
  $~  [%empty ~]
  $%  [%full p=full-graph] 
      [%empty ~]
  ==
+$  full-graph  ((mop id full-node) gth)
++  form  ((on id full-node) gth)
::  from post:graph-store
::  +sham (half sha-256) hash of +validated-portion
+$  hash  @uvH
::
+$  signature   [p=@uvH q=ship r=life]
+$  engagement
  $:
    =reacts
    quoted=(set signed-pid)
    shared=(set signed-pid)
  ==
+$  signed-pid  [=signature =pid]
+$  react  @t
+$  reacts  (map ship signed-react-2)
+$  signed-react  [=pid author=ship =react =signature]
+$  signed-react-2  [p=react q=signature]


+$  content-map  ((mop time content-list) gth)
++  corm  ((on time content-list) gth)
+$  content-list  contents:contents-1
+$  li     content-list
++  contents-1
|%
+$  contents  (list block)
+$  block
  $%  [%paragraph p=(list inline)]
      [%blockquote p=(list inline)]
      [%table rows=(list (list contents))]
      [%heading p=cord q=@]
      [%list p=(list inline) ordered=?]
      [%media =media]
      [%codeblock code=cord lang=cord]
      [%eval hoon=cord]
      ::
      [%ref type=term =ship =path]
      ::
      [%json origin=term content=@t]
      :: TODO get rid of this. should be a ref
      [%poll id=@da]
  ==
+$  poll-opt  [option=cord votes=@]
+$  media
  $%  [%images p=(list cord)]
      [%video p=cord]
      [%audio p=cord]
  ==
+$  inline
  $%  [%text p=cord]
      [%italic p=cord]
      [%bold p=cord]
      [%strike p=cord]
      [%codespan p=cord]
      [%link href=cord show=cord]
      [%break ~]
      :: not strictly markdown
      [%underline p=cord]
      [%sup p=cord]
      [%sub p=cord]
      [%ruby p=cord q=cord]
      :: custom types
      [%ship p=ship]
      :: TODO
      :: [%date p=@da]
  ==
--
--