Skip to content

Commit

Permalink
contacts: refactor activity
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajpp committed Nov 20, 2024
1 parent ded2e68 commit 0889599
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 387 deletions.
22 changes: 12 additions & 10 deletions desk/app/contacts.hoon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/+ default-agent, dbug, verb, neg=negotiate, activity
/- activity
/+ default-agent, dbug, verb, neg=negotiate
/+ *contacts
::
:: performance, keep warm
Expand Down Expand Up @@ -103,7 +104,7 @@
++ pass-activity
|= [who=ship field=(pair @tas value)]
^- card
=/ =cage activity-action+!>([%add %contact who field])
=/ =cage activity-action+!>(`action:activity`[%add %contact who field])
[%pass /activity %agent [our.bowl %activity] %poke cage]
::
:: +pub: publication management
Expand Down Expand Up @@ -377,6 +378,7 @@
?~ val
[(pass-activity who field) cards]
?< ?=(~ u.val)
::NOTE currently shouldn't happen in practice
?. =(-.q.field -.u.val) cards
?: =(p.q.field p.u.val) cards
?. ?=(%set -.q.field)
Expand Down Expand Up @@ -772,17 +774,17 @@
[%contact ~]
si-abet:(si-take:(sub src.bowl) wire sign)
::
[%migrate ~]
?> ?=(%poke-ack -.sign)
?~ p.sign cor
%- (slog leaf/"{<wire>} failed" u.p.sign)
[%migrate ~]
?> ?=(%poke-ack -.sign)
?~ p.sign cor
%- (slog leaf/"{<wire>} failed" u.p.sign)
cor
::
[%activity ~]
cor
[%activity ~]
cor
::
[%epic ~]
cor
[%epic ~]
cor
==
::
++ arvo
Expand Down
Loading

0 comments on commit 0889599

Please sign in to comment.