chat: /primary path provides truncated initial as well as updates

This commit is contained in:
Logan Allen 2019-10-08 10:41:06 -07:00
parent fbbb3830b2
commit 536dcdc4f4
3 changed files with 6 additions and 22 deletions

View File

@ -1,3 +1,4 @@
:: chat-view: sets up chat JS client, paginates data, and combines commands
:: into semantic actions for the UI
::
@ -177,23 +178,14 @@
::
==
::
++ peer-initial
++ peer-primary
|= pax=path
^- (quip move _this)
?> (team:title our.bol src.bol)
:: create inbox with 100 messages max per mailbox and send that along
:: then quit the subscription
:_ this
:~ [ost.bol %diff %json (inbox-to-json (truncate-inbox all-scry))]
[ost.bol %quit ~]
==
::
++ peer-updates
|= pax=path
^- (quip move _this)
?> (team:title our.bol src.bol)
:: send along all subsequent updates
[~ this]
[ost.bol %diff %json (inbox-to-json (truncate-inbox all-scry))]~
::
++ peer-configs
|= pax=path
@ -209,7 +201,7 @@
=/ configs-json (configs-to-json configs-scry)
:_ this
%+ weld
%+ turn (prey:pubsub:userlib /updates bol)
%+ turn (prey:pubsub:userlib /primary bol)
|= [=bone *]
[bone %diff %json updates-json]
%+ turn (prey:pubsub:userlib /configs bol)

File diff suppressed because one or more lines are too long

View File

@ -14,11 +14,7 @@ export class Subscription {
}
initializeChat() {
api.bind('/initial', 'PUT', api.authTokens.ship, 'chat-view',
this.handleEvent.bind(this),
this.handleError.bind(this),
this.handleQuitSilently.bind(this));
api.bind('/updates', 'PUT', api.authTokens.ship, 'chat-view',
api.bind('/primary', 'PUT', api.authTokens.ship, 'chat-view',
this.handleEvent.bind(this),
this.handleError.bind(this),
this.handleQuitAndResubscribe.bind(this));
@ -30,10 +26,6 @@ export class Subscription {
this.handleEvent.bind(this),
this.handleError.bind(this),
this.handleQuitAndResubscribe.bind(this));
api.bind('/all', 'PUT', api.authTokens.ship, 'invite-store',
this.handleEvent.bind(this),
this.handleError.bind(this),
this.handleQuitAndResubscribe.bind(this));
}
handleEvent(diff) {