|
@@ -2,7 +2,6 @@ package pubsub
|
|
|
|
|
|
import (
|
|
|
"net/url"
|
|
|
- "strings"
|
|
|
"sync"
|
|
|
"time"
|
|
|
|
|
@@ -118,8 +117,8 @@ func (c *Connection) listenTopis() {
|
|
|
for topic := range c.topics {
|
|
|
topics = append(topics, topic)
|
|
|
}
|
|
|
- msg := `{"type":"LISTEN","nonce":"","data":{"topics":["` + strings.Join(topics, `","`) + `"]}}`
|
|
|
- if err := c.Connection.WriteMessage(websocket.TextMessage, []byte(msg)); err != nil {
|
|
|
+ msg := Response{Type: "LISTEN", Data: DataTopics{Topics: topics}}.JSON()
|
|
|
+ if err := c.Connection.WriteMessage(websocket.TextMessage, msg); err != nil {
|
|
|
c.onError(err)
|
|
|
c.active = false
|
|
|
c.onDisconnect()
|