Monorepo for Tangled tangled.org

appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go #505

merged opened by ptr.pet targeting master from [deleted fork]: followers-following-list
  • moves FollowStats type from timeline.go into follow.go
  • makes existing GetFollowersFollowingCount also use FollowStats

Signed-off-by: dusk y.bera003.06@protonmail.com

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:dfl62fgb7wtjj3fcbb72naae/sh.tangled.repo.pull/3lwlu4rjlr522
+6 -6
Interdiff #1 #2
appview/db/follow.go

This file has not been changed.

appview/db/timeline.go

This file has not been changed.

appview/state/profile.go

This file has not been changed.

+6 -6
appview/strings/strings.go
··· 182 followStatus = db.GetFollowStatus(s.Db, loggedInUser.Did, id.DID.String()) 183 } 184 185 - followStats, err := db.GetFollowerFollowingCount(s.Db, id.DID.String()) 186 if err != nil { 187 l.Error("failed to get follow stats", "err", err) 188 } ··· 194 UserHandle: id.Handle.String(), 195 Profile: profile, 196 FollowStatus: followStatus, 197 - FollowersCount: followStats.Followers, 198 - FollowingCount: followStats.Following, 199 }, 200 Strings: all, 201 }) ··· 203 followStatus = db.GetFollowStatus(s.Db, loggedInUser.Did, id.DID.String()) 204 } 205 206 - followersCount, followingCount, err := db.GetFollowerFollowingCount(s.Db, id.DID.String()) 207 if err != nil { 208 l.Error("failed to get follow stats", "err", err) 209 } ··· 215 UserHandle: id.Handle.String(), 216 Profile: profile, 217 FollowStatus: followStatus, 218 - FollowersCount: followersCount, 219 - FollowingCount: followingCount, 220 }, 221 Strings: all, 222 })
··· 182 followStatus = db.GetFollowStatus(s.Db, loggedInUser.Did, id.DID.String()) 183 } 184 185 + followersCount, followingCount, err := db.GetFollowerFollowingCount(s.Db, id.DID.String()) 186 if err != nil { 187 l.Error("failed to get follow stats", "err", err) 188 } ··· 194 UserHandle: id.Handle.String(), 195 Profile: profile, 196 FollowStatus: followStatus, 197 + FollowersCount: followersCount, 198 + FollowingCount: followingCount, 199 }, 200 Strings: all, 201 }) ··· 203 followStatus = db.GetFollowStatus(s.Db, loggedInUser.Did, id.DID.String()) 204 } 205 206 + followStats, err := db.GetFollowerFollowingCount(s.Db, id.DID.String()) 207 if err != nil { 208 l.Error("failed to get follow stats", "err", err) 209 } ··· 215 UserHandle: id.Handle.String(), 216 Profile: profile, 217 FollowStatus: followStatus, 218 + FollowersCount: followStats.Followers, 219 + FollowingCount: followStats.Following, 220 }, 221 Strings: all, 222 })

History

6 rounds 1 comment
sign up or login to add to the discussion
1 commit
expand
d26339c3
appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go
expand 0 comments
pull request successfully merged
1 commit
expand
b53b741b
appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go
expand 0 comments
1 commit
expand
6a25e41d
appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go
expand 1 comment
ptr.pet submitted #2
1 commit
expand
1ee8694a
appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go
expand 0 comments
1 commit
expand
f4a55cc1
appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go
expand 0 comments
ptr.pet submitted #0
1 commit
expand
79e77406
appview: implement GetFollowersFollowingCounts to query follow stats for multiple dids in one go
expand 0 comments