aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 18:12:55 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 18:12:55 +0200
commite4871e3834397e34a83a8df62dafe5a0875555ae (patch)
tree55aa8c070ee93110569bd9065033435929f7cbba /internal/feed/feed.go
parentac568556e41231e07dd55b1d79675064ef4fed7b (diff)
downloadfeed2imap-go-e4871e3834397e34a83a8df62dafe5a0875555ae.tar.gz
feed2imap-go-e4871e3834397e34a83a8df62dafe5a0875555ae.tar.bz2
feed2imap-go-e4871e3834397e34a83a8df62dafe5a0875555ae.zip
Option `always-new`
Diffstat (limited to '')
-rw-r--r--internal/feed/feed.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index 433d080..0038335 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -7,6 +7,7 @@ import (
"github.com/Necoro/feed2imap-go/pkg/config"
"github.com/Necoro/feed2imap-go/pkg/log"
+ "github.com/Necoro/feed2imap-go/pkg/util"
)
type Feed struct {
@@ -28,15 +29,17 @@ type feeditem struct {
reasons []string
}
-func (item feeditem) Creator() string {
+func (item *feeditem) Creator() string {
if item.Item.Author != nil {
return item.Item.Author.Name
}
return ""
}
-func (item feeditem) addReason(reason string) {
- item.reasons = append(item.reasons, reason)
+func (item *feeditem) addReason(reason string) {
+ if !util.StrContains(item.reasons, reason) {
+ item.reasons = append(item.reasons, reason)
+ }
}
func (feed *Feed) descriptor() feedDescriptor {