summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/slack-go/slack/block_conv.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-07-18 17:27:41 +0200
committerGitHub <noreply@github.com>2020-07-18 17:27:41 +0200
commit23d8742f0d95096b92f11729fb47f86ac3b68d43 (patch)
tree7b8acb02b051ae06e5454fda4a9d5118428fe016 /vendor/github.com/slack-go/slack/block_conv.go
parent3b6a8be07b9422714db30fb50977f342057febf3 (diff)
downloadmatterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.tar.gz
matterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.tar.bz2
matterbridge-msglm-23d8742f0d95096b92f11729fb47f86ac3b68d43.zip
Update dependencies for 1.18.0 release (#1175)
Diffstat (limited to 'vendor/github.com/slack-go/slack/block_conv.go')
-rw-r--r--vendor/github.com/slack-go/slack/block_conv.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/vendor/github.com/slack-go/slack/block_conv.go b/vendor/github.com/slack-go/slack/block_conv.go
index 00d59c3b..3fda5431 100644
--- a/vendor/github.com/slack-go/slack/block_conv.go
+++ b/vendor/github.com/slack-go/slack/block_conv.go
@@ -2,6 +2,7 @@ package slack
import (
"encoding/json"
+ "fmt"
"github.com/pkg/errors"
)
@@ -172,10 +173,12 @@ func (b *BlockElements) UnmarshalJSON(data []byte) error {
blockElement = &DatePickerBlockElement{}
case "plain_text_input":
blockElement = &PlainTextInputBlockElement{}
+ case "checkboxes":
+ blockElement = &CheckboxGroupsBlockElement{}
case "static_select", "external_select", "users_select", "conversations_select", "channels_select":
blockElement = &SelectBlockElement{}
default:
- return errors.New("unsupported block element type")
+ return fmt.Errorf("unsupported block element type %v", blockElementType)
}
err = json.Unmarshal(r, blockElement)
@@ -275,6 +278,12 @@ func (a *Accessory) UnmarshalJSON(data []byte) error {
return err
}
a.MultiSelectElement = element.(*MultiSelectBlockElement)
+ case "checkboxes":
+ element, err := unmarshalBlockElement(r, &CheckboxGroupsBlockElement{})
+ if err != nil {
+ return err
+ }
+ a.CheckboxGroupsBlockElement = element.(*CheckboxGroupsBlockElement)
default:
element, err := unmarshalBlockElement(r, &UnknownBlockElement{})
if err != nil {
@@ -313,6 +322,9 @@ func toBlockElement(element *Accessory) BlockElement {
if element.RadioButtonsElement != nil {
return element.RadioButtonsElement
}
+ if element.CheckboxGroupsBlockElement != nil {
+ return element.CheckboxGroupsBlockElement
+ }
if element.SelectElement != nil {
return element.SelectElement
}