Add custom offline message+api. Part of #1901

This commit is contained in:
Gabe Kangas
2022-08-09 22:09:43 -07:00
parent 2c1624127a
commit 681067ab93
9 changed files with 73 additions and 2 deletions

View File

@@ -66,6 +66,7 @@ const (
twitterConfigurationKey = "twitter_configuration"
hasConfiguredInitialNotificationsKey = "has_configured_initial_notifications"
hideViewerCountKey = "hide_viewer_count"
customOfflineMessageKey = "custom_offline_message"
)
// GetExtraPageBodyContent will return the user-supplied body content.
@@ -920,3 +921,14 @@ func GetHideViewerCount() bool {
func SetHideViewerCount(hide bool) error {
return _datastore.SetBool(hideViewerCountKey, hide)
}
// GetCustomOfflineMessage will return the custom offline message.
func GetCustomOfflineMessage() string {
message, _ := _datastore.GetString(customOfflineMessageKey)
return message
}
// SetCustomOfflineMessage will set the custom offline message.
func SetCustomOfflineMessage(message string) error {
return _datastore.SetString(customOfflineMessageKey, message)
}