From fb713ed91bfb48c0037e489f80be85c54e69953a Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 18 Jan 2019 18:35:31 +0100 Subject: 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 --- bridge/config/config.go | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'bridge/config') diff --git a/bridge/config/config.go b/bridge/config/config.go index 932de2eb..3d1206c7 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -14,16 +14,17 @@ import ( ) const ( - EventJoinLeave = "join_leave" - EventTopicChange = "topic_change" - EventFailure = "failure" - EventFileFailureSize = "file_failure_size" - EventAvatarDownload = "avatar_download" - EventRejoinChannels = "rejoin_channels" - EventUserAction = "user_action" - EventMsgDelete = "msg_delete" - EventAPIConnected = "api_connected" - EventUserTyping = "user_typing" + EventJoinLeave = "join_leave" + EventTopicChange = "topic_change" + EventFailure = "failure" + EventFileFailureSize = "file_failure_size" + EventAvatarDownload = "avatar_download" + EventRejoinChannels = "rejoin_channels" + EventUserAction = "user_action" + EventMsgDelete = "msg_delete" + EventAPIConnected = "api_connected" + EventUserTyping = "user_typing" + EventGetChannelMembers = "get_channel_members" ) type Message struct { @@ -61,6 +62,16 @@ type ChannelInfo struct { Options ChannelOptions } +type ChannelMember struct { + Username string + Nick string + UserID string + ChannelID string + ChannelName string +} + +type ChannelMembers []ChannelMember + type Protocol struct { AuthCode string // steam BindAddress string // mattermost, slack // DEPRECATED -- cgit v1.2.3