diff options
Diffstat (limited to 'vendor/github.com/nlopes/slack/rtm.go')
-rw-r--r-- | vendor/github.com/nlopes/slack/rtm.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vendor/github.com/nlopes/slack/rtm.go b/vendor/github.com/nlopes/slack/rtm.go index e7fa83f7..09cb51c3 100644 --- a/vendor/github.com/nlopes/slack/rtm.go +++ b/vendor/github.com/nlopes/slack/rtm.go @@ -38,7 +38,7 @@ func (api *Client) StartRTM() (info *Info, websocketURL string, err error) { // To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` on it. func (api *Client) StartRTMContext(ctx context.Context) (info *Info, websocketURL string, err error) { response := &infoResponseFull{} - err = postSlackMethod(ctx, api.httpclient, "rtm.start", url.Values{"token": {api.token}}, response, api) + err = api.postMethod(ctx, "rtm.start", url.Values{"token": {api.token}}, response) if err != nil { return nil, "", err } @@ -63,7 +63,7 @@ func (api *Client) ConnectRTM() (info *Info, websocketURL string, err error) { // To have a fully managed Websocket connection, use `NewRTM`, and call `ManageConnection()` on it. func (api *Client) ConnectRTMContext(ctx context.Context) (info *Info, websocketURL string, err error) { response := &infoResponseFull{} - err = postSlackMethod(ctx, api.httpclient, "rtm.connect", url.Values{"token": {api.token}}, response, api) + err = api.postMethod(ctx, "rtm.connect", url.Values{"token": {api.token}}, response) if err != nil { api.Debugf("Failed to connect to RTM: %s", err) return nil, "", err @@ -112,14 +112,13 @@ func RTMOptionConnParams(connParams url.Values) RTMOption { func (api *Client) NewRTM(options ...RTMOption) *RTM { result := &RTM{ Client: *api, - wasIntentional: true, - isConnected: false, IncomingEvents: make(chan RTMEvent, 50), outgoingMessages: make(chan OutgoingMessage, 20), pingInterval: defaultPingInterval, pingDeadman: time.NewTimer(deadmanDuration(defaultPingInterval)), killChannel: make(chan bool), - disconnected: make(chan struct{}, 1), + disconnected: make(chan struct{}), + disconnectedm: &sync.Once{}, forcePing: make(chan bool), rawEvents: make(chan json.RawMessage), idGen: NewSafeID(1), |