summaryrefslogtreecommitdiffstats
path: root/bridge/helper
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2018-11-07 20:35:59 +0000
committerWim <wim@42.be>2018-11-07 21:35:59 +0100
commitd2a1dc792f9a2bb147afc6e8fde2c9f723f29cf1 (patch)
tree693c30e2403ef0a8b9fe42e1d42de99ef7e28e57 /bridge/helper
parent06d66a0b2b94869f2e5e82a29f908e420fd6942e (diff)
downloadmatterbridge-msglm-d2a1dc792f9a2bb147afc6e8fde2c9f723f29cf1.tar.gz
matterbridge-msglm-d2a1dc792f9a2bb147afc6e8fde2c9f723f29cf1.tar.bz2
matterbridge-msglm-d2a1dc792f9a2bb147afc6e8fde2c9f723f29cf1.zip
Refactor and clean-up handlers. (slack) (#533)
Diffstat (limited to 'bridge/helper')
-rw-r--r--bridge/helper/helper.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go
index a13e02af..bfa7d827 100644
--- a/bridge/helper/helper.go
+++ b/bridge/helper/helper.go
@@ -56,13 +56,10 @@ func SplitStringLength(input string, length int) string {
func HandleExtra(msg *config.Message, general *config.Protocol) []config.Message {
extra := msg.Extra
rmsg := []config.Message{}
- if len(extra[config.EVENT_FILE_FAILURE_SIZE]) > 0 {
- for _, f := range extra[config.EVENT_FILE_FAILURE_SIZE] {
- fi := f.(config.FileInfo)
- text := fmt.Sprintf("file %s too big to download (%#v > allowed size: %#v)", fi.Name, fi.Size, general.MediaDownloadSize)
- rmsg = append(rmsg, config.Message{Text: text, Username: "<system> ", Channel: msg.Channel, Account: msg.Account})
- }
- return rmsg
+ for _, f := range extra[config.EVENT_FILE_FAILURE_SIZE] {
+ fi := f.(config.FileInfo)
+ text := fmt.Sprintf("file %s too big to download (%#v > allowed size: %#v)", fi.Name, fi.Size, general.MediaDownloadSize)
+ rmsg = append(rmsg, config.Message{Text: text, Username: "<system> ", Channel: msg.Channel, Account: msg.Account})
}
return rmsg
}