shithub: hell

Download patch

ref: 38f5995247508ae1dc33cfcf4b4e015d05bd0aba
parent: e6cb144f4f91ed3b287e8f0217cb8084a04afc7d
author: penny <penny@limitedideas.org>
date: Fri Sep 26 15:20:20 EDT 2025

only display the account on the first account page

--- a/main.go
+++ b/main.go
@@ -344,26 +344,31 @@
 				}
 				return
 			case "account":
+				var account *mastodon.Account
+				var accounts []*mastodon.Account
 				if foundindex {
-					account := postItem.Account
-					fmt.Println(hc.formatAccount(&account))
+					account = &postItem.Account
+					fmt.Println(hc.formatAccount(account))
+				} else {
+					accounts, err = hc.client.AccountsSearchResolve(context.Background(), index, 1, true)
+					if err != nil {
+						fmt.Printf("Error resolving account %s: %v\n", index, err)
 					return
-				}
-				accounts, err := hc.client.AccountsSearchResolve(context.Background(), index, 1, true)
-				if err != nil {
-					fmt.Printf("Error resolving account %s: %v\n", index, err)
+					}
+					if len(accounts) < 1 {
+						fmt.Printf("No account matched %s\n", index)
 					return
+					}
+					account = accounts[0]
 				}
-				if len(accounts) < 1 {
-					fmt.Printf("No account matched %s\n", index)
-					return
-				}
-				account := accounts[0]
-				fmt.Println(hc.formatAccount(account))
+
 				hc.pause(true)
 				hc.page = &Page{}
+				hc.page.itembuffer = new([]PageItem)
 				getter := &AccountStatusGetter{client: hc.client, ID: account.ID}
 				hc.page.loader = &StatusPages{hc: hc, getter: getter}
+				*hc.page.itembuffer = append(*hc.page.itembuffer, makePageItem(hc.formatAccount(account)))
+				(*hc.page.itembuffer)[0].lines = -1
 				fmt.Print(hc.page.String())
 				return
 			case "fpost":
--- a/pages.go
+++ b/pages.go
@@ -23,8 +23,8 @@
 }
 
 type AccountStatusGetter struct {
-	page *mastodon.Pagination
-	ID mastodon.ID
+	page   *mastodon.Pagination
+	ID     mastodon.ID
 	client *mastodon.Client
 }
 
@@ -128,6 +128,13 @@
 		if i != 0 && linecount > height {
 			return
 		}
+		if i !=0 && items[i].lines == -1 {
+			return
+		}
+		if i == 0 && items[i].lines == -1 {
+			index++
+			return
+			}
 		index++
 	}
 	return
--