Commit graph

107 commits

Author SHA1 Message Date
0f7668a046
refactor: code refactoring
- use colon when unwrapping error
- update naming convention in show executor.
2024-06-03 07:00:39 +01:00
dd76a9a857
feat: add bookmark support
Add support for viewing the user's list of bookmarks, as well as adding
and removing statuses from the list.
2024-06-03 06:53:31 +01:00
674f277eba
fix: add new type StatusList
Add a new type called StatusList for managing different types of status
lists in preparation for bookmark support. This replaces the Timeline
type.

Update timeline headers.
2024-06-03 03:54:27 +01:00
8e4da7f827
fix: resolve index out of range bug in word wrap
Resolved the index out of range [-1] bug from the word wrap function
by checking the cursors' positions before evaluating the preceding
character.
2024-06-02 14:06:49 +01:00
c6c711c29b
fix: update error handling
Changes:

- Move InvalidListRepliesPolicyError, InvalidTimelineCategory,
  InvalidStatusVisibility and InvalidStatusContentTypeError type to the
  model package.
- Clean up some code in regards to the parsing of the Enum types.
- Clean up the error messages sent back to the user.
- Use colons instead of semicolons when unwrapping error messages.
- Print errors to Standard Error (os.Stderr)
2024-06-02 11:35:43 +01:00
c05cce9154
chore: make the project REUSE compliant 2024-06-02 07:53:13 +01:00
6a799ff5ac
fix: parse HTML lists within a status
Updated the ConvertHTMLToText function to properly parse and convert
both ordered and unordered lists to plain text.
2024-06-01 08:29:45 +01:00
5cf6116fe8
fix: display full account name in list
Show the full names of the accounts of a list instead of their
account IDs
2024-05-31 21:41:10 +01:00
bff1eba972
feat: add NO_COLOR support
Add support for disabling ANSI colour output via the --no-color flag
or the NO_COLOR environment variable. The suggested implementation was
inspired by the standards defined at no-color.org
2024-05-31 21:18:11 +01:00
88d6a8d498
fix: respect the default sensitivity setting
Respect the user's default posting sensitivity preference setting if
the user has not explicitly set the sensitive flag.
2024-05-31 05:22:17 +01:00
ca48d1bfce
feat: post a status from a file
Allow users to post a status from a file using the --from-file flag.
If both --content and --from-file flags are used then the --content
flag takes precedence.
2024-05-31 04:18:34 +01:00
b6b6f75715
refactor: add more form types for the client 2024-05-30 20:04:55 +01:00
35575f32de
refactor: refactor the ListRepliesPolicy enum type
Refactor the ListRepliesPolicy enum type to bring it in line with the
others.
2024-05-30 19:42:11 +01:00
ea05294cb5
feat: add support for posting statuses
Users can now post one line statuses.
2024-05-30 18:46:33 +01:00
e73dbb45ed
feat: add more browser support
Add support for opening links for accounts and statuses in a user's
favourite web browser.

Changes:

- Add browser support if the BROWSER environment variable is set.
- Add support for viewing accounts in the browser.
- Add support for viewing statuses in the browser (if they are publicly
  viewable)
2024-05-29 22:23:51 +01:00
a7e72ac2c4
chore: split utility functions
Split utility functions into separate files.
2024-05-29 18:33:16 +01:00
68ce6eed1d
fix: correctly show reposted statuses
Correctly show when a status is actually a reposted status in the
timelines. The ID and created time of the original status is now
displayed instead of the reposted status.
2024-05-27 01:05:31 +01:00
b89c0358f4
fix: resolve infinite loop issue in wrapLine fn
The wrap line function breaks a line at the position of the last
white space before reaching the line limit, however sometimes a single
word (e.g. a very long url) exceeds the character limit itself which
threw the function into an infinite loop. This commit fixes that by
breaking said word at the last letter before the character limit is
reached.
2024-05-27 00:14:29 +01:00
f3d9d34f3c
fix: content missing when displaying Status
This commit fixes the issue where the contents of a status is not shown
when displayed on screen. For statuses made in GTS the Text field is
populated with the plain text version of the content however this is
unfortunately not the case for Mastodon statuses, therefore the Content
field is used instead and the contents is processed with StripHTMLTags
function to remove the HTML tags before printing.
2024-05-26 15:07:34 +01:00
7a3f2928de
fix: update the StripHTMLTags function
- Do not add an extra space between text tokens.
- Add a line break if the 'br' tag is detected.
2024-05-26 01:18:44 +01:00
2f38a07cb5
build: fixed issues with mage 2024-05-23 19:33:09 +01:00
c8ee788832
fix: show account relationship by default
This is a breaking change.

Changes:

- Show the relationship between the user and the account by default.
- Remove the show-relationship flag.
- Add the skip-relationship flag so that users can set this to true if
  they don't want to display the relationship.
2024-05-23 18:22:13 +01:00
55b93c6586
fix(breaking): update project structure
Move all executors to the internal folder package. This PR also comes
with additional breaking changes.

Changes:

- refactor: move all executors to the internal/executor package.
- refactor: update naming patterns for constants, variables, custom
  types, etc.
- fix(breaking): renamed the update command to edit.
- fix(breaking): update the flags for the switch command to make it
  more generic.
