mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
chat-store: include msg sequence nrs in update
It was filling the number.envelope prior to adding the envelope to the mailbox, but wasn't actually including that change in the %message(s) update that was getting sent out. This makes +append-envelope return both the updated mailbox _and_ the modified envelope, which we then use in our outgoing update.
This commit is contained in:
parent
346ac24a91
commit
9b5bc80016
@ -190,8 +190,8 @@
|
||||
?~ mailbox
|
||||
[~ state]
|
||||
=. letter.envelope.act (evaluate-letter [author letter]:envelope.act)
|
||||
=. u.mailbox (append-envelope u.mailbox envelope.act)
|
||||
:- (send-diff path.act act)
|
||||
=^ envelope u.mailbox (append-envelope u.mailbox envelope.act)
|
||||
:- (send-diff path.act act(envelope envelope))
|
||||
state(inbox (~(put by inbox) path.act u.mailbox))
|
||||
::
|
||||
++ handle-messages
|
||||
@ -213,8 +213,8 @@
|
||||
evaluated-envelopes
|
||||
==
|
||||
=. letter.i.envelopes.act (evaluate-letter [author letter]:i.envelopes.act)
|
||||
=. evaluated-envelopes (snoc evaluated-envelopes i.envelopes.act)
|
||||
=. u.mailbox (append-envelope u.mailbox i.envelopes.act)
|
||||
=^ envelope u.mailbox (append-envelope u.mailbox i.envelopes.act)
|
||||
=. evaluated-envelopes (snoc evaluated-envelopes envelope)
|
||||
$(envelopes.act t.envelopes.act)
|
||||
::
|
||||
++ handle-read
|
||||
@ -242,12 +242,12 @@
|
||||
::
|
||||
++ append-envelope
|
||||
|= [=mailbox =envelope]
|
||||
^- ^mailbox
|
||||
^+ [envelope mailbox]
|
||||
=. number.envelope +(length.config.mailbox)
|
||||
=: length.config.mailbox +(length.config.mailbox)
|
||||
envelopes.mailbox (snoc envelopes.mailbox envelope)
|
||||
==
|
||||
mailbox
|
||||
[envelope mailbox]
|
||||
::
|
||||
++ update-subscribers
|
||||
|= [pax=path update=chat-update]
|
||||
|
Loading…
Reference in New Issue
Block a user