Merge pull request #793 from writefreely/fix-fedi-followers

Add missing methods for showing fediverse followers
pull/799/head
Matt Baer 1 year ago committed by GitHub
commit 71fd25870d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      activitypub.go

@ -65,6 +65,20 @@ type RemoteUser struct {
SharedInbox string SharedInbox string
URL string URL string
Handle string Handle string
Created time.Time
}
func (ru *RemoteUser) CreatedFriendly() string {
return ru.Created.Format("January 2, 2006")
}
func (ru *RemoteUser) EstimatedHandle() string {
if ru.Handle != "" {
return ru.Handle
}
username := filepath.Base(ru.ActorID)
host, _ := url.Parse(ru.ActorID)
return username + "@" + host.Host
} }
func (ru *RemoteUser) AsPerson() *activitystreams.Person { func (ru *RemoteUser) AsPerson() *activitystreams.Person {

Loading…
Cancel
Save