mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Accept more types of ejabberdctl commands arguments as JSON-encoded
This commit is contained in:
parent
42bdb501ca
commit
536beedeb6
@ -378,7 +378,11 @@ format_arg("", string) ->
|
||||
format_arg(Arg, string) ->
|
||||
NumChars = integer_to_list(length(Arg)),
|
||||
Parse = "~" ++ NumChars ++ "c",
|
||||
format_arg2(Arg, Parse).
|
||||
format_arg2(Arg, Parse);
|
||||
format_arg(Arg, Format) ->
|
||||
S = unicode:characters_to_binary(Arg, utf8),
|
||||
JSON = jiffy:decode(S),
|
||||
mod_http_api:format_arg(JSON, Format).
|
||||
|
||||
format_arg2(Arg, Parse)->
|
||||
{ok, [Arg2], _RemainingArguments} = io_lib:fread(Parse, Arg),
|
||||
|
@ -30,6 +30,7 @@
|
||||
-behaviour(gen_mod).
|
||||
|
||||
-export([start/2, stop/1, reload/3, process/2, depends/2,
|
||||
format_arg/2,
|
||||
mod_options/1, mod_doc/0]).
|
||||
|
||||
-include_lib("xmpp/include/xmpp.hrl").
|
||||
|
Loading…
Reference in New Issue
Block a user