+2
appview/pages/pages.go
+2
appview/pages/pages.go
···
439
439
RepoInfo RepoInfo
440
440
Active string
441
441
Issues []db.Issue
442
+
DidHandleMap map[string]string
442
443
}
443
444
444
445
func (p *Pages) RepoIssues(w io.Writer, params RepoIssuesParams) error {
···
453
454
Issue db.Issue
454
455
Comments []db.Comment
455
456
IssueOwnerHandle string
457
+
DidHandleMap map[string]string
456
458
457
459
State string
458
460
}
+1
-1
appview/pages/templates/repo/issues/issue.html
+1
-1
appview/pages/templates/repo/issues/issue.html
+1
-1
appview/pages/templates/repo/issues/issues.html
+1
-1
appview/pages/templates/repo/issues/issues.html
+31
-1
appview/state/repo.go
+31
-1
appview/state/repo.go
···
545
545
log.Println("failed to resolve issue owner", err)
546
546
}
547
547
548
+
identsToResolve := make([]string, len(comments))
549
+
for i, comment := range comments {
550
+
identsToResolve[i] = comment.OwnerDid
551
+
}
552
+
resolvedIds := s.resolver.ResolveIdents(r.Context(), identsToResolve)
553
+
didHandleMap := make(map[string]string)
554
+
for _, identity := range resolvedIds {
555
+
if !identity.Handle.IsInvalidHandle() {
556
+
didHandleMap[identity.DID.String()] = fmt.Sprintf("@%s", identity.Handle.String())
557
+
} else {
558
+
didHandleMap[identity.DID.String()] = identity.DID.String()
559
+
}
560
+
}
561
+
548
562
s.pages.RepoSingleIssue(w, pages.RepoSingleIssueParams{
549
563
LoggedInUser: user,
550
564
RepoInfo: pages.RepoInfo{
···
557
571
Comments: comments,
558
572
559
573
IssueOwnerHandle: issueOwnerIdent.Handle.String(),
574
+
DidHandleMap: didHandleMap,
560
575
})
561
576
562
577
}
···
747
762
return
748
763
}
749
764
765
+
identsToResolve := make([]string, len(issues))
766
+
for i, issue := range issues {
767
+
identsToResolve[i] = issue.OwnerDid
768
+
}
769
+
resolvedIds := s.resolver.ResolveIdents(r.Context(), identsToResolve)
770
+
didHandleMap := make(map[string]string)
771
+
for _, identity := range resolvedIds {
772
+
if !identity.Handle.IsInvalidHandle() {
773
+
didHandleMap[identity.DID.String()] = fmt.Sprintf("@%s", identity.Handle.String())
774
+
} else {
775
+
didHandleMap[identity.DID.String()] = identity.DID.String()
776
+
}
777
+
}
778
+
750
779
s.pages.RepoIssues(w, pages.RepoIssuesParams{
751
780
LoggedInUser: s.auth.GetUser(r),
752
781
RepoInfo: pages.RepoInfo{
···
755
784
Name: f.RepoName,
756
785
SettingsAllowed: settingsAllowed(s, user, f),
757
786
},
758
-
Issues: issues,
787
+
Issues: issues,
788
+
DidHandleMap: didHandleMap,
759
789
})
760
790
return
761
791
}