Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
enahum committed Feb 23, 2017
1 parent b511c3d commit 5dc00b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions model/channel_member.go
Expand Up @@ -88,26 +88,26 @@ func (o *ChannelMember) IsValid() *AppError {
return NewLocAppError("ChannelMember.IsValid", "model.channel_member.is_valid.user_id.app_error", nil, "")
}

notifyLevel := o.NotifyProps["desktop"]
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)
}

markUnreadLevel := o.NotifyProps["mark_unread"]
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)
}

if pushLevel, ok := o.NotifyProps["push"]; ok {
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)
}
}

if sendEmail, ok := o.NotifyProps["email"]; ok {
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)
Expand Down

0 comments on commit 5dc00b0

Please sign in to comment.