4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-16 09:32:31 +00:00

Update vendor (mattermost)

This commit is contained in:
Wim
2017-03-25 21:04:10 +01:00
parent 07fd825349
commit eacb1c1771
108 changed files with 26050 additions and 211 deletions

View File

@@ -8,6 +8,10 @@ import (
"github.com/gorilla/websocket"
)
const (
SOCKET_MAX_MESSAGE_SIZE_KB = 8 * 1024 // 8KB
)
type WebSocketClient struct {
Url string // The location of the server like "ws://localhost:8065"
ApiUrl string // The api location of the server like "ws://localhost:8065/api/v3"
@@ -22,14 +26,14 @@ type WebSocketClient struct {
// NewWebSocketClient constructs a new WebSocket client with convienence
// methods for talking to the server.
func NewWebSocketClient(url, authToken string) (*WebSocketClient, *AppError) {
conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX+"/users/websocket", nil)
conn, _, err := websocket.DefaultDialer.Dial(url+API_URL_SUFFIX_V3+"/users/websocket", nil)
if err != nil {
return nil, NewLocAppError("NewWebSocketClient", "model.websocket_client.connect_fail.app_error", nil, err.Error())
}
client := &WebSocketClient{
url,
url + API_URL_SUFFIX,
url + API_URL_SUFFIX_V3,
conn,
authToken,
1,