[MM-10645] Remove desktop duration notify props (#8851)

* remove desktop duration notify props

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* fix test

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
Этот коммит содержится в:
Saturnino Abril
2018-05-25 22:52:17 +08:00
коммит произвёл Christopher Speller
родитель 94b2eca2d1
Коммит 58abb4204e
4 изменённых файлов: 2 добавлений и 29 удалений

Просмотреть файл

@@ -79,9 +79,8 @@ type UserImportData struct {
}
type UserNotifyPropsImportData struct {
Desktop *string `json:"desktop"`
DesktopDuration *string `json:"desktop_duration"`
DesktopSound *string `json:"desktop_sound"`
Desktop *string `json:"desktop"`
DesktopSound *string `json:"desktop_sound"`
Email *string `json:"email"`
@@ -608,13 +607,6 @@ func (a *App) ImportUser(data *UserImportData, dryRun bool) *model.AppError {
}
}
if data.NotifyProps.DesktopDuration != nil {
if value, ok := user.NotifyProps[model.DESKTOP_DURATION_NOTIFY_PROP]; !ok || value != *data.NotifyProps.DesktopDuration {
user.AddNotifyProp(model.DESKTOP_DURATION_NOTIFY_PROP, *data.NotifyProps.DesktopDuration)
hasNotifyPropsChanged = true
}
}
if data.NotifyProps.DesktopSound != nil {
if value, ok := user.NotifyProps[model.DESKTOP_SOUND_NOTIFY_PROP]; !ok || value != *data.NotifyProps.DesktopSound {
user.AddNotifyProp(model.DESKTOP_SOUND_NOTIFY_PROP, *data.NotifyProps.DesktopSound)
@@ -969,10 +961,6 @@ func validateUserImportData(data *UserImportData) *model.AppError {
return model.NewAppError("BulkImport", "app.import.validate_user_import_data.notify_props_desktop_invalid.error", nil, "", http.StatusBadRequest)
}
if data.NotifyProps.DesktopDuration != nil && !model.IsValidNumberString(*data.NotifyProps.DesktopDuration) {
return model.NewAppError("BulkImport", "app.import.validate_user_import_data.notify_props_desktop_duration_invalid.error", nil, "", http.StatusBadRequest)
}
if data.NotifyProps.DesktopSound != nil && !model.IsValidTrueOrFalseString(*data.NotifyProps.DesktopSound) {
return model.NewAppError("BulkImport", "app.import.validate_user_import_data.notify_props_desktop_sound_invalid.error", nil, "", http.StatusBadRequest)
}