fix: typos

This commit is contained in:
omahs 2023-08-11 11:38:25 +02:00 committed by GitHub
parent 74ca563594
commit 147ae8f939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,10 +146,10 @@ be sent or received in *pokes* (one-off messages):
- `%withdraw`: delete a poll.
We'll also define an `update` structure, which wil be the kinds of events that
We'll also define an `update` structure, which will be the kinds of events that
subscribers may be notified about:
- `%init`: given the intial polls and their state to a new subscriber.
- `%init`: given the initial polls and their state to a new subscriber.
- `%vote`: someone has voted on a poll.
- `%new`: someone has created a new poll.
- `%withdraw`: someone has withdrawn an existing poll.
@ -317,12 +317,12 @@ groups we're a member of. It additionally handles group updates from the
`%squad` agent. In the former case, the events we'll receive will contain
`update`s, which we'll process in a similar manner to the `action`s in
`on-poke`. All incoming votes will be validated here also. In the latter case,
we'll receive `%squad` `upd` updates, such as members joining or leave groups,
we'll receive `%squad` `upd` updates, such as members joining or leaving groups,
and we'll handle them as appropriate.
We differentiate between these two cases by testing the `wire`, which is a
message tag we set when we initially subscribed. For `%squad` updates it will be
`/squad`, and for the rest it'll be the group ID we've subscribe to.
`/squad`, and for the rest it'll be the group ID we've subscribed to.
#### The code
@ -428,7 +428,7 @@ Gall agents live in the `/app` directory of a desk, so save this code in
%1 `this(state old)
%0 `this(state [%1 by-group.old voted.old withdrawn.old %subs])
==
:: on-poke handles "pokes", which are one-off requests/actions intiated
:: on-poke handles "pokes", which are one-off requests/actions initiated
:: locally or by remote ships. If it's a %tally-action we call
:: a handle-action function, and if it's a %handle-http-request from the
:: front-end we call the handle-http function
@ -454,7 +454,7 @@ Gall agents live in the `/app` directory of a desk, so save this code in
?. authenticated.req
:_ state(section %subs)
(give-http:hc rid [307 ['Location' '/~/login?redirect='] ~] ~)
:: otherwise, switch on the method, prodicing a 405 response for
:: otherwise, switch on the method, producing a 405 response for
:: unhandled methods
::
?+ method.request.req
@ -616,7 +616,7 @@ Gall agents live in the `/app` directory of a desk, so save this code in
:: calculate the expiry data
::
=/ expiry=@da (add now.bol (yule days.act 0 0 0 ~))
:: retreive all polls from state for this gid
:: retrieve all polls from state for this gid
::
=/ polls=(map pid [=poll =votes])
(fall (~(get by by-group) gid.act) *(map pid [=poll =votes]))
@ -647,7 +647,7 @@ Gall agents live in the `/app` directory of a desk, so save this code in
:: vote on a poll
::
%vote
:: retreive the target poll from state
:: retrieve the target poll from state
::
=/ [=poll =votes] (~(got bi by-group) gid.act pid.act)
:: make sure it hasn't expired
@ -737,7 +737,7 @@ Gall agents live in the `/app` directory of a desk, so save this code in
?> ?| =(our.bol src.bol)
&(=(src.bol creator.poll) (gte expiry.poll now.bol))
==
:: update state and notify subscribers of the withdrawl
:: update state and notify subscribers of the withdrawal
::
:_ %= state
by-group (~(del bi by-group) gid.act pid.act)
@ -777,7 +777,7 @@ Gall agents live in the `/app` directory of a desk, so save this code in
(fall (~(get by by-group) gid) *(map pid [=poll =votes]))
==
:: on-agent handles either responses to requests we've
:: initated or subscription updates from people or agents
:: initiated or subscription updates from people or agents
:: to which we've previously subscribed
::
++ on-agent
@ -1329,7 +1329,7 @@ Save the code below in `tally/app/tally/index.hoon`.
==
==
==
:: we retreive a list of all squads and sort them
:: we retrieve a list of all squads and sort them
:: alphabetically by title
::
=/ all-squads=(list (pair gid squad))