From 8db0afabf609ddbb59f21614049d81def583e919 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 10 Nov 2018 20:56:36 -0500 Subject: [PATCH] Show number of followers on stats page --- account.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/account.go b/account.go index 0ab5d64..1edba1a 100644 --- a/account.go +++ b/account.go @@ -957,17 +957,13 @@ func viewStats(app *app, u *User, w http.ResponseWriter, r *http.Request) error Collection: c, TopPosts: topPosts, } - /* - if app.cfg.App.Federation { - // TODO: fetch all user's blogs, fetch number of followers for each - // TODO: might as well show page views for blogs, too - folls, err = app.db.GetAPFollowers() - if err != nil { - return err - } - obj.APFollowers = len(folls) + if app.cfg.App.Federation { + folls, err := app.db.GetAPFollowers(c) + if err != nil { + return err } - */ + obj.APFollowers = len(*folls) + } showUserPage(w, "stats", obj) return nil