diff options
author | Wim <wim@42.be> | 2019-01-18 18:35:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-18 18:35:31 +0100 |
commit | fb713ed91bfb48c0037e489f80be85c54e69953a (patch) | |
tree | e82901d1a604b02bbb5e3a2c4712f20e61d0513b /bridge/slack/slack.go | |
parent | d99eacc2e1b0deadc7368b35adf0818493fd2fb9 (diff) | |
download | matterbridge-msglm-fb713ed91bfb48c0037e489f80be85c54e69953a.tar.gz matterbridge-msglm-fb713ed91bfb48c0037e489f80be85c54e69953a.tar.bz2 matterbridge-msglm-fb713ed91bfb48c0037e489f80be85c54e69953a.zip |
Add initial support for getting ChannelMember info of all bridges (#678)
* Add initial support for getting ChannelMember info of all bridges.
Adds an EventGetChannelMembers event, which gets send every x time to
all bridges. Bridges should respond on this event with a Message
containing ChannelMembers in the EventGetChannelMembers key in the
Extra field.
handleEventGetChannelMembers will handle this Message and sets the
contained ChannelMembers to the Bridge struct.
* Add ChannelMembers support to the slack bridge
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index b9430278..001b1268 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -37,6 +37,9 @@ type Bslack struct { channelsByName map[string]*slack.Channel channelsMutex sync.RWMutex + channelMembers map[string][]string + channelMembersMutex sync.RWMutex + refreshInProgress bool earliestChannelRefresh time.Time earliestUserRefresh time.Time @@ -267,6 +270,11 @@ func (b *Bslack) sendWebhook(msg config.Message) error { } func (b *Bslack) sendRTM(msg config.Message) (string, error) { + // Handle channelmember messages. + if handled := b.handleGetChannelMembers(&msg); handled { + return "", nil + } + channelInfo, err := b.getChannel(msg.Channel) if err != nil { return "", fmt.Errorf("could not send message: %v", err) |