mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-05 20:44:04 +00:00
Update dependencies/vendor (#1659)
This commit is contained in:
22
vendor/github.com/mattermost/mattermost-server/v6/model/session.go
generated
vendored
22
vendor/github.com/mattermost/mattermost-server/v6/model/session.go
generated
vendored
@ -4,6 +4,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@ -78,6 +79,27 @@ func (s *Session) DeepCopy() *Session {
|
||||
return ©Session
|
||||
}
|
||||
|
||||
func (s *Session) IsValid() *AppError {
|
||||
if !IsValidId(s.Id) {
|
||||
return NewAppError("Session.IsValid", "model.session.is_valid.id.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if !IsValidId(s.UserId) {
|
||||
return NewAppError("Session.IsValid", "model.session.is_valid.user_id.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if s.CreateAt == 0 {
|
||||
return NewAppError("Session.IsValid", "model.session.is_valid.create_at.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if len(s.Roles) > UserRolesMaxLength {
|
||||
return NewAppError("Session.IsValid", "model.session.is_valid.roles_limit.app_error",
|
||||
map[string]interface{}{"Limit": UserRolesMaxLength}, "session_id="+s.Id, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) PreSave() {
|
||||
if s.Id == "" {
|
||||
s.Id = NewId()
|
||||
|
Reference in New Issue
Block a user