aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/feed.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-02 02:06:56 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-02 02:06:56 +0200
commitff4f709486a69bc1650db73a003255e58cae0532 (patch)
tree66f9c0008e11f36e7ed8b50858577a4308ea10f0 /internal/feed/feed.go
parentb44a7b8307f2928039f0da8205518818fb4247b1 (diff)
downloadfeed2imap-go-ff4f709486a69bc1650db73a003255e58cae0532.tar.gz
feed2imap-go-ff4f709486a69bc1650db73a003255e58cae0532.tar.bz2
feed2imap-go-ff4f709486a69bc1650db73a003255e58cae0532.zip
Embedding images in mail
Diffstat (limited to '')
-rw-r--r--internal/feed/feed.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go
index ddc91ed..1a6ef97 100644
--- a/internal/feed/feed.go
+++ b/internal/feed/feed.go
@@ -23,11 +23,18 @@ type feedDescriptor struct {
Url string
}
+type feedImage struct {
+ image []byte
+ mime string
+}
+
type feeditem struct {
*gofeed.Feed
*gofeed.Item
+ Body string
updateOnly bool
reasons []string
+ images []feedImage
}
// Creator returns the name of the creating author.
@@ -45,6 +52,16 @@ func (item *feeditem) addReason(reason string) {
}
}
+func (item *feeditem) addImage(img []byte, mime string) int {
+ i := feedImage{img, mime}
+ item.images = append(item.images, i)
+ return len(item.images)
+}
+
+func (item *feeditem) clearImages() {
+ item.images = []feedImage{}
+}
+
func (feed *Feed) descriptor() feedDescriptor {
return feedDescriptor{
Name: feed.Name,