From 265457b45171dcae96a1aac9454e3bda2cd0557a Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 19 Dec 2017 23:15:03 +0100 Subject: Refactor and add MediaDownloadSize to General --- bridge/slack/slack.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'bridge/slack') diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 7206bfdd..d6f73ffd 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -27,14 +27,12 @@ type MMMessage struct { type Bslack struct { mh *matterhook.Client sc *slack.Client - Config *config.Protocol rtm *slack.RTM Plus bool - Remote chan config.Message Users []slack.User - Account string si *slack.Info channels []slack.Channel + *config.BridgeConfig } var flog *log.Entry @@ -44,12 +42,8 @@ func init() { flog = log.WithFields(log.Fields{"module": protocol}) } -func New(cfg config.Protocol, account string, c chan config.Message) *Bslack { - b := &Bslack{} - b.Config = &cfg - b.Remote = c - b.Account = account - return b +func New(cfg *config.BridgeConfig) *Bslack { + return &Bslack{BridgeConfig: cfg} } func (b *Bslack) Command(cmd string) string { @@ -161,7 +155,7 @@ func (b *Bslack) Send(msg config.Message) (string, error) { np.AsUser = true } np.Username = nick - np.IconURL = config.GetIconURL(&msg, b.Config) + np.IconURL = config.GetIconURL(&msg, &b.Config) if msg.Avatar != "" { np.IconURL = msg.Avatar } -- cgit v1.2.3