Commit graph

45 commits

Author SHA1 Message Date
a0eab3b6ae
refactor: clean up the getAccountID function sig
The getAccountID function no longer needs the path to the credentials
file.
2024-08-13 23:51:16 +01:00
878a898d4c
fix: use VerifyCredentials to get account info
Use the clients VerifyCredentials method to get the user's account
information.
2024-08-13 23:41:12 +01:00
b77bbaa6e0
fix: updated internal/executor/executors.go 2024-08-13 17:18:55 +01:00
84091f398d
feat: add Enbas CLI schema and code generator
Summary:

- Created a custom CLI schema for Enbas which will act as the Source
  of Truth for code and document generation.
- Created a code generator which uses the schema to generate the
  executor definitions and code in the internal usage package.

Changes:

- Created the Enbas CLI schema as the Source of Truth for Enbas.
- Created the code generator that generates the executor
  definitions and code in the usage package.
- Regenerated the executor definitions using the code generator.
- Moved the custom flag value types to the new internal flag
  package.
- Created a new flag value type for the bool pointer to replace the
  flag.BoolFunc() used for the sensitive and no-color flags.
- Moved the version and build variables to the new internal version
  package to simplify the version executor.
- Created a new usage package and moved the usage functions there.
- Changed the type of the account-name flag from string to the
  internal StringSliceValue type.
2024-08-13 14:53:26 +01:00
bad22ecd70
feat: add all-images and all-videos flags
When viewing media attachments from a status, the all-images and
all-videos flags will allow users to view all images or videos,
respectively.
2024-08-01 04:24:47 +01:00
3d20adfa57
chore: REUSE.toml
- Replace .reuse/dep5 with the new REUSE.toml file.
- Add licensing information to REUSE.toml and remove the licensing
  headers from the source files.
2024-08-01 04:01:38 +01:00
60aeec06f9
feat: add all-images and all-videos flags
When viewing media attachments from a status, the all-images and
all-videos flags will allow users to view all images or videos
respectively.
2024-08-01 00:54:27 +01:00
6bc00138ab
feat: show statuses created from an account
When viewing an account's information the user can now optionally view
the statuses that the account has created.
2024-08-01 00:24:31 +01:00
2bb801b6d0
feat: add ability to reply to statuses 2024-07-09 03:13:54 +01:00
181384fea3
docs: add the user manual
The user manual: a page that users can reference when playing with
Enbas.
2024-07-06 17:36:42 +01:00
f64f8a43a6
fix: command line format for showing followers
CHANGES:

- When viewing followers and followings from an account, the from flag
  must now be set by the user.
    - enbas show --type followers --from account --my-account
    - enbas show --type following --from account --account-name john

- New error type for unsupported show operations: Return an error if
  enbas detects an unsupported show operation (e.g. showing media from a
  list).
2024-07-03 14:20:25 +01:00
a8aeec2fbf
fix: update description for the vote flag 2024-07-03 13:34:27 +01:00
5ec1cc0e18
fix: rename the choose flag.
Rename to choose flag to vote for voting in polls.
2024-07-03 13:21:32 +01:00
4d0a42ba23
fix: mute accounts indefinitely by default 2024-07-01 21:27:04 +01:00
e4cce2cae4
refactor: update structure of switch executor 2024-07-01 21:12:20 +01:00
23ec6048b5
docs: updated documentation
- Converted documentation from Asciidoc to Markdown
- Updated the installation instructions and moved to a separate
  file in the docs directory.
- Updated the login instructions and moved to the Getting Started guide
  in the docs directory.
- Updated the licensing information in the main README.
- Created a page for changelog.
- Create a page for the user manual.
2024-07-01 13:49:11 +01:00
b4cb362a7c
fix: use browser setting in config for URLs
Use the browser specified in the configuration file to open URLs. If the
browser is not specified the link will not be opened and an error is
returned to the user in most cases. This replaces the use of the BROWSER
environment variable and the xdg-open command (on linux).
2024-06-26 12:38:27 +01:00
42251f6df8
feat: add configuration support to enbas
SUMMARY

This commit adds configuration support to enbas. The configuration is
stored as a JSON file in the user specified configuration directory.

