4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-06 06:04:08 +00:00

Update vendor (github.com/mattermost)

This commit is contained in:
Wim
2018-02-09 00:11:04 +01:00
parent 1d33e60e36
commit 5aab158c0b
267 changed files with 36409 additions and 5827 deletions

View File

@ -45,6 +45,17 @@ type OutgoingWebhookPayload struct {
FileIds string `json:"file_ids"`
}
type OutgoingWebhookResponse struct {
Text *string `json:"text"`
Username string `json:"username"`
IconURL string `json:"icon_url"`
Props StringInterface `json:"props"`
Type string `json:"type"`
ResponseType string `json:"response_type"`
}
const OUTGOING_HOOK_RESPONSE_TYPE_COMMENT = "comment"
func (o *OutgoingWebhookPayload) ToJSON() string {
b, err := json.Marshal(o)
if err != nil {
@ -112,6 +123,26 @@ func OutgoingWebhookListFromJson(data io.Reader) []*OutgoingWebhook {
}
}
func (o *OutgoingWebhookResponse) ToJson() string {
b, err := json.Marshal(o)
if err != nil {
return ""
} else {
return string(b)
}
}
func OutgoingWebhookResponseFromJson(data io.Reader) *OutgoingWebhookResponse {
decoder := json.NewDecoder(data)
var o OutgoingWebhookResponse
err := decoder.Decode(&o)
if err == nil {
return &o
} else {
return nil
}
}
func (o *OutgoingWebhook) IsValid() *AppError {
if len(o.Id) != 26 {