/- gate=trill-gate |% +$ pid [ship=@p id=@da] +$ id @da +$ expiry @da +$ text @t +$ poll $: author=ship =time =expiry =text options=(list @t) =votes read=lock:gate write=lock:gate == +$ votes $% excl incl == +$ excl [%exc p=(map ship @ud)] +$ incl [%inc p=(map @ud (map @p (set @ud)))] :: some helpers ++ new-poll |= [=pid =text =expiry options=(list @t) inc=?] =/ votes ?. inc *excl *incl ^- poll :* author=-.pid time=+.pid expiry text options votes read=*lock:gate write=*lock:gate == :: comms +$ ui-action $% [%propose text=@t =expiry options=(list @t) exc=?] [%cancel =id] [%change-expiry =id =expiry] [%vote =pid option=@ comment=@t] [%cancel-vote =pid] == +$ update $% [%new-poll =poll] [%ded-poll p=pid] [%old-poll p=poll q=upd] == +$ upd $? [%new-vote p=@ud] [%expiry-changed q=expiry] [%vote-changed p=@p old=@ new=@] [%vote-canceled p=@p q=@] == --