enbas/internal/model/follows.go
Dan Anglin 1a95384ba0
feat: followers and following others
This commit adds the ability to follow and unfollow (remote)
accounts and to display a list of followers and followees for
a specified account.

Changes:

- Added a command to follow an account.
- Added a command to unfollow an account.
- When displaying an account you can optionally view the relationship
  between that account and yourself.
- Added a command to view accounts that are following a specified
  account.
- Added a command to view accounts that are followed by a specified
  account.
2024-05-20 17:31:50 +01:00

41 lines
666 B
Go

package model
import (
"fmt"
"codeflow.dananglin.me.uk/apollo/enbas/internal/utilities"
)
type Followers []Account
func (f Followers) String() string {
output := "\n"
output += utilities.HeaderFormat("FOLLOWED BY:")
for i := range f {
output += fmt.Sprintf(
"\n • %s (%s)",
utilities.DisplayNameFormat(f[i].DisplayName),
f[i].Acct,
)
}
return output
}
type Following []Account
func (f Following) String() string {
output := "\n"
output += utilities.HeaderFormat("FOLLOWING:")
for i := range f {
output += fmt.Sprintf(
"\n • %s (%s)",
utilities.DisplayNameFormat(f[i].DisplayName),
f[i].Acct,
)
}
return output
}