mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
feat(pushover): add integration with pushover.net
This commit is contained in:
parent
76acd81fa4
commit
3387201634
32 changed files with 510 additions and 6 deletions
|
@ -39,6 +39,8 @@ type FeedForm struct {
|
|||
DisableHTTP2 bool
|
||||
NtfyEnabled bool
|
||||
NtfyPriority int
|
||||
PushoverEnabled bool
|
||||
PushoverPriority int
|
||||
}
|
||||
|
||||
// Merge updates the fields of the given feed.
|
||||
|
@ -71,6 +73,8 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed {
|
|||
feed.DisableHTTP2 = f.DisableHTTP2
|
||||
feed.NtfyEnabled = f.NtfyEnabled
|
||||
feed.NtfyPriority = f.NtfyPriority
|
||||
feed.PushoverEnabled = f.PushoverEnabled
|
||||
feed.PushoverPriority = f.PushoverPriority
|
||||
return feed
|
||||
}
|
||||
|
||||
|
@ -84,6 +88,12 @@ func NewFeedForm(r *http.Request) *FeedForm {
|
|||
if err != nil {
|
||||
ntfyPriority = 0
|
||||
}
|
||||
|
||||
pushoverPriority, err := strconv.Atoi(r.FormValue("pushover_priority"))
|
||||
if err != nil {
|
||||
pushoverPriority = 0
|
||||
}
|
||||
|
||||
return &FeedForm{
|
||||
FeedURL: r.FormValue("feed_url"),
|
||||
SiteURL: r.FormValue("site_url"),
|
||||
|
@ -111,5 +121,7 @@ func NewFeedForm(r *http.Request) *FeedForm {
|
|||
DisableHTTP2: r.FormValue("disable_http2") == "1",
|
||||
NtfyEnabled: r.FormValue("ntfy_enabled") == "1",
|
||||
NtfyPriority: ntfyPriority,
|
||||
PushoverEnabled: r.FormValue("pushover_enabled") == "1",
|
||||
PushoverPriority: pushoverPriority,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue