bit of tidying up!
This commit is contained in:
@ -449,7 +449,7 @@ func (c *converter) StatusToMasto(s *gtsmodel.Status, requestingAccount *gtsmode
|
||||
var mastoCard *model.Card
|
||||
var mastoPoll *model.Poll
|
||||
|
||||
statusInteractions := >smodel.StatusInteractions{}
|
||||
statusInteractions := &statusInteractions{}
|
||||
si, err := c.interactionsWithStatusForAccount(s, requestingAccount)
|
||||
if err == nil {
|
||||
statusInteractions = si
|
||||
@ -610,34 +610,3 @@ func (c *converter) NotificationToMasto(n *gtsmodel.Notification) (*model.Notifi
|
||||
Status: mastoStatus,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *converter) interactionsWithStatusForAccount(s *gtsmodel.Status, requestingAccount *gtsmodel.Account) (*gtsmodel.StatusInteractions, error) {
|
||||
si := >smodel.StatusInteractions{}
|
||||
|
||||
if requestingAccount != nil {
|
||||
faved, err := c.db.StatusFavedBy(s, requestingAccount.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking if requesting account has faved status: %s", err)
|
||||
}
|
||||
si.Faved = faved
|
||||
|
||||
reblogged, err := c.db.StatusRebloggedBy(s, requestingAccount.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking if requesting account has reblogged status: %s", err)
|
||||
}
|
||||
si.Reblogged = reblogged
|
||||
|
||||
muted, err := c.db.StatusMutedBy(s, requestingAccount.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking if requesting account has muted status: %s", err)
|
||||
}
|
||||
si.Muted = muted
|
||||
|
||||
bookmarked, err := c.db.StatusBookmarkedBy(s, requestingAccount.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking if requesting account has bookmarked status: %s", err)
|
||||
}
|
||||
si.Bookmarked = bookmarked
|
||||
}
|
||||
return si, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user