summaryrefslogtreecommitdiff
path: root/vendor/github.com/gorilla/feeds/rss.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-06-24 09:04:27 +0000
committerLibravatar GitHub <noreply@github.com>2024-06-24 09:04:27 +0000
commit03c5d016a7d3cee48fece16c3424dc40b71fb9e5 (patch)
treeaf2ee15b42dfd014166ac7d4637691ccc30b062e /vendor/github.com/gorilla/feeds/rss.go
parent[docs] fix: traefik redirect regex (#3032) (diff)
downloadgotosocial-03c5d016a7d3cee48fece16c3424dc40b71fb9e5.tar.xz
[chore]: Bump github.com/gorilla/feeds from 1.1.2 to 1.2.0 (#3035)
Diffstat (limited to 'vendor/github.com/gorilla/feeds/rss.go')
-rw-r--r--vendor/github.com/gorilla/feeds/rss.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/vendor/github.com/gorilla/feeds/rss.go b/vendor/github.com/gorilla/feeds/rss.go
index 8c227a8b7..9326cef8b 100644
--- a/vendor/github.com/gorilla/feeds/rss.go
+++ b/vendor/github.com/gorilla/feeds/rss.go
@@ -74,9 +74,9 @@ type RssItem struct {
Category string `xml:"category,omitempty"`
Comments string `xml:"comments,omitempty"`
Enclosure *RssEnclosure
- Guid string `xml:"guid,omitempty"` // Id used
- PubDate string `xml:"pubDate,omitempty"` // created or updated
- Source string `xml:"source,omitempty"`
+ Guid *RssGuid // Id used
+ PubDate string `xml:"pubDate,omitempty"` // created or updated
+ Source string `xml:"source,omitempty"`
}
type RssEnclosure struct {
@@ -87,6 +87,13 @@ type RssEnclosure struct {
Type string `xml:"type,attr"`
}
+type RssGuid struct {
+ //RSS 2.0 <guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid>
+ XMLName xml.Name `xml:"guid"`
+ Id string `xml:",chardata"`
+ IsPermaLink string `xml:"isPermaLink,attr,omitempty"` // "true", "false", or an empty string
+}
+
type Rss struct {
*Feed
}
@@ -96,9 +103,11 @@ func newRssItem(i *Item) *RssItem {
item := &RssItem{
Title: i.Title,
Description: i.Description,
- Guid: i.Id,
PubDate: anyTimeFormat(time.RFC1123Z, i.Created, i.Updated),
}
+ if i.Id != "" {
+ item.Guid = &RssGuid{Id: i.Id, IsPermaLink: i.IsPermaLink}
+ }
if i.Link != nil {
item.Link = i.Link.Href
}