aboutsummaryrefslogtreecommitdiff
path: root/internal/reader/rss/atom.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/reader/rss/atom.go')
-rw-r--r--internal/reader/rss/atom.go37
1 files changed, 7 insertions, 30 deletions
diff --git a/internal/reader/rss/atom.go b/internal/reader/rss/atom.go
index e0d66910..27dade47 100644
--- a/internal/reader/rss/atom.go
+++ b/internal/reader/rss/atom.go
@@ -3,41 +3,18 @@
package rss // import "miniflux.app/v2/internal/reader/rss"
-import "strings"
+import (
+ "miniflux.app/v2/internal/reader/atom"
+)
type AtomAuthor struct {
- Author AtomPerson `xml:"http://www.w3.org/2005/Atom author"`
+ Author atom.AtomPerson `xml:"http://www.w3.org/2005/Atom author"`
}
-func (a *AtomAuthor) String() string {
- return a.Author.String()
-}
-
-type AtomPerson struct {
- Name string `xml:"name"`
- Email string `xml:"email"`
-}
-
-func (a *AtomPerson) String() string {
- var name string
-
- switch {
- case a.Name != "":
- name = a.Name
- case a.Email != "":
- name = a.Email
- }
-
- return strings.TrimSpace(name)
-}
-
-type AtomLink struct {
- URL string `xml:"href,attr"`
- Type string `xml:"type,attr"`
- Rel string `xml:"rel,attr"`
- Length string `xml:"length,attr"`
+func (a *AtomAuthor) PersonName() string {
+ return a.Author.PersonName()
}
type AtomLinks struct {
- Links []*AtomLink `xml:"http://www.w3.org/2005/Atom link"`
+ Links []*atom.AtomLink `xml:"http://www.w3.org/2005/Atom link"`
}