When using enbas for the first time, the user will first need to
execute the new init command in order to generate the configuration.
Once this has been generated the user can edit the settings to
personalise their experience, login to their account and use enbas as
normal.

For now the configurable settings included in the configuration
are as follows:

- The path to the credentials file (by default this is set to a file in
  the same directory as the configuration file).
- The path to the cache directory.
- The character limit used for line wrapping.
- The programs used for integrations such as paging, media viewing,
  opening URLs, etc.

CHANGES

- added the new config type.
- added the new init executor for generating a new configuration file.
- removed the following top level flags in favour of the new
  configration support.
    - cache-dir
    - pager
    - image-viewer
    - video-player
    - max-terminal-width
- added a new error type for use when an unknown media attachment ID
  is specified.
- updated the usage function for the executors to support a case
  where a flagsets has no flags.
- update .golangci.yaml to disable some linters
2024-06-25 12:39:39 +01:00
632a620180
feat: view media with external applications
This commit adds integration to external image viewers and video players
to allow users to view image and video attachments.

Enbas creates a cache directory where the media is downloaded to before
opening the external program for viewing.

Users can view one or more media attachments from a single status.
2024-06-22 01:16:24 +01:00
e8114f8d22
feat: view media attachment information
View media attachment information in the timeline and status views.
Users can also show detailed information of the attachments via the
attachment ID.
2024-06-18 19:58:59 +01:00
56445601a3
feat: add support for muting and unmuting accounts
Now that muting and unmuting accounts are now supported in GoToSocial
(as of version 0.16.0) Enbas can now allow users to do that.

Users can also see a list of accounts that they've muted.
2024-06-18 04:59:32 +01:00
ccdd8b6530
fix: add a new internal printer
Add a new internal printer package for printing resources to the screen
or pager.

With the new printer in place, most of the settings such as the pager
command, colour theme, whether or not colour output is disabled, etc
are defined in one place which saves us the trouble of passing an
increasing number of parameters to an increasing number of Display
methods throughout the code base.

The old Displayer interface and associated Display methods in the
model package are removed as this is now handled by the printer.

The format functions in the utilities package has essentially been
rewritten as methods to the Printer type.

Additional changes:

- All indentation when displaying information about resources (e.g.
  statuses, instance, accounts) are removed.
- The application's build information now has colour output.
2024-06-17 18:59:20 +01:00
f73f1f5872
fix: check following before adding to list
Check if the user is following a specified account before adding it to a
list.
2024-06-16 20:29:16 +01:00
792a93d736
feat: add support for polls
Add support for creating, viewing and voting in
polls.
2024-06-15 18:40:13 +01:00
ac2e74cac3
fix: improve version output
Use text/tabwriter to print the version information with aligned
columns.
2024-06-10 19:36:00 +01:00
c04cd7e8a5
refactor: update code for the executor package
Changes:

- moved the command names from main to the executor package.
- moved the unknownCommandError to the executor package and renamed it
  to UnknownCommandError.
- define the command summaries within the executor package.
- replace the switch statement in main.run() with a hashmap for looking
  up the corresponding executor to the given command.
- transformed BlockExecutor to BlockOrUnblockExecutor.
- transformed FollowExecutor to FollowOrUnfollowExecutor.

Additional fixes:

- fixed flag for the version executor.
2024-06-10 18:59:01 +01:00
5fb55ed2cf
feat: accept or reject follow requests
Add support to allow users to accept or reject follow requests.
2024-06-10 10:58:43 +01:00
db16e4aa16
feat: add pager support
Add support for printing the output of timelines, long statuses, etc to
an external pager of the user's choice.
2024-06-09 15:58:10 +01:00
9c8476fa97
feat: add reblogging (boosting) support
Add support for reblogging (boosting) a status by adding a boost to said
status.
2024-06-06 06:23:26 +01:00
d452122b58
feat: add support for liking and unliking statuses
Add support for liking and un-liking statuses by allowing users to add
and remove stars/likes to them.

The user can also view a list of statuses that they've liked.
2024-06-04 17:01:33 +01:00
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
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
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
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