mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
reparing ring indicator for webrtc
This commit is contained in:
parent
9084ca4196
commit
7b689d0343
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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"`
|
||||
|
@ -797,13 +797,6 @@ var endpoints = routes{
|
||||
Status,
|
||||
},
|
||||
|
||||
route{
|
||||
"Activity",
|
||||
strings.ToUpper("Get"),
|
||||
"/activity",
|
||||
Activity,
|
||||
},
|
||||
|
||||
route{
|
||||
"AddCall",
|
||||
strings.ToUpper("Post"),
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user