mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-07 06:13:18 -06:00
i broke SOMETHING but what, it's a mystery
This commit is contained in:
parent
702d534136
commit
3e72a9757b
5 changed files with 108 additions and 74 deletions
|
|
@ -633,22 +633,22 @@ func (c *converter) RelationshipToMasto(r *gtsmodel.Relationship) (*model.Relati
|
|||
}
|
||||
|
||||
func (c *converter) NotificationToMasto(n *gtsmodel.Notification) (*model.Notification, error) {
|
||||
|
||||
if n.TargetAccount == nil {
|
||||
tAccount := >smodel.Account{}
|
||||
if err := c.db.GetByID(n.TargetAccountID, tAccount); err != nil {
|
||||
tAccount, err := c.db.GetAccountByID(n.TargetAccountID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("NotificationToMasto: error getting target account with id %s from the db: %s", n.TargetAccountID, err)
|
||||
}
|
||||
n.TargetAccount = tAccount
|
||||
}
|
||||
|
||||
if n.OriginAccount == nil {
|
||||
ogAccount := >smodel.Account{}
|
||||
if err := c.db.GetByID(n.OriginAccountID, ogAccount); err != nil {
|
||||
ogAccount, err := c.db.GetAccountByID(n.OriginAccountID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("NotificationToMasto: error getting origin account with id %s from the db: %s", n.OriginAccountID, err)
|
||||
}
|
||||
n.OriginAccount = ogAccount
|
||||
}
|
||||
|
||||
mastoAccount, err := c.AccountToMastoPublic(n.OriginAccount)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("NotificationToMasto: error converting account to masto: %s", err)
|
||||
|
|
@ -657,8 +657,8 @@ func (c *converter) NotificationToMasto(n *gtsmodel.Notification) (*model.Notifi
|
|||
var mastoStatus *model.Status
|
||||
if n.StatusID != "" {
|
||||
if n.Status == nil {
|
||||
status := >smodel.Status{}
|
||||
if err := c.db.GetByID(n.StatusID, status); err != nil {
|
||||
status, err := c.db.GetStatusByID(n.StatusID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("NotificationToMasto: error getting status with id %s from the db: %s", n.StatusID, err)
|
||||
}
|
||||
n.Status = status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue