diff options
author | 2023-09-23 17:44:11 +0100 | |
---|---|---|
committer | 2023-09-23 18:44:11 +0200 | |
commit | 8f67dd583d86155440e7905ae23083a9fea42f72 (patch) | |
tree | e67abf09a53c2d9053df8072b074a026969d93ef /internal/typeutils/internaltorss.go | |
parent | [chore] fix typo in slice.go (#2219) (diff) | |
download | gotosocial-8f67dd583d86155440e7905ae23083a9fea42f72.tar.xz |
[chore] deinterface the typeutils.Converter and update to use state structure (#2217)
* update typeconverter to use state structure
* deinterface the typeutils.TypeConverter -> typeutils.Converter
* finish copying over old type converter code comments
* fix cherry-pick merge issues, fix tests pointing to old typeutils interface type still
Diffstat (limited to 'internal/typeutils/internaltorss.go')
-rw-r--r-- | internal/typeutils/internaltorss.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/typeutils/internaltorss.go b/internal/typeutils/internaltorss.go index adec26a30..e70b11aae 100644 --- a/internal/typeutils/internaltorss.go +++ b/internal/typeutils/internaltorss.go @@ -36,7 +36,7 @@ const ( rssDescriptionMaxRunes = 256 ) -func (c *converter) StatusToRSSItem(ctx context.Context, s *gtsmodel.Status) (*feeds.Item, error) { +func (c *Converter) StatusToRSSItem(ctx context.Context, s *gtsmodel.Status) (*feeds.Item, error) { // see https://cyber.harvard.edu/rss/rss.html // Title -- The title of the item. @@ -57,7 +57,7 @@ func (c *converter) StatusToRSSItem(ctx context.Context, s *gtsmodel.Status) (*f // Author -- Email address of the author of the item. // example: oprah\@oxygen.net if s.Account == nil { - a, err := c.db.GetAccountByID(ctx, s.AccountID) + a, err := c.state.DB.GetAccountByID(ctx, s.AccountID) if err != nil { return nil, fmt.Errorf("error getting status author: %s", err) } @@ -110,7 +110,7 @@ func (c *converter) StatusToRSSItem(ctx context.Context, s *gtsmodel.Status) (*f if len(s.Attachments) > 0 { attachment = s.Attachments[0] } else if len(s.AttachmentIDs) > 0 { - a, err := c.db.GetAttachmentByID(ctx, s.AttachmentIDs[0]) + a, err := c.state.DB.GetAttachmentByID(ctx, s.AttachmentIDs[0]) if err == nil { attachment = a } @@ -139,7 +139,7 @@ func (c *converter) StatusToRSSItem(ctx context.Context, s *gtsmodel.Status) (*f } else { for _, e := range s.EmojiIDs { gtsEmoji := >smodel.Emoji{} - if err := c.db.GetByID(ctx, e, gtsEmoji); err != nil { + if err := c.state.DB.GetByID(ctx, e, gtsEmoji); err != nil { log.Errorf(ctx, "error getting emoji with id %s: %s", e, err) continue } |