link-store: ensure latest-first ordering of state

We may %hear or %read content that was posted some time ago, so we need
to make sure we add it at the appropriate position (wrt timestamp)
rather than just sticking it at the head of the list.
This commit is contained in:
Fang 2020-02-18 16:00:50 +01:00
parent bf789b987c
commit 583c3dc364
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -320,7 +320,8 @@
:: add link to group submissions
::
=/ =links (~(gut by by-group) path *links)
=. submissions.links [submission submissions.links]
=. submissions.links
(submissions:merge submissions.links ~[submission])
=. by-group (~(put by by-group) path links)
:: add submission to global sites
::
@ -345,7 +346,8 @@
::
=/ urls (~(gut by discussions) path *(map ^url discussion))
=/ =discussion (~(gut by urls) url *discussion)
=. comments.discussion [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