Option to enable full snippets in push notifications
Этот коммит содержится в:
@@ -25,6 +25,9 @@ const (
|
||||
WEBSERVER_MODE_REGULAR = "regular"
|
||||
WEBSERVER_MODE_GZIP = "gzip"
|
||||
WEBSERVER_MODE_DISABLED = "disabled"
|
||||
|
||||
GENERIC_NOTIFICATION = "generic"
|
||||
FULL_NOTIFICATION = "full"
|
||||
)
|
||||
|
||||
type ServiceSettings struct {
|
||||
@@ -121,6 +124,7 @@ type EmailSettings struct {
|
||||
PasswordResetSalt string
|
||||
SendPushNotifications *bool
|
||||
PushNotificationServer *string
|
||||
PushNotificationContents *string
|
||||
}
|
||||
|
||||
type RateLimitSettings struct {
|
||||
@@ -299,6 +303,11 @@ func (o *Config) SetDefaults() {
|
||||
*o.EmailSettings.PushNotificationServer = ""
|
||||
}
|
||||
|
||||
if o.EmailSettings.PushNotificationContents == nil {
|
||||
o.EmailSettings.PushNotificationContents = new(string)
|
||||
*o.EmailSettings.PushNotificationContents = GENERIC_NOTIFICATION
|
||||
}
|
||||
|
||||
if o.SupportSettings.TermsOfServiceLink == nil {
|
||||
o.SupportSettings.TermsOfServiceLink = new(string)
|
||||
*o.SupportSettings.TermsOfServiceLink = "/static/help/terms.html"
|
||||
|
||||
@@ -11,6 +11,8 @@ import (
|
||||
const (
|
||||
PUSH_NOTIFY_APPLE = "apple"
|
||||
PUSH_NOTIFY_ANDROID = "android"
|
||||
|
||||
CATEGORY_DM = "DIRECT_MESSAGE"
|
||||
)
|
||||
|
||||
type PushNotification struct {
|
||||
@@ -22,6 +24,8 @@ type PushNotification struct {
|
||||
Message string `json:"message"`
|
||||
Badge int `json:"badge"`
|
||||
ContentAvailable int `json:"cont_ava"`
|
||||
ChannelId string `json:"channel_id"`
|
||||
ChannelName string `json:"channel_name"`
|
||||
}
|
||||
|
||||
func (me *PushNotification) ToJson() string {
|
||||
|
||||
@@ -367,3 +367,15 @@ func IsValidHttpUrl(rawUrl string) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func IsValidHttpsUrl(rawUrl string) bool {
|
||||
if strings.Index(rawUrl, "https://") != 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
if _, err := url.ParseRequestURI(rawUrl); err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user