MM-25394 session expired push notifications (#14732)
* new job type created that checks for expired mobile sessions and pushes notifications. * only send session expired notifications if ExtendSessionLengthWithActivity is enabled. * includes schema change: field added to Sessions table
Этот коммит содержится в:
@@ -19,6 +19,7 @@ const (
|
||||
JOB_TYPE_LDAP_SYNC = "ldap_sync"
|
||||
JOB_TYPE_MIGRATIONS = "migrations"
|
||||
JOB_TYPE_PLUGINS = "plugins"
|
||||
JOB_TYPE_EXPIRY_NOTIFY = "expiry_notify"
|
||||
|
||||
JOB_STATUS_PENDING = "pending"
|
||||
JOB_STATUS_IN_PROGRESS = "in_progress"
|
||||
@@ -59,6 +60,7 @@ func (j *Job) IsValid() *AppError {
|
||||
case JOB_TYPE_MESSAGE_EXPORT:
|
||||
case JOB_TYPE_MIGRATIONS:
|
||||
case JOB_TYPE_PLUGINS:
|
||||
case JOB_TYPE_EXPIRY_NOTIFY:
|
||||
default:
|
||||
return NewAppError("Job.IsValid", "model.job.is_valid.type.app_error", nil, "id="+j.Id, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ const (
|
||||
PUSH_TYPE_MESSAGE = "message"
|
||||
PUSH_TYPE_CLEAR = "clear"
|
||||
PUSH_TYPE_UPDATE_BADGE = "update_badge"
|
||||
PUSH_TYPE_SESSION = "session"
|
||||
PUSH_MESSAGE_V2 = "v2"
|
||||
|
||||
PUSH_SOUND_NONE = "none"
|
||||
|
||||
@@ -37,6 +37,7 @@ type Session struct {
|
||||
DeviceId string `json:"device_id"`
|
||||
Roles string `json:"roles"`
|
||||
IsOAuth bool `json:"is_oauth"`
|
||||
ExpiredNotify bool `json:"expired_notify"`
|
||||
Props StringMap `json:"props"`
|
||||
TeamMembers []*TeamMember `json:"team_members" db:"-"`
|
||||
Local bool `json:"local" db:"-"`
|
||||
|
||||
Ссылка в новой задаче
Block a user