back interdiff of round #2 and #1

appview: implement follower and following pages for users #484

merged
opened by ptr.pet targeting master from [deleted fork]: followers-following-list
ERROR
appview/pages/funcmap.go

Failed to calculate interdiff for this file.

REBASED
appview/pages/pages.go

This patch was likely rebased, as context lines do not match.

ERROR
appview/pages/templates/user/followers.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/following.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/fragments/follow.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/fragments/followCard.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/fragments/profileCard.html

Failed to calculate interdiff for this file.

REBASED
appview/state/profile.go

This patch was likely rebased, as context lines do not match.

ERROR
appview/state/router.go

Failed to calculate interdiff for this file.

ERROR
appview/strings/strings.go

Failed to calculate interdiff for this file.

NEW
appview/db/profile.go
··· 348 return tx.Commit() 349 } 350 351 - func GetProfiles(e Execer, filters ...filter) ([]Profile, error) { 352 var conditions []string 353 var args []any 354 for _, filter := range filters { ··· 448 idxs[did] = idx + 1 449 } 450 451 - var profiles []Profile 452 - for _, p := range profileMap { 453 - profiles = append(profiles, *p) 454 - } 455 - 456 - return profiles, nil 457 } 458 459 func GetProfile(e Execer, did string) (*Profile, error) {
··· 348 return tx.Commit() 349 } 350 351 + func GetProfiles(e Execer, filters ...filter) (map[string]*Profile, error) { 352 var conditions []string 353 var args []any 354 for _, filter := range filters { ··· 448 idxs[did] = idx + 1 449 } 450 451 + return profileMap, nil 452 } 453 454 func GetProfile(e Execer, did string) (*Profile, error) {
NEW
appview/db/timeline.go
··· 151 return nil, nil 152 } 153 154 - profileMap := make(map[string]Profile) 155 profiles, err := GetProfiles(e, FilterIn("did", subjects)) 156 if err != nil { 157 return nil, err 158 } 159 - for _, p := range profiles { 160 - profileMap[p.Did] = p 161 - } 162 163 followStatMap := make(map[string]FollowStats) 164 for _, s := range subjects { ··· 174 175 var events []TimelineEvent 176 for _, f := range follows { 177 - profile, _ := profileMap[f.SubjectDid] 178 followStatMap, _ := followStatMap[f.SubjectDid] 179 180 events = append(events, TimelineEvent{ 181 Follow: &f, 182 - Profile: &profile, 183 FollowStats: &followStatMap, 184 EventAt: f.FollowedAt, 185 })
··· 151 return nil, nil 152 } 153 154 profiles, err := GetProfiles(e, FilterIn("did", subjects)) 155 if err != nil { 156 return nil, err 157 } 158 159 followStatMap := make(map[string]FollowStats) 160 for _, s := range subjects { ··· 170 171 var events []TimelineEvent 172 for _, f := range follows { 173 + profile, _ := profiles[f.SubjectDid] 174 followStatMap, _ := followStatMap[f.SubjectDid] 175 176 events = append(events, TimelineEvent{ 177 Follow: &f, 178 + Profile: profile, 179 FollowStats: &followStatMap, 180 EventAt: f.FollowedAt, 181 })