From c3d90539e9a7addd3c41f44b864b14bde60958dc Mon Sep 17 00:00:00 2001 From: r Date: Sat, 14 Nov 2020 14:08:16 +0000 Subject: Add notification interval setting It replaces the "Auto refresh notifications" checkbox --- model/settings.go | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'model') diff --git a/model/settings.go b/model/settings.go index 337a6a3..6d17901 100644 --- a/model/settings.go +++ b/model/settings.go @@ -1,29 +1,29 @@ package model type Settings struct { - DefaultVisibility string `json:"default_visibility"` - DefaultFormat string `json:"default_format"` - CopyScope bool `json:"copy_scope"` - ThreadInNewTab bool `json:"thread_in_new_tab"` - HideAttachments bool `json:"hide_attachments"` - MaskNSFW bool `json:"mask_nfsw"` - AutoRefreshNotifications bool `json:"auto_refresh_notifications"` - FluorideMode bool `json:"fluoride_mode"` - DarkMode bool `json:"dark_mode"` - AntiDopamineMode bool `json:"anti_dopamine_mode"` + DefaultVisibility string `json:"default_visibility"` + DefaultFormat string `json:"default_format"` + CopyScope bool `json:"copy_scope"` + ThreadInNewTab bool `json:"thread_in_new_tab"` + HideAttachments bool `json:"hide_attachments"` + MaskNSFW bool `json:"mask_nfsw"` + NotificationInterval int `json:"notifications_interval"` + FluorideMode bool `json:"fluoride_mode"` + DarkMode bool `json:"dark_mode"` + AntiDopamineMode bool `json:"anti_dopamine_mode"` } func NewSettings() *Settings { return &Settings{ - DefaultVisibility: "public", - DefaultFormat: "", - CopyScope: true, - ThreadInNewTab: false, - HideAttachments: false, - MaskNSFW: true, - AutoRefreshNotifications: false, - FluorideMode: false, - DarkMode: false, - AntiDopamineMode: false, + DefaultVisibility: "public", + DefaultFormat: "", + CopyScope: true, + ThreadInNewTab: false, + HideAttachments: false, + MaskNSFW: true, + NotificationInterval: 0, + FluorideMode: false, + DarkMode: false, + AntiDopamineMode: false, } } -- cgit v1.2.3 From fa27d9c6eb525b2e55c3faab5dd8a3e0e9658536 Mon Sep 17 00:00:00 2001 From: r Date: Sun, 22 Nov 2020 17:29:58 +0000 Subject: Refactor things - Remove separate auth/logging and merge them into transport.go - Add helper function for http handlers --- model/client.go | 19 ------------------- model/post.go | 1 - 2 files changed, 20 deletions(-) delete mode 100644 model/client.go (limited to 'model') diff --git a/model/client.go b/model/client.go deleted file mode 100644 index 931ddaa..0000000 --- a/model/client.go +++ /dev/null @@ -1,19 +0,0 @@ -package model - -import ( - "io" - - "bloat/mastodon" -) - -type ClientCtx struct { - SessionID string - CSRFToken string -} - -type Client struct { - *mastodon.Client - Writer io.Writer - Ctx ClientCtx - Session Session -} diff --git a/model/post.go b/model/post.go index 831f74f..40118ed 100644 --- a/model/post.go +++ b/model/post.go @@ -10,7 +10,6 @@ type PostContext struct { DefaultFormat string ReplyContext *ReplyContext Formats []PostFormat - DarkMode bool } type ReplyContext struct { -- cgit v1.2.3