Add missing methods for showing fediverse followers

Fixes #791
fix-fedi-followers
Matt Baer 1 year ago
parent 4aad0338bf
commit dd797c8145
  1. 14
      activitypub.go

@ -65,6 +65,20 @@ type RemoteUser struct {
SharedInbox string
URL 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 {

Loading…
Cancel
Save