- fix(breaking): renamed the show-account-relationship flag to
  show-relationship.
- fix: update the print message from the whoami command.
2024-05-23 18:06:49 +01:00
3d17c30d0f
build: moved magefiles directory to project root
Moved the magefiles directory back to the project's root directory and
created a separate go.mod file to keep the dependencies separated.

The idea was suggested here:
https://github.com/magefile/mage/issues/502
2024-05-23 11:09:34 +01:00
421c21bf52
feat: allow users to specify the config directory
Allow users to specify their preferred configuration directory by using
the top level flag (a.k.a 'global flag') --config-dir. This also
introduces the design of baking top level flags into the executor.
2024-05-22 23:30:09 +01:00
ecc8d51c09
feat: private notes
This commit allows users to add or remove private notes from
accounts.

Changes:

- feat: added functionality to add or remove private notes from
  accounts.
- fix: added new error types or unsupported add and remove
  operations.
- build: build Enbas without rebuilding all packages by default to
  speed up local builds for development.
2024-05-22 11:58:56 +01:00
6e40792fec
fix: redesign the add and remove commands
Redesigned the add and remove subcommands so that it is easier to add
logic when adding and removing additional resources.
2024-05-21 23:05:23 +01:00
f6d67a98e0
fix: use the account name instead of account ID
The user will now specify the account name instead of the account ID
when performing operations such as following and blocking. Enbas will
lookup the account and retrieve the account ID before sending the
request to GoToSocial. This prevents the user from having to retrieve
the account ID themselves which should make it a bit easier to use.
2024-05-21 21:06:18 +01:00
f9f817eaa1
chore: remove account_relationship.go
Remove internal/model/account_relationship.go
2024-05-21 14:38:35 +01:00
d1ceecf697
refactor: move AccountRelationship to account.go
Move the AccountRelationship type definition to
internal/model/account.go
2024-05-21 14:36:49 +01:00
9d8cb2c68e
refactor: add new AccountList type for accounts
Add a new AccountList type for handling the printing of different list
of accounts (such as following, followers and blocked accounts).
2024-05-21 14:30:50 +01:00
dffd324243
feat: block and unblock accounts
This commit adds the functionality to allow users to block and unblock
accounts. The user will also be able to view a list of blocked
accounts.
2024-05-21 13:19:53 +01:00
a77f3741a0
feat: show user preferences
Optionally show the user's preferences when viewing account.
2024-05-20 19:46:05 +01:00
de5cf65aa8
fix: use my-account flag for showing followers
Allow the use of the my-account flag when showing followers
and following accounts for the authenticated user.
2024-05-20 18:37:29 +01:00
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
b91ebe5864
fix: update internal models for GoToSocial v0.15.0
Update the internal models for the client in line with the GoToSocial
v0.15.0 API.

Improve the output of the instance information.
2024-05-19 15:26:13 +01:00
32ca448ae7
feat: add and remove accounts from a list
Summary:

This commit adds the ability to add and remove accounts from a list.

The list models has also been updated to change the way lists are
displayed on screen.

Changes:

- Added a subcommand to add accounts to a list.
- Added a subcommand to remove accounts from a list.
- Added a custom error for unknown subcommands.
- Added a custom error when no account IDs are specified when
  expected.
2024-05-19 11:48:36 +01:00
4f694465bf
fix: update FlagSet code
- Added constants for flag names and resource types
- Added an error type for when a required flag is not set
- Added an error type for when an unsupported resource type is specified
- Renamed timeline-type to timeline-category
2024-02-28 19:35:18 +00:00
c507815ef6
feat: add the whoami command
The whoami command shows the user the name of the account they are
currently logged in to.
2024-02-28 14:09:12 +00:00
25633e5049
fix: fixed file name 2024-02-27 20:06:13 +00:00
acf36559b6
refactor: split files in internal client package 2024-02-27 20:05:03 +00:00
bc18c00c69
feat: add ability to interact with lists
Add the ability to create, update, list and delete lists.

Note, adding accounts or removing them from lists is not scoped
in this PR.
2024-02-27 19:52:59 +00:00
c38689fe28
fix(breaking): update the credentials filename
Save the credentials to the credentials.json file in the config
directory.
2024-02-27 09:31:17 +00:00
e574ccaf2b
docs: update project documentation
Converted the Markdown documentation to AsciiDoc and added
documentation on the project's summary, available installation methods
and basic usage.
2024-02-27 09:05:14 +00:00
f56e0d6e7c
chore: add .gitattributes 2024-02-26 10:35:16 +00:00
2177063ca4
build: add the install mage target 2024-02-25 15:10:02 +00:00
41d434a69e
chore: rename license file
Renamed the license file to COPYING as per GNU conventions.
2024-02-25 09:44:20 +00:00
5a795c8ae0
refactor: remove dependency on golang.org/x/oauth2
This commit refactors the login flow to a GTS server thanks to an update
in the official GTS documentation.

golang.org/x/oauth2 is no longer needed.

Documentation reference:
- https://docs.gotosocial.org/en/latest/api/authentication/
2024-02-25 06:41:13 +00:00
c39b173cd6
fix: add proper support for multi-line wrapping 2024-02-24 17:46:00 +00:00
ae2b5d8036
fix: fixed spelling error 2024-02-24 16:21:35 +00:00