Commit graph

39 commits

Author SHA1 Message Date
eb016b96e9
fix(BREAKING): update poll interaction
Summary:

This commit updates and enhances poll interaction. From now on users
will interact with a poll via the status that contains it. Direct
interaction with the poll (via the poll's ID) is no longer supported.
This helps resolve an issue where it wasn't possible to find the owner
of the poll when interacting with it directly.

Changes:

- Users can no longer view a poll directly using the Poll ID.
  Instead polls can be viewed when viewing statuses or timelines.
- More details about a poll is shown in statuses and timelines.
- Votes are now added to polls via statuses.
- Poll results are hidden unless the following conditions are met.
    - The user is the owner of the poll.
    - The poll has expired.
    - The user has already voted in the poll.
- Enbas can now detect and stop a poll owner from voting in their own
  poll.
- When a status is created Enbas will now only print the ID of the
  created status instead of the whole thing.

PR: apollo/enbas#43

Resolves apollo/enbas#39
2024-08-14 11:29:30 +01:00
cb7ac4175d
style: ran gofmt 2024-08-02 13:04:40 +01:00
2ccfdc4336
refactor: update client package
- add a type for the parameters of the sendRequest method
- contentType is now a parameter for the sendRequest method.
2024-08-02 08:15:15 +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
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
c468d1fb62
refactor: create constant values for base paths
Created constant values for the Accounts and Follow Requests base API
paths.
2024-07-10 12:06:36 +01:00
2bb801b6d0
feat: add ability to reply to statuses 2024-07-09 03:13:54 +01:00
ec282e207f
refactor: use baseListPath where necessary
Replace the static string of the base list API path with the
baseListPath constant.
2024-07-09 00:25:43 +01:00
d52bb3fdf4
fix: print error messages from instance
If an error occurs when sending a request to an instance, try and decode
and print the error message back to the user.
2024-07-04 11:27:00 +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
792a93d736
feat: add support for polls
Add support for creating, viewing and voting in
polls.
2024-06-15 18:40:13 +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
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
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
b6b6f75715
refactor: add more form types for the client 2024-05-30 20:04:55 +01:00
ea05294cb5
feat: add support for posting statuses
Users can now post one line statuses.
2024-05-30 18:46:33 +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
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
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
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
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
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
a83aaa17f6
feat: add timeline support
Add support for viewing all timeline types (home, public, lists and
tags).
2024-02-24 15:53:29 +00:00
4f561f9305
feat: add ability to show a status 2024-02-23 13:14:50 +00:00
2c5123253a
feat: add Enbas
Add Enbas code. So far Enbas can:

- Allow the user to register the application and log into GTS on their
  behalf. The scope is limited to read for now.
- Show instance details.
- Show local and remote accounts.
2024-02-23 09:44:57 +00:00