mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-29 02:40:03 +02:00
Compare commits
No commits in common. "32a2f822e008997eaa1a8ea6b7fb44dc361adb16" and "ddb7ece62244131b2eec3a91c8d4df074665d2b0" have entirely different histories.
32a2f822e0
...
ddb7ece622
|
@ -79,7 +79,7 @@ type CapabilitiesVersion struct {
|
|||
|
||||
type CapabilitiesResponse struct {
|
||||
Version CapabilitiesVersion `json:"version"`
|
||||
Capabilities map[string]*json.RawMessage `json:"capabilities"`
|
||||
Capabilities map[string]map[string]interface{} `json:"capabilities"`
|
||||
}
|
||||
|
||||
func (c *Capabilities) getCapabilities(key string) (map[string]interface{}, bool) {
|
||||
|
@ -174,18 +174,12 @@ func (c *Capabilities) loadCapabilities(ctx context.Context, u *url.URL) (map[st
|
|||
return nil, err
|
||||
}
|
||||
|
||||
capaObj, found := response.Capabilities[AppNameSpreed]
|
||||
if !found || capaObj == nil {
|
||||
capa, found := response.Capabilities[AppNameSpreed]
|
||||
if !found {
|
||||
log.Printf("No capabilities received for app spreed from %s: %+v", capUrl.String(), response)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var capa map[string]interface{}
|
||||
if err := json.Unmarshal(*capaObj, &capa); err != nil {
|
||||
log.Printf("Unsupported capabilities received for app spreed from %s: %+v", capUrl.String(), response)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
log.Printf("Received capabilities %+v from %s", capa, capUrl.String())
|
||||
c.setCapabilities(key, capa)
|
||||
return capa, nil
|
||||
|
|
|
@ -69,18 +69,15 @@ func NewCapabilitiesForTest(t *testing.T) (*url.URL, *Capabilities) {
|
|||
config := map[string]interface{}{
|
||||
"signaling": signaling,
|
||||
}
|
||||
spreedCapa, _ := json.Marshal(map[string]interface{}{
|
||||
"features": features,
|
||||
"config": config,
|
||||
})
|
||||
emptyArray := []byte("[]")
|
||||
response := &CapabilitiesResponse{
|
||||
Version: CapabilitiesVersion{
|
||||
Major: 20,
|
||||
},
|
||||
Capabilities: map[string]*json.RawMessage{
|
||||
"anotherApp": (*json.RawMessage)(&emptyArray),
|
||||
"spreed": (*json.RawMessage)(&spreedCapa),
|
||||
Capabilities: map[string]map[string]interface{}{
|
||||
"spreed": {
|
||||
"features": features,
|
||||
"config": config,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
11
hub_test.go
11
hub_test.go
|
@ -420,16 +420,15 @@ func registerBackendHandlerUrl(t *testing.T, router *mux.Router, url string) {
|
|||
if strings.Contains(t.Name(), "MultiRoom") {
|
||||
signaling[ConfigKeySessionPingLimit] = 2
|
||||
}
|
||||
spreedCapa, _ := json.Marshal(map[string]interface{}{
|
||||
"features": features,
|
||||
"config": config,
|
||||
})
|
||||
response := &CapabilitiesResponse{
|
||||
Version: CapabilitiesVersion{
|
||||
Major: 20,
|
||||
},
|
||||
Capabilities: map[string]*json.RawMessage{
|
||||
"spreed": (*json.RawMessage)(&spreedCapa),
|
||||
Capabilities: map[string]map[string]interface{}{
|
||||
"spreed": {
|
||||
"features": features,
|
||||
"config": config,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue