mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-05 07:03:15 -06:00
rename some stuff
This commit is contained in:
parent
a2c4c0ec03
commit
32ed58a100
33 changed files with 203 additions and 114 deletions
|
|
@ -38,15 +38,15 @@ func (c *converter) AccountToMastoSensitive(a *gtsmodel.Account) (*model.Account
|
|||
// then adding the Source object to it...
|
||||
|
||||
// check pending follow requests aimed at this account
|
||||
fr := []gtsmodel.FollowRequest{}
|
||||
if err := c.db.GetAccountFollowRequests(a.ID, &fr); err != nil {
|
||||
frs, err := c.db.GetAccountFollowRequests(a.ID)
|
||||
if err != nil {
|
||||
if err != db.ErrNoEntries {
|
||||
return nil, fmt.Errorf("error getting follow requests: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
var frc int
|
||||
if fr != nil {
|
||||
frc = len(fr)
|
||||
if frs != nil {
|
||||
frc = len(frs)
|
||||
}
|
||||
|
||||
mastoAccount.Source = &model.Source{
|
||||
|
|
@ -567,17 +567,17 @@ func (c *converter) InstanceToMasto(i *gtsmodel.Instance) (*model.Instance, erro
|
|||
statusCountKey := "status_count"
|
||||
domainCountKey := "domain_count"
|
||||
|
||||
userCount, err := c.db.GetUserCountForInstance(c.config.Host)
|
||||
userCount, err := c.db.CountInstanceUsers(c.config.Host)
|
||||
if err == nil {
|
||||
mi.Stats[userCountKey] = userCount
|
||||
}
|
||||
|
||||
statusCount, err := c.db.GetStatusCountForInstance(c.config.Host)
|
||||
statusCount, err := c.db.CountInstanceStatuses(c.config.Host)
|
||||
if err == nil {
|
||||
mi.Stats[statusCountKey] = statusCount
|
||||
}
|
||||
|
||||
domainCount, err := c.db.GetDomainCountForInstance(c.config.Host)
|
||||
domainCount, err := c.db.CountInstanceDomains(c.config.Host)
|
||||
if err == nil {
|
||||
mi.Stats[domainCountKey] = domainCount
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue