Fix usage of is_bitstring instead of is_binary
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -155,7 +155,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
|
||||
end
|
||||
|
||||
@spec get_address(map | binary | nil) :: integer | nil
|
||||
defp get_address(address_url) when is_bitstring(address_url) do
|
||||
defp get_address(address_url) when is_binary(address_url) do
|
||||
get_address(%{"id" => address_url})
|
||||
end
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Media do
|
||||
%{"type" => "Document", "url" => media_url, "name" => name},
|
||||
actor_id
|
||||
)
|
||||
when is_bitstring(media_url) do
|
||||
when is_binary(media_url) do
|
||||
with {:ok, %{body: body}} <- Tesla.get(media_url, opts: @http_options),
|
||||
{:ok, %{name: name, url: url, content_type: content_type, size: size}} <-
|
||||
Upload.store(%{body: body, name: name}),
|
||||
|
||||
@@ -94,7 +94,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Utils do
|
||||
end
|
||||
end
|
||||
|
||||
defp fetch_tag(tag) when is_bitstring(tag), do: [tag_without_hash(tag)]
|
||||
defp fetch_tag(tag) when is_binary(tag), do: [tag_without_hash(tag)]
|
||||
|
||||
defp tag_without_hash("#" <> tag_title), do: tag_title
|
||||
defp tag_without_hash(tag_title), do: tag_title
|
||||
|
||||
Reference in New Issue
Block a user