summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mrexodia/wray/response.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-04-05 23:39:15 +0200
committerGitHub <noreply@github.com>2023-04-05 23:39:15 +0200
commit89b0d362d29179b389b203e046b22b5b6e5f8310 (patch)
tree87e68ae33885d3de4a2c6a78a6afc6822ab7dd3e /vendor/github.com/mrexodia/wray/response.go
parent574f25337df2a3a7dbfa18093a4fcbe056b8824b (diff)
downloadmatterbridge-msglm-89b0d362d29179b389b203e046b22b5b6e5f8310.tar.gz
matterbridge-msglm-89b0d362d29179b389b203e046b22b5b6e5f8310.tar.bz2
matterbridge-msglm-89b0d362d29179b389b203e046b22b5b6e5f8310.zip
Remove gitter bridge (#2035)
See https://blog.gitter.im/2023/02/13/gitter-has-fully-migrated-to-matrix/
Diffstat (limited to 'vendor/github.com/mrexodia/wray/response.go')
-rw-r--r--vendor/github.com/mrexodia/wray/response.go61
1 files changed, 0 insertions, 61 deletions
diff --git a/vendor/github.com/mrexodia/wray/response.go b/vendor/github.com/mrexodia/wray/response.go
deleted file mode 100644
index e9815c3f..00000000
--- a/vendor/github.com/mrexodia/wray/response.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package wray
-
-type Response struct {
- id string
- channel string
- successful bool
- clientId string
- supportedConnectionTypes []string
- messages []Message
- error error
-}
-
-type Message struct {
- Channel string
- Id string
- Data map[string]interface{}
-}
-
-func newResponse(data []interface{}) Response {
- headerData := data[0].(map[string]interface{})
- messagesData := data[1.:]
- messages := parseMessages(messagesData)
- var id string
- if headerData["id"] != nil {
- id = headerData["id"].(string)
- }
- supportedConnectionTypes := []string{}
- if headerData["supportedConnectionTypes"] != nil {
- d := headerData["supportedConnectionTypes"].([]interface{})
- for _, sct := range(d) {
- supportedConnectionTypes = append(supportedConnectionTypes, sct.(string))
- }
- }
- var clientId string
- if headerData["clientId"] != nil {
- clientId = headerData["clientId"].(string)
- }
- return Response{id: id,
- clientId: clientId,
- channel: headerData["channel"].(string),
- successful: headerData["successful"].(bool),
- messages: messages,
- supportedConnectionTypes: supportedConnectionTypes}
-}
-
-func parseMessages(data []interface{}) []Message {
- messages := []Message{}
- for _, messageData := range(data) {
- m := messageData.(map[string]interface{})
- var id string
- if m["id"] != nil {
- id = m["id"].(string)
- }
- message := Message{Channel: m["channel"].(string),
- Id: id,
- Data: m["data"].(map[string]interface{})}
- messages = append(messages, message)
- }
- return messages
-}
-