diff --git a/doc/api.oa3 b/doc/api.oa3 index 98b8c7a6..89b53fef 100644 --- a/doc/api.oa3 +++ b/doc/api.oa3 @@ -4586,7 +4586,6 @@ components: - callerToken - calleeToken - keepAlive - - sturnPort properties: id: type: string @@ -4599,9 +4598,6 @@ components: keepAlive: type: integer format: int32 - sturnPort: - type: integer - format: int32 securitySchemes: diff --git a/net/server/internal/api_status.go b/net/server/internal/api_status.go index 78ffbd67..de3ce209 100644 --- a/net/server/internal/api_status.go +++ b/net/server/internal/api_status.go @@ -103,7 +103,7 @@ func Status(w http.ResponseWriter, r *http.Request) { } } -func getRevision(account *store.Account) Revision { +func getRevision(account *store.Account) Activity { var r Revision r.Account = account.AccountRevision r.Profile = account.ProfileRevision @@ -111,7 +111,10 @@ func getRevision(account *store.Account) Revision { r.Channel = account.ChannelRevision r.Group = account.GroupRevision r.Card = account.CardRevision - return r + + var a Activity + a.Revision = r + return a } //ExitStatus closes websocket handler diff --git a/net/server/internal/models.go b/net/server/internal/models.go index 2428d5d7..c2cc708c 100644 --- a/net/server/internal/models.go +++ b/net/server/internal/models.go @@ -393,6 +393,13 @@ type ProfileData struct { Location string `json:"location,omitempty"` } +//Activity listener for account +type Activity struct { + Revision Revision `json:"revision,emitempty"` + + Ring Ring `json:"ring",omitempty"` +} + //Revision revision of each account module type Revision struct { Account int64 `json:"account"` @@ -408,6 +415,13 @@ type Revision struct { Card int64 `json:"card"` } +//Ring from contact initiating call +type Ring struct { + CardID string `json:"cardId"` + + CalleeToken string `json:"calleeToken"` +} + //Seal key for channel sealing type Seal struct { PasswordSalt string `json:"passwordSalt"` diff --git a/net/server/internal/routers.go b/net/server/internal/routers.go index fee6ee68..c0902aec 100644 --- a/net/server/internal/routers.go +++ b/net/server/internal/routers.go @@ -797,13 +797,6 @@ var endpoints = routes{ Status, }, - route{ - "Activity", - strings.ToUpper("Get"), - "/activity", - Activity, - }, - route{ "AddCall", strings.ToUpper("Post"), diff --git a/net/web/src/context/useAppContext.hook.js b/net/web/src/context/useAppContext.hook.js index 7420b7dc..2d281a09 100644 --- a/net/web/src/context/useAppContext.hook.js +++ b/net/web/src/context/useAppContext.hook.js @@ -170,9 +170,11 @@ export function useAppContext(websocket) { ws.current = createWebsocket(protocol + window.location.host + "/status"); ws.current.onmessage = (ev) => { try { - let rev = JSON.parse(ev.data); + let activity = JSON.parse(ev.data); updateState({ status: 'connected' }); - setAppRevision(rev); + if (activity.revision) { + setAppRevision(activity.revision); + } } catch (err) { console.log(err);