diff --git a/lib/hunter.ex b/lib/hunter.ex index 6836189..68fb7f0 100644 --- a/lib/hunter.ex +++ b/lib/hunter.ex @@ -777,5 +777,5 @@ defmodule Hunter do Returns Hunter version """ @spec version() :: String.t() - def version(), do: @hunter_version + def version, do: @hunter_version end diff --git a/lib/hunter/account.ex b/lib/hunter/account.ex index 6528e06..09f0eab 100644 --- a/lib/hunter/account.ex +++ b/lib/hunter/account.ex @@ -11,17 +11,20 @@ defmodule Hunter.Account do * `username` - the username of the account * `acct` - equals `username` for local users, includes `@domain` for remote ones * `display_name` - the account's display name + * `locked` - boolean for when the account cannot be followed without waiting for approval first + * `created_at` - the time the account was created + * `followers_count` - the number of followers for the account + * `following_count` - the number of accounts the given account is following + * `statuses_count` - the number of statuses the account has made * `note` - biography of user * `url` - URL of the user's profile page (can be remote) * `avatar` - URL to the avatar image * `avatar_static` - URL to the avatar static image (gif) * `header` - URL to the header image * `header_static` - URL to the header static image (gif) - * `locked` - boolean for when the account cannot be followed without waiting for approval first - * `created_at` - the time the account was created - * `followers_count` - the number of followers for the account - * `following_count` - the number of accounts the given account is following - * `statuses_count` - the number of statuses the account has made + * `emojis` - list of emojis + * `moved` - moved from account + * `bot` - whether this account is a bot or not """ @hunter_api Hunter.Config.hunter_api() @@ -41,7 +44,11 @@ defmodule Hunter.Account do created_at: String.t(), followers_count: non_neg_integer, following_count: non_neg_integer, - statuses_count: non_neg_integer + statuses_count: non_neg_integer, + emojis: [Emoji.t()], + moved: Account.t(), + fields: [Hash.t()], + bot: boolean } @derive [Poison.Encoder] @@ -60,7 +67,11 @@ defmodule Hunter.Account do :created_at, :followers_count, :following_count, - :statuses_count + :statuses_count, + :emojis, + :moved, + :fields, + :bot ] @doc """ diff --git a/lib/hunter/client.ex b/lib/hunter/client.ex index 10c6657..10fc74d 100644 --- a/lib/hunter/client.ex +++ b/lib/hunter/client.ex @@ -31,7 +31,7 @@ defmodule Hunter.Client do User agent of the client """ @spec user_agent() :: String.t() - def user_agent() do + def user_agent do "Hunter.Elixir/#{Hunter.version()}" end diff --git a/lib/hunter/config.ex b/lib/hunter/config.ex index 1f42440..41096c3 100644 --- a/lib/hunter/config.ex +++ b/lib/hunter/config.ex @@ -4,15 +4,15 @@ defmodule Hunter.Config do @hunter_api Application.get_env(:hunter, :hunter_api, Hunter.Api.HTTPClient) @api_base_url "https://mastodon.social" - def hunter_api() do + def hunter_api do @hunter_api end - def api_base_url() do + def api_base_url do @api_base_url end - def home() do + def home do Path.expand(System.get_env("HUNTER_HOME") || "~/.hunter") end end diff --git a/lib/hunter/emoji.ex b/lib/hunter/emoji.ex new file mode 100644 index 0000000..1fcc0eb --- /dev/null +++ b/lib/hunter/emoji.ex @@ -0,0 +1,14 @@ +defmodule Hunter.Emoji do + @moduledoc """ + Emoji entity + """ + @type t :: %__MODULE__{ + shortcode: String.t(), + static_url: String.t(), + url: String.t(), + visible_in_picker: boolean() + } + + @derive [Poison.Encoder] + defstruct [:shortcode, :static_url, :url, :visible_in_picker] +end