summaryrefslogtreecommitdiffstats
path: root/bridge/slack
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-12-19 23:15:03 +0100
committerWim <wim@42.be>2017-12-19 23:15:03 +0100
commit265457b45171dcae96a1aac9454e3bda2cd0557a (patch)
tree35342a6b83e01b708b20442378799c7692fdf519 /bridge/slack
parent4a4a29c9f6fe202cf4379c0df2ba313848bb8d11 (diff)
downloadmatterbridge-msglm-265457b45171dcae96a1aac9454e3bda2cd0557a.tar.gz
matterbridge-msglm-265457b45171dcae96a1aac9454e3bda2cd0557a.tar.bz2
matterbridge-msglm-265457b45171dcae96a1aac9454e3bda2cd0557a.zip
Refactor and add MediaDownloadSize to General
Diffstat (limited to 'bridge/slack')
-rw-r--r--bridge/slack/slack.go14
1 files changed, 4 insertions, 10 deletions
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
}