mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
link-store: don't send update if not new
We were taking care not to re-add something to our data store if we already had it in there, but were still sending out an update regardless. With this, we only send out an update if we weren't previously aware of the content.
This commit is contained in:
parent
16b4e2e8e4
commit
073b86be15
@ -320,7 +320,10 @@
|
||||
:: add link to group submissions
|
||||
::
|
||||
=/ =links (~(gut by by-group) path *links)
|
||||
=. submissions.links
|
||||
=^ added submissions.links
|
||||
?: ?=(^ (find ~[submission] submissions.links))
|
||||
[| submissions.links]
|
||||
:- &
|
||||
(submissions:merge submissions.links ~[submission])
|
||||
=. by-group (~(put by by-group) path links)
|
||||
:: add submission to global sites
|
||||
@ -330,6 +333,7 @@
|
||||
:: send updates to subscribers
|
||||
::
|
||||
:_ state
|
||||
?. added ~
|
||||
:_ ~
|
||||
:+ %give %fact
|
||||
:+ :~ /submissions
|
||||
@ -346,13 +350,17 @@
|
||||
::
|
||||
=/ urls (~(gut by discussions) path *(map ^url discussion))
|
||||
=/ =discussion (~(gut by urls) url *discussion)
|
||||
=. comments.discussion
|
||||
=^ added comments.discussion
|
||||
?: ?=(^ (find ~[comment] comments.discussion))
|
||||
[| comments.discussion]
|
||||
:- &
|
||||
(comments:merge comments.discussion ~[comment])
|
||||
=. urls (~(put by urls) url discussion)
|
||||
=. discussions (~(put by discussions) path urls)
|
||||
:: send updates to subscribers
|
||||
::
|
||||
:_ state
|
||||
?. added ~
|
||||
:_ ~
|
||||
:+ %give %fact
|
||||
:+ :~ /discussions
|
||||
|
Loading…
Reference in New Issue
Block a user