From 82a8dc7b3ab20aafcfe5e94a219f05af4921b6c2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 7 Oct 2010 17:38:18 +0200 Subject: [PATCH] Cosmetic code changes to support emacs indentation --- src/cache_tab.erl | 4 +- src/ejabberd_admin.erl | 3 +- src/ejabberd_auth_anonymous.erl | 4 +- src/ejabberd_auth_ldap.erl | 8 +- src/ejabberd_c2s.erl | 8 +- src/ejabberd_captcha.erl | 132 +++++++++----------------- src/ejabberd_check.erl | 4 +- src/ejabberd_ctl.erl | 3 +- src/ejabberd_local.erl | 5 +- src/ejabberd_receiver.erl | 20 ++-- src/ejabberd_router.erl | 8 +- src/ejabberd_s2s.erl | 5 +- src/ejabberd_s2s_in.erl | 8 +- src/ejabberd_s2s_out.erl | 21 ++-- src/ejabberd_sm.erl | 5 +- src/mod_muc/mod_muc_room.erl | 10 +- src/mod_pubsub/mod_pubsub.erl | 12 +-- src/mod_pubsub/nodetree_tree.erl | 15 ++- src/mod_pubsub/nodetree_tree_odbc.erl | 9 +- src/mod_vcard.erl | 5 +- src/mod_vcard_ldap.erl | 5 +- src/web/ejabberd_http_poll.erl | 4 +- src/web/ejabberd_web_admin.erl | 4 +- 23 files changed, 120 insertions(+), 182 deletions(-) diff --git a/src/cache_tab.erl b/src/cache_tab.erl index b05e78b0e..6140453ca 100644 --- a/src/cache_tab.erl +++ b/src/cache_tab.erl @@ -68,8 +68,8 @@ %% API %%==================================================================== start_link(Proc, Tab, Opts, Owner) -> - ?GEN_SERVER:start_link( - {local, Proc}, ?MODULE, [Tab, Opts, get_proc_num(), Owner], []). + ?GEN_SERVER:start_link({local, Proc}, ?MODULE, + [Tab, Opts, get_proc_num(), Owner], []). new(Tab, Opts) -> Res = lists:flatmap( diff --git a/src/ejabberd_admin.erl b/src/ejabberd_admin.erl index c563dd7bd..33728e877 100644 --- a/src/ejabberd_admin.erl +++ b/src/ejabberd_admin.erl @@ -261,8 +261,7 @@ get_sasl_error_logger_type () -> stop_kindly(DelaySeconds, AnnouncementText) -> Subject = io_lib:format("Server stop in ~p seconds!", [DelaySeconds]), WaitingDesc = io_lib:format("Waiting ~p seconds", [DelaySeconds]), - Steps = [ - {"Stopping ejabberd port listeners", + Steps = [{"Stopping ejabberd port listeners", ejabberd_listener, stop_listeners, []}, {"Sending announcement to connected users", mod_announce, send_announcement_to_all, diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl index 1f5041f46..bd69964a4 100644 --- a/src/ejabberd_auth_anonymous.erl +++ b/src/ejabberd_auth_anonymous.erl @@ -140,8 +140,8 @@ anonymous_protocol(Host) when is_list(Host) -> %% defaults to false allow_multiple_connections(Host) when is_list(Host) -> - ejabberd_config:get_local_option( - {allow_multiple_connections, Host}) =:= true. + ejabberd_config:get_local_option({allow_multiple_connections, Host}) + =:= true. %% @spec (User, Server) -> bool() %% User = string() diff --git a/src/ejabberd_auth_ldap.erl b/src/ejabberd_auth_ldap.erl index 54419374e..fbdebeb16 100644 --- a/src/ejabberd_auth_ldap.erl +++ b/src/ejabberd_auth_ldap.erl @@ -440,10 +440,10 @@ is_valid_dn(DN, Server, Attrs, State) -> end ++ [{"%d", State#state.host}, {"%D", DN}], case eldap_filter:parse(State#state.dn_filter, SubstValues) of {ok, EldapFilter} -> - case eldap_pool:search(State#state.eldap_id, [ - {base, State#state.base}, - {filter, EldapFilter}, - {attributes, ["dn"]}]) of + case eldap_pool:search(State#state.eldap_id, + [{base, State#state.base}, + {filter, EldapFilter}, + {attributes, ["dn"]}]) of #eldap_search_result{entries = [_|_]} -> DN; _ -> diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index c21263d10..d18b43626 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -667,8 +667,8 @@ wait_for_feature_request({xmlstreamelement, #xmlel{ns = NS, name = Name} = El}, TLSEnabled == false, SockMod == gen_tcp -> ServerString = binary_to_list(StateData#state.server), - TLSOpts = case ejabberd_config:get_local_option( - {domain_certfile, ServerString}) of + TLSOpts = case ejabberd_config:get_local_option + ({domain_certfile, ServerString}) of undefined -> StateData#state.tls_options; CertFile -> @@ -1606,8 +1606,8 @@ get_conn_type(StateData) -> if is_pid(StateData#state.socket) -> unknown; true -> - case ejabberd_zlib:get_sockmod( - (StateData#state.socket)#socket_state.socket) of + case ejabberd_zlib:get_sockmod + ((StateData#state.socket)#socket_state.socket) of gen_tcp -> c2s_compressed; tls -> c2s_compressed_tls end diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index e9a4eff5f..64bb74b3a 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -63,18 +63,15 @@ -define(VFIELD(Type, Var, Value), #xmlel{name = 'field', attrs = [ - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = Type }, - #xmlattr{ - name = 'var', + #xmlattr{name = 'var', value = Var } ], children = [ - #xmlel{ - name = 'value', + #xmlel{name = 'value', children = [Value] } ]}). @@ -113,16 +110,13 @@ create_captcha(SID, From, To, Lang, Args) name = 'data', ns = ?NS_BOB, attrs = [ - #xmlattr{ - name = 'cid', + #xmlattr{name = 'cid', value = CID }, - #xmlattr{ - name = 'max-age', + #xmlattr{name = 'max-age', value = <<"0">> }, - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = Type } ], @@ -144,12 +138,10 @@ create_captcha(SID, From, To, Lang, Args) name = 'captcha', ns = ?NS_CAPTCHA, children = [ - #xmlel{ - name = 'x', + #xmlel{name = 'x', ns = ?NS_DATA_FORMS_s, attrs = [ - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = <<"form">> } ], @@ -158,28 +150,22 @@ create_captcha(SID, From, To, Lang, Args) ?VFIELD(<<"hidden">>, <<"from">>, #xmlcdata{cdata = exmpp_jid:to_binary(To)}), ?VFIELD(<<"hidden">>, <<"challenge">>, #xmlcdata{cdata = list_to_binary(Id)}), ?VFIELD(<<"hidden">>, <<"sid">>, #xmlcdata{cdata = SID}), - #xmlel{ - name = 'field', + #xmlel{name = 'field', attrs = [ - #xmlattr{ - name = 'var', + #xmlattr{name = 'var', value = <<"ocr">> }, - #xmlattr{ - name = 'label', + #xmlattr{name = 'label', value = ?CAPTCHA_TEXT(Lang) } ], children = [ - #xmlel{ - name = 'media', + #xmlel{name = 'media', ns = ?NS_DATA_FORMS_MEDIA_s, children = [ - #xmlel{ - name = 'uri', + #xmlel{name = 'uri', attrs = [ - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = Type } ], @@ -198,24 +184,19 @@ create_captcha(SID, From, To, Lang, Args) BodyString1 = translate:translate(Lang, "Your messages to ~s are being blocked. To unblock them, visit ~s"), BodyString = io_lib:format(BodyString1, [JID, get_url(Id)]), Body = - #xmlel{ - name = 'body', + #xmlel{name = 'body', children = [ - #xmlcdata{ - cdata = list_to_binary(BodyString) + #xmlcdata{cdata = list_to_binary(BodyString) } ] }, OOB = - #xmlel{ - name = 'x', + #xmlel{name = 'x', ns = ?NS_OOBD_X_s, children = [ - #xmlel{ - name = 'url', + #xmlel{name = 'url', children = [ - #xmlcdata{ - cdata = list_to_binary(get_url(Id))} + #xmlcdata{cdata = list_to_binary(get_url(Id))} ] } ] @@ -243,11 +224,9 @@ build_captcha_html(Id, Lang) -> {ok, _} -> %ImgEl = {xmlelement, "img", [{"src", get_url(Id ++ "/image")}], []}, ImgEl = - #xmlel{ - name = 'img', + #xmlel{name = 'img', attrs = [ - #xmlattr{ - name = 'src', + #xmlattr{name = 'src', value = list_to_binary(get_url(Id ++ "/image")) } ] @@ -258,19 +237,15 @@ build_captcha_html(Id, Lang) -> % {"name", "id"}, % {"value", Id}], []}, IdEl = - #xmlel{ - name = 'input', + #xmlel{name = 'input', attrs = [ - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = <<"hidden">> }, - #xmlattr{ - name = 'name', + #xmlattr{name = 'name', value = <<"id">> }, - #xmlattr{ - name = 'value', + #xmlattr{name = 'value', value = list_to_binary(Id) } ] @@ -279,19 +254,15 @@ build_captcha_html(Id, Lang) -> % {"name", "key"}, % {"size", "10"}], []}, KeyEl = - #xmlel{ - name = 'input', + #xmlel{name = 'input', attrs = [ - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = <<"text">> }, - #xmlattr{ - name = 'name', + #xmlattr{name = 'name', value = <<"key">> }, - #xmlattr{ - name = 'size', + #xmlattr{name = 'size', value = <<"10">> } ] @@ -311,49 +282,38 @@ build_captcha_html(Id, Lang) -> % {"value", "OK"}], []} % ]}, FormEl = - #xmlel{ - name = 'form', + #xmlel{name = 'form', attrs = [ - #xmlattr{ - name = 'action', + #xmlattr{name = 'action', value = list_to_binary(get_url(Id)) }, - #xmlattr{ - name = 'name', + #xmlattr{name = 'name', value = <<"captcha">> }, - #xmlattr{ - name = 'method', + #xmlattr{name = 'method', value = <<"POST">> } ], children = [ ImgEl, - #xmlel{ - name = 'br' + #xmlel{name = 'br' }, TextEl, - #xmlel{ - name = 'br' + #xmlel{name = 'br' }, IdEl, KeyEl, - #xmlel{ - name = 'br' + #xmlel{name = 'br' }, - #xmlel{ - name = 'input', + #xmlel{name = 'input', attrs = [ - #xmlattr{ - name = 'type', + #xmlattr{name = 'type', value = <<"submit">> }, - #xmlattr{ - name = 'name', + #xmlattr{name = 'name', value = <<"enter">> }, - #xmlattr{ - name = 'value', + #xmlattr{name = 'value', value = <<"OK">> } ] @@ -419,11 +379,9 @@ process(_Handlers, #request{method='GET', lang=Lang, path=[_, Id]}) -> Form = %{xmlelement, "div", [{"align", "center"}], %[FormEl]}, - #xmlel{ - name = 'div', + #xmlel{name = 'div', attrs = [ - #xmlattr{ - name = 'align', + #xmlattr{name = 'align', value = <<"center">> } ], @@ -460,11 +418,9 @@ process(_Handlers, #request{method='POST', q=Q, lang=Lang, path=[_, Id]}) -> % [{xmlcdata, % translate:translate(Lang, "The captcha is valid.") % }]}, - #xmlel{ - name = 'p', + #xmlel{name = 'p', children = [ - #xmlcdata{ - cdata = translate:translate(Lang, "The captcha is valid.")} + #xmlcdata{cdata = translate:translate(Lang, "The captcha is valid.")} ] }, ejabberd_web:make_xhtml([Form]); diff --git a/src/ejabberd_check.erl b/src/ejabberd_check.erl index 8b315861a..637009980 100644 --- a/src/ejabberd_check.erl +++ b/src/ejabberd_check.erl @@ -88,8 +88,8 @@ get_db_used() -> DBs = lists:foldr( fun([Domain, DB], Acc) -> case check_odbc_option( - ejabberd_config:get_local_option( - {auth_method, Domain})) of + ejabberd_config:get_local_option + ({auth_method, Domain})) of true -> [get_db_type(DB)|Acc]; _ -> Acc end diff --git a/src/ejabberd_ctl.erl b/src/ejabberd_ctl.erl index 528b50aa5..e9bca6b21 100644 --- a/src/ejabberd_ctl.erl +++ b/src/ejabberd_ctl.erl @@ -438,8 +438,7 @@ print_usage() -> print_usage(dual, MaxC, ShCode). print_usage(HelpMode, MaxC, ShCode) -> AllCommands = - [ - {"status", [], "Get ejabberd status"}, + [{"status", [], "Get ejabberd status"}, {"stop", [], "Stop ejabberd"}, {"restart", [], "Restart ejabberd"}, {"help", ["[--tags [tag] | com?*]"], "Show help (try: ejabberdctl help help)"}, diff --git a/src/ejabberd_local.erl b/src/ejabberd_local.erl index ebcad372d..b6ae0a9f3 100644 --- a/src/ejabberd_local.erl +++ b/src/ejabberd_local.erl @@ -64,9 +64,8 @@ % These are the namespace already declared by the stream opening. This is % used at serialization time. -define(DEFAULT_NS, ?NS_JABBER_CLIENT). --define(PREFIXED_NS, [ - {?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx} -]). +-define(PREFIXED_NS, + [{?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx}]). %%==================================================================== %% API diff --git a/src/ejabberd_receiver.erl b/src/ejabberd_receiver.erl index f0cef9fe8..76a24c542 100644 --- a/src/ejabberd_receiver.erl +++ b/src/ejabberd_receiver.erl @@ -440,14 +440,12 @@ do_reset_stream(#state{xml_stream_state = XMLStreamState}) -> new_xmlstream(C2SPid, MaxStanzaSize) -> - Parser = exmpp_xml:start_parser([ - {names_as_atom, true}, - {check_nss, xmpp}, - {check_elems, xmpp}, - {check_attrs, xmpp}, - {max_size, MaxStanzaSize} - ]), - exmpp_xmlstream:start( - {gen_fsm, C2SPid}, Parser, - [{xmlstreamstart, new}] - ). + Parser = exmpp_xml:start_parser([{names_as_atom, true}, + {check_nss, xmpp}, + {check_elems, xmpp}, + {check_attrs, xmpp}, + {max_size, MaxStanzaSize} + ]), + exmpp_xmlstream:start({gen_fsm, C2SPid}, Parser, + [{xmlstreamstart, new}] + ). diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index be3a6401f..f9bc0ab76 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -427,8 +427,8 @@ do_route(OrigFrom, OrigTo, OrigPacket) -> drop end; Rs -> - Value = case ejabberd_config:get_local_option( - {domain_balancing, LDstDomain}) of + Value = case ejabberd_config:get_local_option + ({domain_balancing, LDstDomain}) of undefined -> now(); random -> now(); source -> jlib:short_prepd_jid(From); @@ -477,8 +477,8 @@ do_route(OrigFrom, OrigTo, OrigPacket) -> end. get_component_number(LDomain) -> - case ejabberd_config:get_local_option( - {domain_balancing_component_number, LDomain}) of + case ejabberd_config:get_local_option + ({domain_balancing_component_number, LDomain}) of N when is_integer(N), N > 1 -> N; diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index 59af8d9aa..8a69bcb04 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -61,9 +61,8 @@ % These are the namespace already declared by the stream opening. This is % used at serialization time. -define(DEFAULT_NS, ?NS_JABBER_CLIENT). --define(PREFIXED_NS, [ - {?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx} -]). +-define(PREFIXED_NS, + [{?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx}]). -record(s2s, {fromto, pid, key}). -record(state, {}). diff --git a/src/ejabberd_s2s_in.erl b/src/ejabberd_s2s_in.erl index b1b87c8df..e61e770a8 100644 --- a/src/ejabberd_s2s_in.erl +++ b/src/ejabberd_s2s_in.erl @@ -89,9 +89,8 @@ % These are the namespace already declared by the stream opening. This is % used at serialization time. -define(DEFAULT_NS, ?NS_JABBER_SERVER). --define(PREFIXED_NS, [ - {?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx} -]). +-define(PREFIXED_NS, + [{?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx}]). %%%---------------------------------------------------------------------- %%% API @@ -524,8 +523,7 @@ handle_sync_event(get_state_infos, _From, StateName, StateData) -> [D || {{D, _}, established} <- dict:to_list(Connections)] end, - Infos = [ - {direction, in}, + Infos = [{direction, in}, {statename, StateName}, {addr, Addr}, {port, Port}, diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl index 37d20651b..7e686cce5 100644 --- a/src/ejabberd_s2s_out.erl +++ b/src/ejabberd_s2s_out.erl @@ -106,9 +106,8 @@ % These are the namespace already declared by the stream opening. This is % used at serialization time. -define(DEFAULT_NS, ?NS_JABBER_SERVER). --define(PREFIXED_NS, [ - {?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx} -]). +-define(PREFIXED_NS, + [{?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx}]). -define(SOCKET_DEFAULT_RESULT, {error, badarg}). @@ -606,9 +605,8 @@ wait_for_starttls_proceed({xmlstreamelement, El}, StateData) -> ?DEBUG("starttls: ~p", [{StateData#state.myname, StateData#state.server}]), Socket = StateData#state.socket, - TLSOpts = case ejabberd_config:get_local_option( - {domain_certfile, - StateData#state.server}) of + TLSOpts = case ejabberd_config:get_local_option + ({domain_certfile, StateData#state.server}) of undefined -> StateData#state.tls_options; CertFile -> @@ -763,8 +761,7 @@ handle_sync_event(get_state_infos, _From, StateName, StateData) -> _:_ -> {unknown,unknown} end, - Infos = [ - {direction, out}, + Infos = [{direction, out}, {statename, StateName}, {addr, Addr}, {port, Port}, @@ -862,8 +859,8 @@ terminate(Reason, StateName, StateData) -> false -> ok; Key -> - ejabberd_s2s:remove_connection( - {StateData#state.myname, StateData#state.server}, self(), Key) + ejabberd_s2s:remove_connectio + ({StateData#state.myname, StateData#state.server}, self(), Key) end, %% bounce queue manage by process and Erlang message queue bounce_queue(StateData#state.queue, 'remote-server-not-found'), @@ -953,8 +950,8 @@ send_db_request(StateData) -> Server = StateData#state.server, New = case StateData#state.new of false -> - case ejabberd_s2s:try_register( - {StateData#state.myname, Server}) of + case ejabberd_s2s:try_register + ({StateData#state.myname, Server}) of {key, Key} -> Key; false -> diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 2024b03f0..4afeb08e7 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -80,9 +80,8 @@ % These are the namespace already declared by the stream opening. This is % used at serialization time. -define(DEFAULT_NS, ?NS_JABBER_CLIENT). --define(PREFIXED_NS, [ - {?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx} -]). +-define(PREFIXED_NS, + [{?NS_XMPP, ?NS_XMPP_pfx}, {?NS_DIALBACK, ?NS_DIALBACK_pfx}]). -define(IS_BINARY_OR_UNDEF(X), diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index 78bbd1921..cb8ec1cd8 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -232,9 +232,9 @@ normal_state({route, From, undefined, message_time = Now, message_shaper = MessageShaper, message = Packet}, - RoomQueue = queue:in( - {message, From}, - StateData#state.room_queue), + RoomQueue = + queue:in({message, From}, + StateData#state.room_queue), StateData2 = store_user_activity( From, NewActivity, StateData1), @@ -3042,8 +3042,8 @@ get_config(Lang, StateData, From) -> true -> [#xmlel{name = 'option', attrs = [?XMLATTR('label', translate:translate(Lang, "No limit"))], - children = [#xmlel{name = 'value', children = [#xmlcdata{ - cdata = <<"none">>}]}]}] + children = [#xmlel{name = 'value', + children = [#xmlcdata{cdata = <<"none">>}]}]}] end ++ [#xmlel{name = 'option', attrs = [?XMLATTR('label', N)], children = [#xmlel{name = 'value', children = [ diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 419bd48e4..77737b44d 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -336,8 +336,8 @@ update_node_database(Host, ServerHost) -> options = Options} | RecList], Nidx + 1} end, {[], 1}, - mnesia:match_object( - {pubsub_node, {Host, '_'}, '_', '_'})), + mnesia:match_object + ({pubsub_node, {Host, '_'}, '_', '_'})), mnesia:write(#pubsub_index{index = node, last = LastIdx, free = []}), Result end, @@ -386,10 +386,10 @@ update_node_database(Host, ServerHost) -> creation = {C2, C1}}) end, mnesia:match_object(#pubsub_item{id = {'_', NodeId}, _ = '_'})), Nidx + 1 - end, 1, mnesia:match_object( - {pubsub_node, {Host, '_'}, '_', '_', '_', '_', '_'}) - ++ mnesia:match_object( - {pubsub_node, {{'_', ServerHost, '_'}, '_'}, '_', '_', '_', '_', '_'})), + end, 1, mnesia:match_object + ({pubsub_node, {Host, '_'}, '_', '_', '_', '_', '_'}) + ++ mnesia:match_object + ({pubsub_node, {{'_', ServerHost, '_'}, '_'}, '_', '_', '_', '_', '_'})), mnesia:write(#pubsub_index{index = node, last = LastIdx, free = []}) end, case mnesia:transaction(FNew) of diff --git a/src/mod_pubsub/nodetree_tree.erl b/src/mod_pubsub/nodetree_tree.erl index 263b89d66..d46452f24 100644 --- a/src/mod_pubsub/nodetree_tree.erl +++ b/src/mod_pubsub/nodetree_tree.erl @@ -350,14 +350,13 @@ create_node(Host, NodeId, Type, #jid{node = U, domain = S} = _JID, Options, Pare true -> NodeIdx = pubsub_index:new(node), mnesia:write( - #pubsub_node{ - id = {Host, NodeId}, - idx = NodeIdx, - parents = ParentNodeIds, - type = Type, - owners = [Owner], - options = Options}), - {ok, NodeIdx}; + #pubsub_node{id = {Host, NodeId}, + idx = NodeIdx, + parents = ParentNodeIds, + type = Type, + owners = [Owner], + options = Options}), + {ok, NodeIdx}; false -> %% Requesting entity is prohibited from creating nodes {error, 'forbidden'} end; diff --git a/src/mod_pubsub/nodetree_tree_odbc.erl b/src/mod_pubsub/nodetree_tree_odbc.erl index 9460bee3a..4c2efa7f4 100644 --- a/src/mod_pubsub/nodetree_tree_odbc.erl +++ b/src/mod_pubsub/nodetree_tree_odbc.erl @@ -236,11 +236,10 @@ create_node(Host, Node, Type, Owner, Options, Parents) -> end, case ParentExists of true -> - case set_node(#pubsub_node{ - id={Host, Node}, - parents=Parents, - type=Type, - options=Options}) of + case set_node(#pubsub_node{id={Host, Node}, + parents=Parents, + type=Type, + options=Options}) of {result, Nidx} -> {ok, Nidx}; Other -> Other end; diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index f38fe7cfc..79fe4d29a 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -403,9 +403,8 @@ do_route(ServerHost, From, To, Packet) -> Result = #xmlel{ ns = ?NS_SEARCH, name = 'query', - children = [ - #xmlel{ - ns = ?NS_DATA_FORMS, + children = + [#xmlel{ns = ?NS_DATA_FORMS, name = 'x', attrs = [?XMLATTR('type', <<"result">>)], diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 4c08098c7..7368194a3 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -439,9 +439,8 @@ route(State, From, To, Packet) -> Result = #xmlel{ ns = ?NS_SEARCH, name = 'query', - children = [ - #xmlel{ - ns = ?NS_DATA_FORMS, + children = + [#xmlel{ns = ?NS_DATA_FORMS, name = 'x', attrs = [?XMLATTR('type', <<"result">>)], diff --git a/src/web/ejabberd_http_poll.erl b/src/web/ejabberd_http_poll.erl index f18774b2e..1033cbc3b 100644 --- a/src/web/ejabberd_http_poll.erl +++ b/src/web/ejabberd_http_poll.erl @@ -73,9 +73,7 @@ -define(CT, {"Content-Type", "text/xml; charset=utf-8"}). -define(BAD_REQUEST, [?CT, {"Set-Cookie", "ID=-3:0; expires=-1"}]). --define(PARSER_OPTIONS, [ - {names_as_atom, true} -]). +-define(PARSER_OPTIONS, [{names_as_atom, true}]). %%%---------------------------------------------------------------------- %%% API diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index df3659004..cfbdbe746 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -1001,8 +1001,8 @@ process_admin(Host, {value, {_, String}} -> case parse_access_rule(String) of {ok, Rs} -> - ejabberd_config:add_global_option( - {access, Name, Host}, Rs), + ejabberd_config:add_global_option + ({access, Name, Host}, Rs), ok; _ -> error