Allow for a 'none' amount to prompt users for an amount.
This commit is contained in:
parent
88c6f6dcc7
commit
f5e955b583
@ -88,7 +88,7 @@ url(Instruction, Recipient, Amount) ->
|
||||
Node :: {inet:ip_address() | inet:hostname(), inet:port_number()}
|
||||
| uri_string:uri_string(), % "http://..." | "https://..."
|
||||
Recipient :: string(),
|
||||
Amount :: non_neg_integer(),
|
||||
Amount :: non_neg_integer() | none,
|
||||
Payload :: binary(),
|
||||
GRIDS :: uri_string:uri_string().
|
||||
%% @doc
|
||||
@ -113,8 +113,12 @@ h_to_s(Host) when is_binary(Host) -> Host;
|
||||
h_to_s(Host) when is_tuple(Host) -> inet:ntoa(Host);
|
||||
h_to_s(Host) when is_atom(Host) -> atom_to_list(Host).
|
||||
|
||||
qwargs(none, "") ->
|
||||
[];
|
||||
qwargs(Amount, "") ->
|
||||
["?a=", integer_to_list(Amount)];
|
||||
qwargs(none, Payload) ->
|
||||
[$? | uri_string:compose_query([{"p", Payload}])];
|
||||
qwargs(Amount, Payload) ->
|
||||
[$? | uri_string:compose_query([{"a", integer_to_list(Amount)}, {"p", Payload}])].
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user