diff options
author | Wim <wim@42.be> | 2018-02-09 00:11:04 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-09 00:11:04 +0100 |
commit | 5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811 (patch) | |
tree | 09bcb3f02f968867c2ca84db1f28594dd0afb967 /vendor/github.com/mattermost/platform/model/channel_member.go | |
parent | 1d33e60e36fa7b0e361990ac347ee8d620d67dcc (diff) | |
download | matterbridge-msglm-5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811.tar.gz matterbridge-msglm-5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811.tar.bz2 matterbridge-msglm-5aab158c0b0db64b6136fe2fdaca8b8e9e3bd811.zip |
Update vendor (github.com/mattermost)
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/channel_member.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/channel_member.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/vendor/github.com/mattermost/platform/model/channel_member.go b/vendor/github.com/mattermost/platform/model/channel_member.go index f6d58519..e7ad8232 100644 --- a/vendor/github.com/mattermost/platform/model/channel_member.go +++ b/vendor/github.com/mattermost/platform/model/channel_member.go @@ -6,6 +6,7 @@ package model import ( "encoding/json" "io" + "net/http" "strings" ) @@ -101,36 +102,32 @@ func ChannelMemberFromJson(data io.Reader) *ChannelMember { func (o *ChannelMember) IsValid() *AppError { if len(o.ChannelId) != 26 { - return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.channel_id.app_error", nil, "") + return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.channel_id.app_error", nil, "", http.StatusBadRequest) } if len(o.UserId) != 26 { - return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.user_id.app_error", nil, "") + return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.user_id.app_error", nil, "", http.StatusBadRequest) } notifyLevel := o.NotifyProps[DESKTOP_NOTIFY_PROP] if len(notifyLevel) > 20 || !IsChannelNotifyLevelValid(notifyLevel) { - return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.notify_level.app_error", - nil, "notify_level="+notifyLevel) + return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.notify_level.app_error", nil, "notify_level="+notifyLevel, http.StatusBadRequest) } markUnreadLevel := o.NotifyProps[MARK_UNREAD_NOTIFY_PROP] if len(markUnreadLevel) > 20 || !IsChannelMarkUnreadLevelValid(markUnreadLevel) { - return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.unread_level.app_error", - nil, "mark_unread_level="+markUnreadLevel) + return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.unread_level.app_error", nil, "mark_unread_level="+markUnreadLevel, http.StatusBadRequest) } if pushLevel, ok := o.NotifyProps[PUSH_NOTIFY_PROP]; ok { if len(pushLevel) > 20 || !IsChannelNotifyLevelValid(pushLevel) { - return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.push_level.app_error", - nil, "push_notification_level="+pushLevel) + return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.push_level.app_error", nil, "push_notification_level="+pushLevel, http.StatusBadRequest) } } if sendEmail, ok := o.NotifyProps[EMAIL_NOTIFY_PROP]; ok { if len(sendEmail) > 20 || !IsSendEmailValid(sendEmail) { - return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.email_value.app_error", - nil, "push_notification_level="+sendEmail) + return NewAppError("ChannelMember.IsValid", "model.channel_member.is_valid.email_value.app_error", nil, "push_notification_level="+sendEmail, http.StatusBadRequest) } } |