ref: 20d3065cd1ac663ce01079786320d3b3707e25a3
parent: 046bf407f6bc4ea1d4b35ebbcd449fd493d292c4
author: penny <penny@limitedideas.org>
date: Fri Sep 12 22:09:11 EDT 2025
Relationship details for account renderer
--- a/main.go
+++ b/main.go
@@ -305,7 +305,7 @@
return
case "account":
account := postItem.Account
- fmt.Printf(formatAccount(&account))
+ fmt.Printf(hc.formatAccount(&account))
return
case "fpost":
_, err := hc.filterStatus(postItem)
--- a/mastodon.go
+++ b/mastodon.go
@@ -213,7 +213,7 @@
return post.Account.Acct
}
-func formatAccount(account *mastodon.Account) string {+func (hc *Hellclient) formatAccount(account *mastodon.Account) string {var sb strings.Builder
sb.WriteString(fmt.Sprintf("%v\n", account.DisplayName))@@ -222,6 +222,27 @@
sb.WriteString(fmt.Sprintf("Created %v\n", account.CreatedAt)) sb.WriteString(fmt.Sprintf("Locked: %v\n", account.Locked)) sb.WriteString(fmt.Sprintf("%v\n\n", html2text.HTML2Text(account.Note)))+
+ relationships, err := hc.client.GetAccountRelationships(context.Background(), []string{string(account.ID)})+ relationship := relationships[0]
+ if err == nil {+ if relationship.Following {+ sb.WriteString("You follow them\n")+ }
+ if relationship.FollowedBy {+ sb.WriteString("They follow you\n")+ }
+ if relationship.Blocking {+ sb.WriteString("Account is blocked\n")+ }
+ if relationship.Muting {+ sb.WriteString("Account is muted\n")+ }
+ if relationship.Requested {+ sb.WriteString("Follow request pending\n")+ }
+ }
+
return sb.String()
}
--
⑨