Fix code readability issues
This commit is contained in:
committed by
Thomas Citharel
parent
20dfce5c83
commit
aed824f1aa
@@ -5,28 +5,19 @@
|
||||
|
||||
defmodule Mobilizon.Service.ActivityPub do
|
||||
@moduledoc """
|
||||
# ActivityPub
|
||||
|
||||
Every ActivityPub method
|
||||
# ActivityPub context.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Config
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Events.{Event, Comment, Participant}
|
||||
alias Mobilizon.Service.ActivityPub.Transmogrifier
|
||||
alias Mobilizon.Service.WebFinger
|
||||
import Mobilizon.Service.ActivityPub.{Utils, Visibility}
|
||||
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.{Actors, Config, Events}
|
||||
alias Mobilizon.Actors.{Actor, Follower}
|
||||
|
||||
alias Mobilizon.Service.Federator
|
||||
alias Mobilizon.Events.{Comment, Event, Participant}
|
||||
alias Mobilizon.Service.ActivityPub.{Activity, Convertible, Transmogrifier}
|
||||
alias Mobilizon.Service.{Federator, WebFinger}
|
||||
alias Mobilizon.Service.HTTPSignatures.Signature
|
||||
|
||||
alias Mobilizon.Service.ActivityPub.{Activity, Convertible}
|
||||
|
||||
require Logger
|
||||
import Mobilizon.Service.ActivityPub.Utils
|
||||
import Mobilizon.Service.ActivityPub.Visibility
|
||||
|
||||
@doc """
|
||||
Get recipients for an activity or object
|
||||
@@ -452,7 +443,8 @@ defmodule Mobilizon.Service.ActivityPub do
|
||||
|
||||
def leave(object, actor, local \\ true)
|
||||
|
||||
# TODO: If we want to use this for exclusion we need to have an extra field for the actor that excluded the participant
|
||||
# TODO: If we want to use this for exclusion we need to have an extra field
|
||||
# for the actor that excluded the participant
|
||||
def leave(
|
||||
%Event{id: event_id, url: event_url} = event,
|
||||
%Actor{id: actor_id, url: actor_url} = _actor,
|
||||
|
||||
@@ -2,8 +2,10 @@ defmodule Mobilizon.Service.ActivityPub.Converters.Actor do
|
||||
@moduledoc """
|
||||
Actor converter
|
||||
|
||||
This module allows to convert events from ActivityStream format to our own internal one, and back
|
||||
This module allows to convert events from ActivityStream format to our own
|
||||
internal one, and back.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Actors.Actor, as: ActorModel
|
||||
alias Mobilizon.Service.ActivityPub.Converter
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
defmodule Mobilizon.Service.ActivityPub.Converters.Address do
|
||||
@moduledoc """
|
||||
Flag converter
|
||||
Address converter.
|
||||
|
||||
This module allows to convert reports from ActivityStream format to our own internal one, and back.
|
||||
This module allows to convert reports from ActivityStream format to our own
|
||||
internal one, and back.
|
||||
|
||||
Note: Reports are named Flag in AS.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Addresses.Address, as: AddressModel
|
||||
alias Mobilizon.Service.ActivityPub.Converter
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
defmodule Mobilizon.Service.ActivityPub.Converters.Comment do
|
||||
@moduledoc """
|
||||
Comment converter
|
||||
Comment converter.
|
||||
|
||||
This module allows to convert events from ActivityStream format to our own internal one, and back
|
||||
This module allows to convert events from ActivityStream format to our own
|
||||
internal one, and back.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events.Comment, as: CommentModel
|
||||
alias Mobilizon.Events.Event
|
||||
alias Mobilizon.Service.ActivityPub.Converter
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
alias Mobilizon.Service.ActivityPub.Converter
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Converter
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
defmodule Mobilizon.Service.ActivityPub.Converters.Event do
|
||||
@moduledoc """
|
||||
Event converter
|
||||
Event converter.
|
||||
|
||||
This module allows to convert events from ActivityStream format to our own internal one, and back
|
||||
This module allows to convert events from ActivityStream format to our own
|
||||
internal one, and back.
|
||||
"""
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Media
|
||||
alias Mobilizon.Media.Picture
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events.Event, as: EventModel
|
||||
alias Mobilizon.Service.ActivityPub.Converter
|
||||
alias Mobilizon.Service.ActivityPub.Converters.Address, as: AddressConverter
|
||||
alias Mobilizon.Service.ActivityPub.Utils
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Events.Tag
|
||||
alias Mobilizon.Addresses
|
||||
alias Mobilizon.Addresses.Address
|
||||
|
||||
@behaviour Converter
|
||||
alias Mobilizon.{Actors, Addresses, Events, Media}
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Events.Event, as: EventModel
|
||||
alias Mobilizon.Events.Tag
|
||||
alias Mobilizon.Media.Picture
|
||||
alias Mobilizon.Service.ActivityPub.{Converter, Utils}
|
||||
alias Mobilizon.Service.ActivityPub.Converters.Address, as: AddressConverter
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Converter
|
||||
|
||||
@doc """
|
||||
Converts an AP object data to our internal data structure
|
||||
"""
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
defmodule Mobilizon.Service.ActivityPub.Converters.Flag do
|
||||
@moduledoc """
|
||||
Flag converter
|
||||
Flag converter.
|
||||
|
||||
This module allows to convert reports from ActivityStream format to our own internal one, and back.
|
||||
This module allows to convert reports from ActivityStream format to our own
|
||||
internal one, and back.
|
||||
|
||||
Note: Reports are named Flag in AS.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
defmodule Mobilizon.Service.ActivityPub.Converters.Participant do
|
||||
@moduledoc """
|
||||
Flag converter
|
||||
Participant converter.
|
||||
|
||||
This module allows to convert reports from ActivityStream format to our own internal one, and back.
|
||||
This module allows to convert reports from ActivityStream format to our own
|
||||
internal one, and back.
|
||||
|
||||
Note: Reports are named Flag in AS.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Events.Participant, as: ParticipantModel
|
||||
|
||||
@doc """
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
defmodule Mobilizon.Service.ActivityPub.Relay do
|
||||
@moduledoc """
|
||||
Handles following and unfollowing relays and instances
|
||||
Handles following and unfollowing relays and instances.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Service.ActivityPub.Activity
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
alias Mobilizon.Service.ActivityPub.Activity
|
||||
|
||||
alias MobilizonWeb.API.Follows
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@ defmodule Mobilizon.Service.ActivityPub.Transmogrifier do
|
||||
@moduledoc """
|
||||
A module to handle coding from internal to wire ActivityPub and back.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.{Actor, Follower}
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Events.{Event, Comment, Participant}
|
||||
alias Mobilizon.Events.{Comment, Event, Participant}
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
alias Mobilizon.Service.ActivityPub.{Visibility, Utils}
|
||||
alias Mobilizon.Service.ActivityPub.{Utils, Visibility}
|
||||
|
||||
require Logger
|
||||
|
||||
|
||||
@@ -5,25 +5,19 @@
|
||||
|
||||
defmodule Mobilizon.Service.ActivityPub.Utils do
|
||||
@moduledoc """
|
||||
# Utils
|
||||
|
||||
Various utils
|
||||
# Various ActivityPub related utils.
|
||||
"""
|
||||
|
||||
alias Ecto.Changeset
|
||||
|
||||
alias Mobilizon.Addresses
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.{Actors, Addresses, Events, Reports, Users}
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Events.{Comment, Event}
|
||||
alias Mobilizon.Media.Picture
|
||||
alias Mobilizon.Reports
|
||||
alias Mobilizon.Reports.Report
|
||||
alias Mobilizon.Service.ActivityPub.{Activity, Converters}
|
||||
alias Mobilizon.Storage.Repo
|
||||
alias Mobilizon.Users
|
||||
|
||||
alias MobilizonWeb.{Email, Endpoint}
|
||||
alias MobilizonWeb.Router.Helpers, as: Routes
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
defmodule Mobilizon.Service.Admin.ActionLogService do
|
||||
@moduledoc """
|
||||
Module to handle action log creations
|
||||
Module to handle action log creations.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Users
|
||||
alias Mobilizon.Users.User
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Admin
|
||||
alias Mobilizon.Admin.ActionLog
|
||||
alias Mobilizon.Users
|
||||
alias Mobilizon.Users.User
|
||||
|
||||
@doc """
|
||||
Log an admin action
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
defmodule Mobilizon.Service.EmailChecker do
|
||||
@moduledoc """
|
||||
Provides a function to test emails against a "not so bad" regex
|
||||
Provides a function to test emails against a "not so bad" regex.
|
||||
"""
|
||||
|
||||
# TODO: simplify me!
|
||||
@email_regex ~r/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||
|
||||
@doc """
|
||||
Returns whether the email is valid
|
||||
Returns whether the email is valid.
|
||||
"""
|
||||
@spec valid?(String.t()) :: boolean()
|
||||
def valid?(email) do
|
||||
email =~ @email_regex
|
||||
end
|
||||
@spec valid?(String.t()) :: boolean
|
||||
def valid?(email), do: email =~ @email_regex
|
||||
end
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
defmodule Mobilizon.Service.Export.Feed do
|
||||
@moduledoc """
|
||||
Serve Atom Syndication Feeds
|
||||
Serve Atom Syndication Feeds.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Users.User
|
||||
alias Mobilizon.Users
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.Events.{Event, FeedToken}
|
||||
alias Atomex.{Feed, Entry}
|
||||
import MobilizonWeb.Gettext
|
||||
|
||||
alias Atomex.{Entry, Feed}
|
||||
|
||||
alias Mobilizon.{Actors, Events, Users}
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Events.{Event, FeedToken}
|
||||
alias Mobilizon.Users.User
|
||||
|
||||
alias MobilizonWeb.{Endpoint, MediaProxy}
|
||||
alias MobilizonWeb.Router.Helpers, as: Routes
|
||||
alias MobilizonWeb.Endpoint
|
||||
alias MobilizonWeb.MediaProxy
|
||||
|
||||
require Logger
|
||||
|
||||
@version Mix.Project.config()[:version]
|
||||
def version(), do: @version
|
||||
def version, do: @version
|
||||
|
||||
@spec create_cache(String.t()) :: {:commit, String.t()} | {:ignore, any()}
|
||||
def create_cache("actor_" <> name) do
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
defmodule Mobilizon.Service.Export.ICalendar do
|
||||
@moduledoc """
|
||||
Export an event to iCalendar format
|
||||
Export an event to iCalendar format.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Events.{Event, FeedToken}
|
||||
alias Mobilizon.Events
|
||||
alias Mobilizon.{Actors, Events, Users}
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Events.{Event, FeedToken}
|
||||
alias Mobilizon.Users.User
|
||||
alias Mobilizon.Users
|
||||
|
||||
@doc """
|
||||
Export a public event to iCalendar format.
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
|
||||
defmodule Mobilizon.Service.Formatter do
|
||||
@moduledoc """
|
||||
Formats input text to structured data, extracts mentions and hashtags
|
||||
Formats input text to structured data, extracts mentions and hashtags.
|
||||
"""
|
||||
alias Mobilizon.Actors.Actor
|
||||
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Service.HTML
|
||||
|
||||
@link_regex ~r"((?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~%:/?#[\]@!\$&'\(\)\*\+,;=.]+)|[0-9a-z+\-\.]+:[0-9a-z$-_.+!*'(),]+"ui
|
||||
|
||||
@@ -2,9 +2,11 @@ defmodule Mobilizon.Service.Geospatial.Addok do
|
||||
@moduledoc """
|
||||
[Addok](https://github.com/addok/addok) backend.
|
||||
"""
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
require Logger
|
||||
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
defmodule Mobilizon.Service.Geospatial do
|
||||
@moduledoc """
|
||||
Module to load the service adapter defined inside the configuration
|
||||
Module to load the service adapter defined inside the configuration.
|
||||
|
||||
See `Mobilizon.Service.Geospatial.Provider`
|
||||
See `Mobilizon.Service.Geospatial.Provider`.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Returns the appropriate service adapter
|
||||
Returns the appropriate service adapter.
|
||||
|
||||
According to the config behind `config :mobilizon, Mobilizon.Service.Geospatial, service: Mobilizon.Service.Geospatial.Module`
|
||||
According to the config behind
|
||||
`config :mobilizon, Mobilizon.Service.Geospatial,
|
||||
service: Mobilizon.Service.Geospatial.Module`
|
||||
"""
|
||||
@spec service() :: module()
|
||||
def service(), do: Application.get_env(:mobilizon, __MODULE__) |> get_in([:service])
|
||||
@spec service :: module
|
||||
def service, do: get_in(Application.get_env(:mobilizon, __MODULE__), [:service])
|
||||
end
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
defmodule Mobilizon.Service.Geospatial.GoogleMaps do
|
||||
@moduledoc """
|
||||
Google Maps [Geocoding service](https://developers.google.com/maps/documentation/geocoding/intro)
|
||||
Google Maps [Geocoding service](https://developers.google.com/maps/documentation/geocoding/intro).
|
||||
|
||||
Note: Endpoint is hardcoded to Google Maps API
|
||||
Note: Endpoint is hardcoded to Google Maps API.
|
||||
"""
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
@@ -8,8 +8,10 @@ defmodule Mobilizon.Service.Geospatial.MapQuest do
|
||||
* `:open_data` Whether to use [Open Data or Licenced Data](https://developer.mapquest.com/documentation/open/).
|
||||
Defaults to `true`
|
||||
"""
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
@@ -2,8 +2,10 @@ defmodule Mobilizon.Service.Geospatial.Nominatim do
|
||||
@moduledoc """
|
||||
[Nominatim](https://wiki.openstreetmap.org/wiki/Nominatim) backend.
|
||||
"""
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Provider
|
||||
@@ -66,23 +68,22 @@ defmodule Mobilizon.Service.Geospatial.Nominatim do
|
||||
|
||||
@spec process_data(map()) :: Address.t()
|
||||
defp process_data(%{"address" => address} = body) do
|
||||
try do
|
||||
%Address{
|
||||
country: Map.get(address, "country"),
|
||||
locality: Map.get(address, "city"),
|
||||
region: Map.get(address, "state"),
|
||||
description: description(body),
|
||||
floor: Map.get(address, "floor"),
|
||||
geom: [Map.get(body, "lon"), Map.get(body, "lat")] |> Provider.coordinates(),
|
||||
postal_code: Map.get(address, "postcode"),
|
||||
street: street_address(address),
|
||||
origin_id: "osm:" <> to_string(Map.get(body, "osm_id"))
|
||||
}
|
||||
rescue
|
||||
e in ArgumentError ->
|
||||
Logger.warn(inspect(e))
|
||||
nil
|
||||
end
|
||||
%Address{
|
||||
country: Map.get(address, "country"),
|
||||
locality: Map.get(address, "city"),
|
||||
region: Map.get(address, "state"),
|
||||
description: description(body),
|
||||
floor: Map.get(address, "floor"),
|
||||
geom: [Map.get(body, "lon"), Map.get(body, "lat")] |> Provider.coordinates(),
|
||||
postal_code: Map.get(address, "postcode"),
|
||||
street: street_address(address),
|
||||
origin_id: "osm:" <> to_string(Map.get(body, "osm_id"))
|
||||
}
|
||||
rescue
|
||||
error in ArgumentError ->
|
||||
Logger.warn(inspect(error))
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
@spec street_address(map()) :: String.t()
|
||||
|
||||
@@ -2,9 +2,11 @@ defmodule Mobilizon.Service.Geospatial.Photon do
|
||||
@moduledoc """
|
||||
[Photon](https://photon.komoot.de) backend.
|
||||
"""
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
require Logger
|
||||
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Service.Geospatial.Provider
|
||||
|
||||
require Logger
|
||||
|
||||
@behaviour Provider
|
||||
|
||||
|
||||
@@ -14,11 +14,13 @@ defmodule Mobilizon.Service.Geospatial.Provider do
|
||||
## Shared options
|
||||
|
||||
* `:user_agent` User-Agent string to send to the backend. Defaults to `"Mobilizon"`
|
||||
* `:lang` Lang in which to prefer results. Used as a request parameter or through an `Accept-Language` HTTP header.
|
||||
Defaults to `"en"`.
|
||||
* `:limit` Maximum limit for the number of results returned by the backend. Defaults to `10`
|
||||
* `:api_key` Allows to override the API key (if the backend requires one) set inside the configuration.
|
||||
* `:endpoint` Allows to override the endpoint set inside the configuration
|
||||
* `:lang` Lang in which to prefer results. Used as a request parameter or
|
||||
through an `Accept-Language` HTTP header. Defaults to `"en"`.
|
||||
* `:limit` Maximum limit for the number of results returned by the backend.
|
||||
Defaults to `10`
|
||||
* `:api_key` Allows to override the API key (if the backend requires one) set
|
||||
inside the configuration.
|
||||
* `:endpoint` Allows to override the endpoint set inside the configuration.
|
||||
"""
|
||||
|
||||
alias Mobilizon.Addresses.Address
|
||||
@@ -35,38 +37,40 @@ defmodule Mobilizon.Service.Geospatial.Provider do
|
||||
iex> geocode(48.11, -1.77)
|
||||
%Address{}
|
||||
"""
|
||||
@callback geocode(longitude :: number(), latitude :: number(), options :: keyword()) ::
|
||||
list(Address.t())
|
||||
@callback geocode(longitude :: number, latitude :: number, options :: keyword) :: [Address.t()]
|
||||
|
||||
@doc """
|
||||
Search for an address
|
||||
|
||||
## Options
|
||||
|
||||
In addition to [the shared options](#module-shared-options), `c:search/2` also accepts the following options:
|
||||
In addition to [the shared options](#module-shared-options), `c:search/2` also
|
||||
accepts the following options:
|
||||
|
||||
* `coords` Map of coordinates (ex: `%{lon: 48.11, lat: -1.77}`) allowing to give a geographic priority to the search.
|
||||
Defaults to `nil`
|
||||
* `coords` Map of coordinates (ex: `%{lon: 48.11, lat: -1.77}`) allowing to
|
||||
give a geographic priority to the search. Defaults to `nil`.
|
||||
|
||||
## Examples
|
||||
|
||||
iex> search("10 rue Jangot")
|
||||
%Address{}
|
||||
"""
|
||||
@callback search(address :: String.t(), options :: keyword()) :: list(Address.t())
|
||||
@callback search(address :: String.t(), options :: keyword) :: [Address.t()]
|
||||
|
||||
@doc """
|
||||
Returns a `Geo.Point` for given coordinates
|
||||
"""
|
||||
@spec coordinates(list(number()), number()) :: Geo.Point.t()
|
||||
@spec coordinates([number], number) :: Geo.Point.t()
|
||||
def coordinates(coords, srid \\ 4326)
|
||||
|
||||
def coordinates([x, y], srid) when is_number(x) and is_number(y),
|
||||
do: %Geo.Point{coordinates: {x, y}, srid: srid}
|
||||
def coordinates([x, y], srid) when is_number(x) and is_number(y) do
|
||||
%Geo.Point{coordinates: {x, y}, srid: srid}
|
||||
end
|
||||
|
||||
def coordinates([x, y], srid) when is_bitstring(x) and is_bitstring(y),
|
||||
do: %Geo.Point{coordinates: {String.to_float(x), String.to_float(y)}, srid: srid}
|
||||
def coordinates([x, y], srid) when is_bitstring(x) and is_bitstring(y) do
|
||||
%Geo.Point{coordinates: {String.to_float(x), String.to_float(y)}, srid: srid}
|
||||
end
|
||||
|
||||
@spec coordinates(any()) :: nil
|
||||
@spec coordinates(any) :: nil
|
||||
def coordinates(_, _), do: nil
|
||||
end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
defmodule Mobilizon.Service.Users.Activation do
|
||||
@moduledoc false
|
||||
|
||||
alias Mobilizon.Service.Users.Tools
|
||||
alias Mobilizon.Users
|
||||
alias Mobilizon.Users.User
|
||||
alias Mobilizon.Service.Users.Tools
|
||||
|
||||
alias MobilizonWeb.Email
|
||||
|
||||
|
||||
Reference in New Issue
Block a user