diff options
author | Wim <wim@42.be> | 2017-07-16 14:29:46 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-16 14:29:46 +0200 |
commit | aec5e3d77b6e480d04dd8773723de62416a94919 (patch) | |
tree | 57ab269e6c46e62e61db04a9ca6fbb55e736519f /vendor/github.com/nlopes/slack/websocket.go | |
parent | 335ddf8db543bf64522196e6928c3d10af64694c (diff) | |
download | matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.gz matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.bz2 matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.zip |
Update vendor (nlopes/slack)
Diffstat (limited to 'vendor/github.com/nlopes/slack/websocket.go')
-rw-r--r-- | vendor/github.com/nlopes/slack/websocket.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/vendor/github.com/nlopes/slack/websocket.go b/vendor/github.com/nlopes/slack/websocket.go index 6eb09263..f3c9cbd8 100644 --- a/vendor/github.com/nlopes/slack/websocket.go +++ b/vendor/github.com/nlopes/slack/websocket.go @@ -17,7 +17,7 @@ const ( // RTM represents a managed websocket connection. It also supports // all the methods of the `Client` type. // -// Create this element with Client's NewRTM(). +// Create this element with Client's NewRTM() or NewRTMWithOptions(*RTMOptions) type RTM struct { idGen IDGenerator pings map[int]time.Time @@ -38,23 +38,23 @@ type RTM struct { // UserDetails upon connection info *Info + + // useRTMStart should be set to true if you want to use + // rtm.start to connect to Slack, otherwise it will use + // rtm.connect + useRTMStart bool } -// NewRTM returns a RTM, which provides a fully managed connection to -// Slack's websocket-based Real-Time Messaging protocol. -func newRTM(api *Client) *RTM { - return &RTM{ - Client: *api, - IncomingEvents: make(chan RTMEvent, 50), - outgoingMessages: make(chan OutgoingMessage, 20), - pings: make(map[int]time.Time), - isConnected: false, - wasIntentional: true, - killChannel: make(chan bool), - forcePing: make(chan bool), - rawEvents: make(chan json.RawMessage), - idGen: NewSafeID(1), - } +// RTMOptions allows configuration of various options available for RTM messaging +// +// This structure will evolve in time so please make sure you are always using the +// named keys for every entry available as per Go 1 compatibility promise adding fields +// to this structure should not be considered a breaking change. +type RTMOptions struct { + // UseRTMStart set to true in order to use rtm.start or false to use rtm.connect + // As of 11th July 2017 you should prefer setting this to false, see: + // https://api.slack.com/changelog/2017-04-start-using-rtm-connect-and-stop-using-rtm-start + UseRTMStart bool } // Disconnect and wait, blocking until a successful disconnection. |