Add Auto Responder handler (#8386)
WIP Out Of Office Return error for status command if user status is OOO Ignore notifications if Out Of Office Disable AutoResponder if status is set to online Add test for AutoResponder DisableAutoResponse when manually setting status Remove check on status slash command return early if user does not exists in SendAutoResponse method Add proper error handling Add a newline after error handling Revert back to err == nil in api4/status.go Remove a.Go when using a.Publish Add name consistency with the feature auto responder Last changes for name consistency, also fix failing test with auto_responder Fix names of functions in auto responder test Add ExperimentalEnableAutomaticReplies flag Auto Responder reply to a post
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
8df6d5cc30
Коммит
7826774a14
@@ -991,6 +991,7 @@ type TeamSettings struct {
|
||||
MaxNotificationsPerChannel *int64
|
||||
EnableConfirmNotificationsToChannel *bool
|
||||
TeammateNameDisplay *string
|
||||
ExperimentalEnableAutomaticReplies *bool
|
||||
ExperimentalTownSquareIsReadOnly *bool
|
||||
ExperimentalPrimaryTeam *string
|
||||
}
|
||||
@@ -1085,6 +1086,10 @@ func (s *TeamSettings) SetDefaults() {
|
||||
s.EnableConfirmNotificationsToChannel = NewBool(true)
|
||||
}
|
||||
|
||||
if s.ExperimentalEnableAutomaticReplies == nil {
|
||||
s.ExperimentalEnableAutomaticReplies = NewBool(false)
|
||||
}
|
||||
|
||||
if s.ExperimentalTownSquareIsReadOnly == nil {
|
||||
s.ExperimentalTownSquareIsReadOnly = NewBool(false)
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ const (
|
||||
POST_LEAVE_CHANNEL = "system_leave_channel"
|
||||
POST_JOIN_TEAM = "system_join_team"
|
||||
POST_LEAVE_TEAM = "system_leave_team"
|
||||
POST_AUTO_RESPONDER = "system_auto_responder"
|
||||
POST_ADD_REMOVE = "system_add_remove" // Deprecated, use POST_ADD_TO_CHANNEL or POST_REMOVE_FROM_CHANNEL instead
|
||||
POST_ADD_TO_CHANNEL = "system_add_to_channel"
|
||||
POST_REMOVE_FROM_CHANNEL = "system_remove_from_channel"
|
||||
@@ -194,6 +195,7 @@ func (o *Post) IsValid(maxPostSize int) *AppError {
|
||||
case
|
||||
POST_DEFAULT,
|
||||
POST_JOIN_LEAVE,
|
||||
POST_AUTO_RESPONDER,
|
||||
POST_ADD_REMOVE,
|
||||
POST_JOIN_CHANNEL,
|
||||
POST_LEAVE_CHANNEL,
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
STATUS_OUT_OF_OFFICE = "ooo"
|
||||
STATUS_OFFLINE = "offline"
|
||||
STATUS_AWAY = "away"
|
||||
STATUS_DND = "dnd"
|
||||
|
||||
Ссылка в новой задаче
Block a user