back interdiff of round #2 and #1

appview: implement follower and following pages for users #484

merged
opened by ptr.pet targeting master from ptr.pet/core: 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
···
return tx.Commit()
}
-
func GetProfiles(e Execer, filters ...filter) ([]Profile, error) {
+
func GetProfiles(e Execer, filters ...filter) (map[string]*Profile, error) {
var conditions []string
var args []any
for _, filter := range filters {
···
idxs[did] = idx + 1
}
-
var profiles []Profile
-
for _, p := range profileMap {
-
profiles = append(profiles, *p)
-
}
-
-
return profiles, nil
+
return profileMap, nil
}
func GetProfile(e Execer, did string) (*Profile, error) {
NEW
appview/db/timeline.go
···
return nil, nil
}
-
profileMap := make(map[string]Profile)
profiles, err := GetProfiles(e, FilterIn("did", subjects))
if err != nil {
return nil, err
}
-
for _, p := range profiles {
-
profileMap[p.Did] = p
-
}
followStatMap := make(map[string]FollowStats)
for _, s := range subjects {
···
var events []TimelineEvent
for _, f := range follows {
-
profile, _ := profileMap[f.SubjectDid]
+
profile, _ := profiles[f.SubjectDid]
followStatMap, _ := followStatMap[f.SubjectDid]
events = append(events, TimelineEvent{
Follow: &f,
-
Profile: &profile,
+
Profile: profile,
FollowStats: &followStatMap,
EventAt: f.FollowedAt,
})