mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 01:39:35 +02:00
Indent instead of format some pieces of code that include pretty print
This commit is contained in:
parent
378bf64fd5
commit
2ec8fe2bc3
29 changed files with 143 additions and 1 deletions
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-type aterm() :: {atom(), atype()}.
|
||||
-type atype() :: integer | string | binary | any | atom |
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(request,
|
||||
{method :: method(),
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(oauth_token, {
|
||||
token = <<"">> :: binary() | '_',
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-define(ROUTES_CACHE, routes_cache).
|
||||
|
||||
-type local_hint() :: integer() | {apply, atom(), atom()}.
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-define(LDAP_PORT, 389).
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-define(MODULE_ANTISPAM, mod_antispam).
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(caps_features,
|
||||
{node_pair = {<<"">>, <<"">>} :: {binary(), binary()},
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(archive_msg,
|
||||
{us = {<<"">>, <<"">>} :: {binary(), binary()},
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-define(MAX_USERS_DEFAULT, 200).
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(offline_msg,
|
||||
{us = {<<"">>, <<"">>} :: {binary(), binary()},
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(privacy, {us = {<<"">>, <<"">>} :: {binary(), binary()},
|
||||
default = none :: none | binary(),
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(push_session,
|
||||
{us = {<<"">>, <<"">>} :: {binary(), binary()},
|
||||
timestamp = erlang:timestamp() :: erlang:timestamp(),
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(roster,
|
||||
{
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
%%% limitations under the License.
|
||||
%%%
|
||||
%%%-------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-define(MQTT_VERSION_4, 4).
|
||||
-define(MQTT_VERSION_5, 5).
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
%%%
|
||||
%%%----------------------------------------------------------------------
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
%% -------------------------------
|
||||
%% Pubsub constants
|
||||
|
|
|
@ -44,6 +44,9 @@
|
|||
|
||||
-include("eldap.hrl").
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
-record(state,
|
||||
{host = <<"">> :: binary(),
|
||||
eldap_id = <<"">> :: binary(),
|
||||
|
@ -61,6 +64,10 @@
|
|||
deref_aliases = never :: never | searching | finding | always,
|
||||
dn_filter :: binary() | undefined,
|
||||
dn_filter_attrs = [] :: [binary()]}).
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
|
||||
handle_cast(Msg, State) ->
|
||||
?WARNING_MSG("Unexpected cast: ~p", [Msg]),
|
||||
|
|
|
@ -81,6 +81,10 @@
|
|||
|
||||
-export_type([bosh_socket/0]).
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state,
|
||||
{host = <<"">> :: binary(),
|
||||
sid = <<"">> :: binary(),
|
||||
|
@ -109,6 +113,10 @@
|
|||
els = [] :: [fxml_stream:xml_stream_el()],
|
||||
size = 0 :: non_neg_integer()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
start(#body{attrs = Attrs} = Body, IP, SID) ->
|
||||
XMPPDomain = get_attr(to, Attrs),
|
||||
SupervisorProc = gen_mod:get_module_proc(XMPPDomain, mod_bosh),
|
||||
|
|
|
@ -774,6 +774,10 @@ print_usage_tags(Tag, MaxC, ShCode, Version) ->
|
|||
%% Print usage of 'help' command
|
||||
%%-----------------------------
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
print_usage_help(MaxC, ShCode) ->
|
||||
LongDesc =
|
||||
["This special ", ?C("help"), " command provides help of ejabberd commands.\n\n"
|
||||
|
@ -812,6 +816,9 @@ print_usage_help(MaxC, ShCode) ->
|
|||
result = {help, string}},
|
||||
print(get_usage_command2("help", C, MaxC, ShCode), []).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
%%-----------------------------
|
||||
%% Print usage command
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
|
||||
-include("ejabberd_http.hrl").
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state,
|
||||
{socket :: ws_socket(),
|
||||
ping_interval :: non_neg_integer(),
|
||||
|
@ -52,7 +56,11 @@
|
|||
c2s_pid :: pid(),
|
||||
ws :: {#ws{}, pid()}}).
|
||||
|
||||
%-define(DBGFSM, true).
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
%%%-define(DBGFSM, true).
|
||||
|
||||
-ifdef(DBGFSM).
|
||||
|
||||
|
|
|
@ -56,12 +56,20 @@
|
|||
-define(NS_PIEFXIS, <<"http://www.xmpp.org/extensions/xep-0227.html#ns">>).
|
||||
-define(NS_XI, <<"http://www.w3.org/2001/XInclude">>).
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state, {xml_stream_state :: fxml_stream:xml_stream_state() | undefined,
|
||||
user = <<"">> :: binary(),
|
||||
server = <<"">> :: binary(),
|
||||
fd = self() :: file:io_device(),
|
||||
dir = <<"">> :: binary()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
-type state() :: #state{}.
|
||||
|
||||
%%File could be large.. we read it in chunks
|
||||
|
|
|
@ -91,6 +91,10 @@
|
|||
-include("ejabberd_sql_pt.hrl").
|
||||
-include("ejabberd_stacktrace.hrl").
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state,
|
||||
{db_ref :: undefined | db_ref_pid() | odbc_connection_reference(),
|
||||
db_type = odbc :: pgsql | mysql | sqlite | odbc | mssql,
|
||||
|
@ -101,6 +105,10 @@
|
|||
overload_reported :: undefined | integer(),
|
||||
timeout :: pos_integer()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
-define(STATE_KEY, ejabberd_sql_state).
|
||||
-define(NESTING_KEY, ejabberd_sql_nesting_level).
|
||||
-define(TOP_LEVEL_TXN, 0).
|
||||
|
|
|
@ -155,6 +155,10 @@ build_script(Dir, UpdatedBeams) ->
|
|||
end,
|
||||
{Script, LowLevelScript, Check1}.
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
%% Copied from Erlang/OTP file: lib/sasl/src/systools.hrl
|
||||
-ifdef(SYSTOOLS_APP_DEF_WITHOUT_OPTIONAL).
|
||||
-record(application,
|
||||
|
@ -222,6 +226,9 @@ build_script(Dir, UpdatedBeams) ->
|
|||
}).
|
||||
-endif.
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
make_script(UpdatedBeams) ->
|
||||
lists:map(
|
||||
|
|
|
@ -122,6 +122,10 @@
|
|||
|
||||
-type handle() :: pid() | atom() | binary().
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(eldap,
|
||||
{version = ?LDAP_VERSION :: non_neg_integer(),
|
||||
hosts = [] :: [binary()],
|
||||
|
@ -142,6 +146,10 @@
|
|||
dict = dict:new() :: dict:dict(),
|
||||
req_q = queue:new() :: queue:queue()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% API
|
||||
%%%----------------------------------------------------------------------
|
||||
|
|
|
@ -71,6 +71,10 @@
|
|||
|
||||
-include_lib("xmpp/include/xmpp.hrl").
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state,
|
||||
{host = <<>> :: binary(),
|
||||
dump_fd = undefined :: file:io_device() | undefined,
|
||||
|
@ -86,6 +90,10 @@
|
|||
whitelist_domains = #{} :: #{binary() => false}
|
||||
}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
-type state() :: #state{}.
|
||||
|
||||
-define(COMMAND_TIMEOUT, timer:seconds(30)).
|
||||
|
|
|
@ -91,6 +91,10 @@
|
|||
-include("logger.hrl").
|
||||
-include("translate.hrl").
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state,
|
||||
{server_host = <<>> :: binary(),
|
||||
hosts = [] :: [binary()],
|
||||
|
@ -116,6 +120,10 @@
|
|||
height :: integer(),
|
||||
width :: integer()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
-type state() :: #state{}.
|
||||
-type slot() :: [binary(), ...].
|
||||
-type slots() :: #{slot() => {pos_integer(), reference()}}.
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
-include("logger.hrl").
|
||||
-include("mqtt.hrl").
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(mqtt_pub, {topic_server :: {binary(), binary()},
|
||||
user :: binary(),
|
||||
resource :: binary(),
|
||||
|
@ -50,6 +54,10 @@
|
|||
pid :: pid() | '_',
|
||||
timestamp :: erlang:timestamp() | '_'}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
%%%===================================================================
|
||||
%%% API
|
||||
%%%===================================================================
|
||||
|
|
|
@ -62,6 +62,10 @@
|
|||
-type host_or_hash() :: binary() | {hash, binary()}.
|
||||
-type service_type() :: stun | stuns | turn | turns | undefined.
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(request,
|
||||
{host :: binary() | inet:ip_address() | undefined,
|
||||
port :: 0..65535 | undefined,
|
||||
|
@ -75,6 +79,10 @@
|
|||
secret :: binary(),
|
||||
ttl :: non_neg_integer()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
-type request() :: #request{}.
|
||||
-type state() :: #state{}.
|
||||
|
||||
|
|
|
@ -45,6 +45,10 @@
|
|||
|
||||
-define(PROCNAME, ejabberd_mod_vcard_ldap).
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(state,
|
||||
{serverhost = <<"">> :: binary(),
|
||||
myhosts = [] :: [binary()],
|
||||
|
@ -68,6 +72,10 @@
|
|||
deref_aliases = never :: never | searching | finding | always,
|
||||
matches = 0 :: non_neg_integer()}).
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
%%%===================================================================
|
||||
%%% API
|
||||
%%%===================================================================
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
-define(MAX_UINT32, 4294967295).
|
||||
-define(MAX_VARINT, 268435456).
|
||||
|
||||
%%
|
||||
%% @efmt:off
|
||||
%% @indent-begin
|
||||
|
||||
-record(codec_state, {version :: undefined | mqtt_version(),
|
||||
type :: undefined | non_neg_integer(),
|
||||
flags :: undefined | non_neg_integer(),
|
||||
|
@ -58,6 +62,10 @@
|
|||
{{bad_flag, atom()}, char(), term()} |
|
||||
{{bad_flags, atom()}, char(), char()}.
|
||||
|
||||
%% @indent-end
|
||||
%% @efmt:on
|
||||
%%
|
||||
|
||||
-opaque state() :: #codec_state{}.
|
||||
-export_type([state/0, error_reason/0]).
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue