mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-05-17 21:16:33 +02:00
Add methods to send internal messages.
This commit is contained in:
parent
e101e74672
commit
7d9970713d
|
@ -474,6 +474,42 @@ func (c *TestClient) SendControl(recipient MessageClientMessageRecipient, data i
|
||||||
return c.WriteJSON(message)
|
return c.WriteJSON(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *TestClient) SendInternalAddSession(msg *AddSessionInternalClientMessage) error {
|
||||||
|
message := &ClientMessage{
|
||||||
|
Id: "abcd",
|
||||||
|
Type: "internal",
|
||||||
|
Internal: &InternalClientMessage{
|
||||||
|
Type: "addsession",
|
||||||
|
AddSession: msg,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return c.WriteJSON(message)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *TestClient) SendInternalUpdateSession(msg *UpdateSessionInternalClientMessage) error {
|
||||||
|
message := &ClientMessage{
|
||||||
|
Id: "abcd",
|
||||||
|
Type: "internal",
|
||||||
|
Internal: &InternalClientMessage{
|
||||||
|
Type: "updatesession",
|
||||||
|
UpdateSession: msg,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return c.WriteJSON(message)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *TestClient) SendInternalRemoveSession(msg *RemoveSessionInternalClientMessage) error {
|
||||||
|
message := &ClientMessage{
|
||||||
|
Id: "abcd",
|
||||||
|
Type: "internal",
|
||||||
|
Internal: &InternalClientMessage{
|
||||||
|
Type: "removesession",
|
||||||
|
RemoveSession: msg,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return c.WriteJSON(message)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *TestClient) SetTransientData(key string, value interface{}) error {
|
func (c *TestClient) SetTransientData(key string, value interface{}) error {
|
||||||
payload, err := json.Marshal(value)
|
payload, err := json.Marshal(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue