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 {
eletions'>-1/+1 2014-05-10reencryption: Properly escape input to sedJason A. Donenfeld1-1/+1 2014-05-10git: use secure tmp directoryJason A. Donenfeld1-4/+11 2014-05-10configure git to decrypt gpg files automaticallySamuel Le Thiec1-0/+5 2014-05-08completion: add new generate flagsJason A. Donenfeld3-2/+7 2014-05-08inplace: mutually exclusive with forceJason A. Donenfeld2-3/+3 2014-05-08usage: tab to spacesJason A. Donenfeld1-1/+1 2014-05-08generate: use nice ansi colors instead.Jason A. Donenfeld1-3/+2 2014-05-08zsh: posix compatible sed fix for zsh-completionJason A. Donenfeld1-1/+1 2014-05-07Implement interactive init functionSvend Sorensen1-0/+8 2014-05-07Implement interactive rename functionSvend Sorensen1-0/+7 2014-05-07Reorder interactive function to match order of helper functionsSvend Sorensen1-13/+13 2014-05-07Make edit helper function name consistent with other helpersSvend Sorensen1-1/+1 2014-05-07Factor out password completing-read functionSvend Sorensen1-4/+8 2014-05-07Add dash to Package-RequiresSvend Sorensen1-1/+1 2014-05-06Force sane sort order.Jason A. Donenfeld1-2/+2 2014-05-06generate: add --in-place optionJason A. Donenfeld4-9/+33