Commit graph

76 commits

Author SHA1 Message Date
2a386fcda5
fix: parse HTML text for account metadata 2024-06-18 15:54:08 +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
48666645c7
fix: added missing line breaks in timeline view
Added missing line breaks between the status author and the status
content in the timeline view.
2024-06-17 21:59:34 +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
eb2d9f44f6
chore: add copyright header 2024-06-16 14:15:58 +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
ec706b43e9
fix: updated headers for account lists 2024-06-10 11:17:07 +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
d21f1fbf6a
chore: bump golang.org/x/net from 0.21.0 to 0.26.0 2024-06-10 10:17:02 +01:00
b48fac3341
fix: filter out emojis with underscores
When displaying the username also filter out the emojis with
underscores.
2024-06-09 17:24:07 +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
c8187587a8
fix: print commands in aligned columns
Use the text/tabwriter to write the commands and their summaries in
aligned columns when printing the help text.
2024-06-06 06:21:16 +01:00
64ecc90499
refactor: add FullDisplayNameFormat
Add the FullDisplayNameFormat as a replacement for DisplayNameFormat for
displaying the full display name. It uses the builder from the strings
package to reduce the use of fmt.Sprintf.
2024-06-04 20:29:19 +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
66c530d524
fix: fix type of PollOption.VotesCount 2024-06-04 09:54:40 +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
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