aboutsummaryrefslogtreecommitdiff
path: root/internal/feed
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/feed/item.go10
-rw-r--r--internal/feed/mail.go26
2 files changed, 24 insertions, 12 deletions
diff --git a/internal/feed/item.go b/internal/feed/item.go
index 39f41ba..f7dd506 100644
--- a/internal/feed/item.go
+++ b/internal/feed/item.go
@@ -4,6 +4,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
+ "strings"
"time"
"github.com/google/uuid"
@@ -44,12 +45,13 @@ func (item *Item) Date() string {
return item.Updated
}
-// Creator returns the name of the creating author.
+// Creator returns the name of the creating authors (comma separated).
func (item *Item) Creator() string {
- if item.Author != nil {
- return item.Author.Name
+ names := make([]string, len(item.Authors))
+ for i, p := range item.Authors {
+ names[i] = p.Name
}
- return ""
+ return strings.Join(names, ", ")
}
func (item *Item) FeedLink() string {
diff --git a/internal/feed/mail.go b/internal/feed/mail.go
index 636f6a0..6ca7192 100644
--- a/internal/feed/mail.go
+++ b/internal/feed/mail.go
@@ -16,6 +16,7 @@ import (
"github.com/emersion/go-message/mail"
"github.com/gabriel-vasile/mimetype"
"github.com/jaytaylor/html2text"
+ "github.com/mmcdole/gofeed"
"golang.org/x/net/html"
"github.com/Necoro/feed2imap-go/internal/feed/template"
@@ -31,16 +32,25 @@ func address(name, address string) []*mail.Address {
return []*mail.Address{{Name: name, Address: address}}
}
+func author(authors []*gofeed.Person) *gofeed.Person {
+ if len(authors) > 0 {
+ return authors[0]
+ }
+ return nil
+}
+
func (item *Item) fromAddress() []*mail.Address {
+ itemAuthor := author(item.Authors)
+ feedAuthor := author(item.Feed.Authors)
switch {
- case item.Author != nil && item.Author.Email != "":
- return address(item.Author.Name, item.Author.Email)
- case item.Author != nil && item.Author.Name != "":
- return address(item.Author.Name, item.defaultEmail())
- case item.Feed.Author != nil && item.Feed.Author.Email != "":
- return address(item.Feed.Author.Name, item.Feed.Author.Email)
- case item.Feed.Author != nil && item.Feed.Author.Name != "":
- return address(item.Feed.Author.Name, item.defaultEmail())
+ case itemAuthor != nil && itemAuthor.Email != "":
+ return address(itemAuthor.Name, itemAuthor.Email)
+ case itemAuthor != nil && itemAuthor.Name != "":
+ return address(itemAuthor.Name, item.defaultEmail())
+ case feedAuthor != nil && feedAuthor.Email != "":
+ return address(feedAuthor.Name, feedAuthor.Email)
+ case feedAuthor != nil && feedAuthor.Name != "":
+ return address(feedAuthor.Name, item.defaultEmail())
default:
return address(item.feed.Name, item.defaultEmail())
}
099ceca11c0&follow=1'>Add description support to the databasesRené 'Necoro' Neumann4-8/+55 2010-03-04Also parse descriptions from eixRené 'Necoro' Neumann1-2/+2 2009-11-08Added Italian translation. Thanks to Ponsi.René 'Necoro' Neumann3-0/+1166 2009-10-28Changelogv0.13.10.13René 'Necoro' Neumann1-0/+4 2009-10-28Corrected config path handling.René 'Necoro' Neumann2-9/+6 2009-10-28Corrected config path handling.René 'Necoro' Neumann2-9/+6 2009-10-24Fix the segfault in GLib due to wrong encodingRené 'Necoro' Neumann1-0/+1 2009-10-24Wrong debug message in new_version pluginRené 'Necoro' Neumann1-1/+1 2009-10-24Update TRANSLATING to use gitRené 'Necoro' Neumann1-2/+15 2009-10-24Also show revision during startup and with -vRené 'Necoro' Neumann1-1/+5 2009-10-24Adding revison info to version output.René 'Necoro' Neumann3-2/+44 2009-10-23Turn new_version plugin from a mess into sth useful.René 'Necoro' Neumann2-10/+10 2009-10-23Honor branches different from masterRené 'Necoro' Neumann1-2/+4 2009-10-23Change the new_version plugin to use git.René 'Necoro' Neumann2-32/+33 2009-10-15Objectified all the functional stuff in backend.__init__.René 'Necoro' Neumann2-32/+34 2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9 2009-10-08Enhance the splash window handling.René 'Necoro' Neumann2-2/+9 2009-10-05Some more stuff to ignoreRené 'Necoro' Neumann1-0/+3 2009-10-05Renamed the ignore fileRené 'Necoro' Neumann1-0/+0 2009-10-05Update NEWSRené 'Necoro' Neumann1-0/+1 2009-10-05Also allow 'unselect all' in the PkgListRené 'Necoro' Neumann1-1/+10 2009-10-05Now have it the sorted way in PkgListsRené 'Necoro' Neumann2-3/+9 2009-10-05Enhanced system.sort_package_list to also sort CPVsRené 'Necoro' Neumann5-27/+38 2009-10-05Added an PkgList window and rewrote UpdateWindow and WorldListWindow to use itRené 'Necoro' Neumann3-39/+63 2009-10-05Add uninstall button and rename to PkgListWindowRené 'Necoro' Neumann1-2/+17 2009-10-05First quick hack to have a world listRené 'Necoro' Neumann3-2/+24