]> granicus.if.org Git - ejabberd/commitdiff
* src/mod_caps.erl: Fix compilation warnings: Part 2 (EJAB-290)
authorBadlop <badlop@process-one.net>
Fri, 7 Dec 2007 00:09:48 +0000 (00:09 +0000)
committerBadlop <badlop@process-one.net>
Fri, 7 Dec 2007 00:09:48 +0000 (00:09 +0000)
* src/mod_configure.erl:
* src/mod_configure2.erl:
* src/mod_offline_odbc.erl:
* src/mod_shared_roster.erl:
* src/mod_stats.erl:
* src/mod_version.erl:

SVN Revision: 1046

ChangeLog
src/mod_caps.erl
src/mod_configure.erl
src/mod_configure2.erl
src/mod_offline_odbc.erl
src/mod_shared_roster.erl
src/mod_stats.erl
src/mod_version.erl

index 4fda2bf650c7244f559216ee0a83b64a71c79fee..79ca1a9bde82324aa1b88352b61b4fa00c9cc02c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-12-07  Badlop  <badlop@process-one.net>
 
+       * src/mod_caps.erl: Fix compilation warnings: Part 2 (EJAB-290)
+       * src/mod_configure.erl: 
+       * src/mod_configure2.erl: 
+       * src/mod_offline_odbc.erl: 
+       * src/mod_shared_roster.erl: 
+       * src/mod_stats.erl: 
+       * src/mod_version.erl: 
+
        * src/cyrsasl.erl: Fix compilation warnings: Part 1 (EJAB-290)
        * src/ejabberd_auth_odbc.erl: Likewise
        * src/ejabberd_config.erl: Likewise
index 66afd10abba22ccd44387c8200779928f7ea4948..cb6bc63d77f94522e181b35bacda49207baf9286 100644 (file)
@@ -140,7 +140,7 @@ maybe_get_features(#caps{node = Node, version = Version, exts = Exts}) ->
 timestamp() ->
     {MegaSecs, Secs, _MicroSecs} = now(),
     MegaSecs * 1000000 + Secs.
-    
+
 handle_call({get_features, Caps}, From, State) ->
     case maybe_get_features(Caps) of
        {ok, Features} -> 
@@ -204,7 +204,7 @@ handle_cast({disco_response, From, _To,
                 sub_el = SubEls}},
            #state{disco_requests = Requests} = State) ->
     case {Type, SubEls} of
-       {result, [{xmlelement, "query", Attrs, Els}]} ->
+       {result, [{xmlelement, "query", _Attrs, Els}]} ->
            case ?DICT:find(ID, Requests) of
                {ok, {Node, SubNode}} ->
                    Features =
index ff207d85abfcbb4a448002cd5d78c0f76cdc16f8..8f4a10290853e297d22cdbb0c2163eb2a4a7d0b0 100644 (file)
@@ -1261,7 +1261,7 @@ set_form(_From, _Host, ["running nodes", ENode, "DB"], _Lang, XData) ->
        Node ->
            lists:foreach(
              fun({SVar, SVals}) ->
-                       %% We believe that this is allowed only for good people
+                     %% We believe that this is allowed only for good people
                      Table = list_to_atom(SVar),
                      Type = case SVals of
                                 ["unknown"] -> unknown;
@@ -1604,7 +1604,7 @@ set_form(_From, _Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) ->
     FLast =
        case ejabberd_sm:get_user_resources(User, Server) of
            [] ->
-               US = {User, Server},
+               _US = {User, Server},
                case get_last_info(User, Server) of
                    not_found ->
                        ?T(Lang, "Never");
index 47b6a0d2f07b456f181f2566ac2b2a2bbda9873d..74f04c1c4256d788eeb35b324c912e860ad0c57e 100644 (file)
@@ -30,7 +30,7 @@ stop(Host) ->
     gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_ECONFIGURE).
 
 
-process_local_iq(From, To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) ->
+process_local_iq(From, To, #iq{type = Type, lang = _Lang, sub_el = SubEl} = IQ) ->
     case acl:match_rule(To#jid.lserver, configure, From) of
        deny ->
            IQ#iq{type = error, sub_el = [SubEl, ?ERR_NOT_ALLOWED]};
@@ -39,38 +39,38 @@ process_local_iq(From, To, #iq{type = Type, lang = Lang, sub_el = SubEl} = IQ) -
                set ->
                    IQ#iq{type = error,
                          sub_el = [SubEl, ?ERR_FEATURE_NOT_IMPLEMENTED]};
-                   %case xml:get_tag_attr_s("type", SubEl) of
-                   %    "cancel" ->
-                   %        IQ#iq{type = result,
-                   %              sub_el = [{xmlelement, "query",
-                   %                         [{"xmlns", XMLNS}], []}]};
-                   %    "submit" ->
-                   %        XData = jlib:parse_xdata_submit(SubEl),
-                   %        case XData of
-                   %           invalid ->
-                   %               IQ#iq{type = error,
-                   %                     sub_el = [SubEl, ?ERR_BAD_REQUEST]};
-                   %           _ ->
-                   %               Node =
-                   %                   string:tokens(
-                   %                     xml:get_tag_attr_s("node", SubEl),
-                   %                     "/"),
-                   %               case set_form(Node, Lang, XData) of
-                   %                   {result, Res} ->
-                   %                       IQ#iq{type = result,
-                   %                             sub_el = [{xmlelement, "query",
-                   %                                        [{"xmlns", XMLNS}],
-                   %                                        Res
-                   %                                       }]};
-                   %                   {error, Error} ->
-                   %                       IQ#iq{type = error,
-                   %                             sub_el = [SubEl, Error]}
-                   %               end
-                   %        end;
-                   %    _ ->
-                   %        IQ#iq{type = error,
-                   %              sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
-                   %end;
+                   %%case xml:get_tag_attr_s("type", SubEl) of
+                   %%    "cancel" ->
+                   %%        IQ#iq{type = result,
+                   %%             sub_el = [{xmlelement, "query",
+                   %%                        [{"xmlns", XMLNS}], []}]};
+                   %%    "submit" ->
+                   %%        XData = jlib:parse_xdata_submit(SubEl),
+                   %%        case XData of
+                   %%          invalid ->
+                   %%              IQ#iq{type = error,
+                   %%                    sub_el = [SubEl, ?ERR_BAD_REQUEST]};
+                   %%          _ ->
+                   %%              Node =
+                   %%                  string:tokens(
+                   %%                    xml:get_tag_attr_s("node", SubEl),
+                   %%                    "/"),
+                   %%              case set_form(Node, Lang, XData) of
+                   %%                  {result, Res} ->
+                   %%                      IQ#iq{type = result,
+                   %%                            sub_el = [{xmlelement, "query",
+                   %%                                       [{"xmlns", XMLNS}],
+                   %%                                       Res
+                   %%                                      }]};
+                   %%                  {error, Error} ->
+                   %%                      IQ#iq{type = error,
+                   %%                            sub_el = [SubEl, Error]}
+                   %%              end
+                   %%        end;
+                   %%    _ ->
+                   %%        IQ#iq{type = error,
+                   %%             sub_el = [SubEl, ?ERR_NOT_ALLOWED]}
+                   %%end;
                get ->
                    case process_get(SubEl) of
                        {result, Res} ->
@@ -145,8 +145,8 @@ process_get({xmlelement, "last", Attrs, _SubEls}) ->
                      [[integer_to_list(TimeStamp - V), " "] || V <- Vals])),
            {result, {xmlelement, "last", Attrs, [{xmlcdata, Str}]}}
     end;
-%process_get({xmlelement, Name, Attrs, SubEls}) ->
-%    {result, };
+%%process_get({xmlelement, Name, Attrs, SubEls}) ->
+%%    {result, };
 process_get(_) ->
     {error, ?ERR_BAD_REQUEST}.
 
index e645bad66a68953f5d7c0fb72d6f00e892f289e5..f7097d732bb89c8e5d778b1cf365a913ea012d35 100644 (file)
@@ -320,7 +320,7 @@ user_queue(User, Server, Query, Lang) ->
           end,
     FMsgs =
        lists:map(
-         fun({xmlelement, Name, Attrs, Els} = Msg) ->
+         fun({xmlelement, _Name, _Attrs, _Els} = Msg) ->
                  ID = jlib:encode_base64(binary_to_list(term_to_binary(Msg))),
                  Packet = Msg,
                  FPacket = ejabberd_web_admin:pretty_print_xml(Packet),
index 07e7c2730b85a45b5457c45320f3029febf6c26b..6703810b4a7ad8a6d03ec35fe74526a8d6d58541 100644 (file)
@@ -64,8 +64,8 @@ start(Host, _Opts) ->
                       ?MODULE, get_jid_info, 70),
     ejabberd_hooks:add(roster_process_item, Host,
                       ?MODULE, process_item, 50).
-    %ejabberd_hooks:add(remove_user, Host,
-    %                 ?MODULE, remove_user, 50),
+%%ejabberd_hooks:add(remove_user, Host,
+%%            ?MODULE, remove_user, 50),
 
 stop(Host) ->
     ejabberd_hooks:delete(webadmin_menu_host, Host,
@@ -84,8 +84,8 @@ stop(Host) ->
                          ?MODULE, get_jid_info, 70),
     ejabberd_hooks:delete(roster_process_item, Host,
                          ?MODULE, process_item, 50).
-    %ejabberd_hooks:delete(remove_user, Host,
-    %                    ?MODULE, remove_user, 50),
+%%ejabberd_hooks:delete(remove_user, Host,
+%%               ?MODULE, remove_user, 50),
 
 
 get_user_roster(Items, US) ->
@@ -120,7 +120,7 @@ get_user_roster(Items, US) ->
                          {Item, SRUsers1}
                  end
          end, SRUsers, Items),
-    
+
     %% Export items in roster format:
     SRItems = [#roster{usj = {U, S, {U1, S1, ""}},
                       us = US,
@@ -313,11 +313,11 @@ get_group_users(Host, Group) ->
 get_group_explicit_users(Host, Group) ->
     case catch mnesia:dirty_index_read(
                 sr_user, {Group, Host}, #sr_user.group_host) of
-       Rs when is_list(Rs) ->
-           [R#sr_user.us || R <- Rs];
-       _ ->
-           []
-    end.
+                                                                 Rs when is_list(Rs) ->
+                [R#sr_user.us || R <- Rs];
+              _ ->
+                []
+        end.
 
 get_group_name(Host, Group) ->
     get_group_opt(Host, Group, name, Group).
@@ -373,18 +373,18 @@ webadmin_menu(Acc, _Host) ->
     [{"shared-roster", "Shared Roster"} | Acc].
 
 webadmin_page(_, Host,
-             #request{us = US,
+             #request{us = _US,
                       path = ["shared-roster"],
                       q = Query,
-                      lang = Lang} = Request) ->
+                      lang = Lang} = _Request) ->
     Res = list_shared_roster_groups(Host, Query, Lang),
     {stop, Res};
 
 webadmin_page(_, Host,
-             #request{us = US,
+             #request{us = _US,
                       path = ["shared-roster", Group],
                       q = Query,
-                      lang = Lang} = Request) ->
+                      lang = Lang} = _Request) ->
     Res = shared_roster_group(Host, Group, Query, Lang),
     {stop, Res};
 
@@ -467,7 +467,7 @@ shared_roster_group(Host, Group, Query, Lang) ->
     Name = get_opt(GroupOpts, name, ""),
     Description = get_opt(GroupOpts, description, ""),
     AllUsers = get_opt(GroupOpts, all_users, false),
-    Disabled = false,
+    %%Disabled = false,
     DisplayedGroups = get_opt(GroupOpts, displayed_groups, []),
     Members = mod_shared_roster:get_group_explicit_users(Host, Group),
     FMembers =
index d6a6d5ffe673d6cbf6963b4a27fde6add4f9355d..091bff1817852055737f39c634a773dc6c50e329 100644 (file)
@@ -26,17 +26,17 @@ stop(Host) ->
     gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_STATS).
 
 
-process_local_iq(From, To, #iq{id = ID, type = Type,
-                              xmlns = XMLNS, sub_el = SubEl} = IQ) ->
-    Lang = xml:get_tag_attr_s("xml:lang", SubEl),
+process_local_iq(_From, To, #iq{id = _ID, type = Type,
+                               xmlns = XMLNS, sub_el = SubEl} = IQ) ->
+    %%Lang = xml:get_tag_attr_s("xml:lang", SubEl),
     case Type of
        set ->
            IQ#iq{type = error, sub_el = [SubEl, ?ERR_NOT_ALLOWED]};
        get ->
-           {xmlelement, _, Attrs, Els} = SubEl,
+           {xmlelement, _, _Attrs, Els} = SubEl,
            Node = string:tokens(xml:get_tag_attr_s("node", SubEl), "/"),
            Names = get_names(Els, []),
-           
+
            case get_local_stats(To#jid.server, Node, Names) of
                {result, Res} ->
                    IQ#iq{type = result,
@@ -120,16 +120,16 @@ get_local_stats(_Server, _, _) ->
 
 get_local_stat(Server, [], Name) when Name == "users/online" ->
     case catch ejabberd_sm:get_vh_session_list(Server) of
-       {'EXIT', Reason} ->
+       {'EXIT', _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Users ->
            ?STATVAL(integer_to_list(length(Users)), "users")
     end;
 
 get_local_stat(Server, [], Name) when Name == "users/total" ->
-    LServer = jlib:nameprep(Server),
+    %%LServer = jlib:nameprep(Server),
     case catch ejabberd_auth:get_vh_registered_users_number(Server) of
-       {'EXIT', Reason} ->
+       {'EXIT', _Reason} ->
            ?STATERR("500", "Internal Server Error");
        NUsers ->
            ?STATVAL(integer_to_list(NUsers), "users")
@@ -137,7 +137,7 @@ get_local_stat(Server, [], Name) when Name == "users/total" ->
 
 get_local_stat(_Server, [], Name) when Name == "users/all-hosts/online" ->
     case catch mnesia:table_info(session, size) of
-       {'EXIT', Reason} ->
+       {'EXIT', _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Users ->
            ?STATVAL(integer_to_list(Users), "users")
@@ -145,7 +145,7 @@ get_local_stat(_Server, [], Name) when Name == "users/all-hosts/online" ->
 
 get_local_stat(_Server, [], Name) when Name == "users/all-hosts/total" ->
     case catch mnesia:table_info(passwd, size) of
-       {'EXIT', Reason} ->
+       {'EXIT', _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Users ->
            ?STATVAL(integer_to_list(Users), "users")
@@ -158,7 +158,7 @@ get_local_stat(_Server, _, Name) ->
 
 get_node_stat(Node, Name) when Name == "time/uptime" ->
     case catch rpc:call(Node, erlang, statistics, [wall_clock]) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        CPUTime ->
            ?STATVAL(
@@ -167,7 +167,7 @@ get_node_stat(Node, Name) when Name == "time/uptime" ->
 
 get_node_stat(Node, Name) when Name == "time/cputime" ->
     case catch rpc:call(Node, erlang, statistics, [runtime]) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        RunTime ->
            ?STATVAL(
@@ -176,7 +176,7 @@ get_node_stat(Node, Name) when Name == "time/cputime" ->
 
 get_node_stat(Node, Name) when Name == "users/online" ->
     case catch rpc:call(Node, ejabberd_sm, dirty_get_my_sessions_list, []) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Users ->
            ?STATVAL(integer_to_list(length(Users)), "users")
@@ -184,7 +184,7 @@ get_node_stat(Node, Name) when Name == "users/online" ->
 
 get_node_stat(Node, Name) when Name == "transactions/commited" ->
     case catch rpc:call(Node, mnesia, system_info, [transaction_commits]) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Transactions ->
            ?STATVAL(integer_to_list(Transactions), "transactions")
@@ -192,7 +192,7 @@ get_node_stat(Node, Name) when Name == "transactions/commited" ->
 
 get_node_stat(Node, Name) when Name == "transactions/aborted" ->
     case catch rpc:call(Node, mnesia, system_info, [transaction_failures]) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Transactions ->
            ?STATVAL(integer_to_list(Transactions), "transactions")
@@ -200,7 +200,7 @@ get_node_stat(Node, Name) when Name == "transactions/aborted" ->
 
 get_node_stat(Node, Name) when Name == "transactions/restarted" ->
     case catch rpc:call(Node, mnesia, system_info, [transaction_restarts]) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Transactions ->
            ?STATVAL(integer_to_list(Transactions), "transactions")
@@ -208,7 +208,7 @@ get_node_stat(Node, Name) when Name == "transactions/restarted" ->
 
 get_node_stat(Node, Name) when Name == "transactions/logged" ->
     case catch rpc:call(Node, mnesia, system_info, [transaction_log_writes]) of
-       {badrpc, Reason} ->
+       {badrpc, _Reason} ->
            ?STATERR("500", "Internal Server Error");
        Transactions ->
            ?STATVAL(integer_to_list(Transactions), "transactions")
index 236f2de7f7938836a531869b6b7d55c2d1da6f82..ec71a8eed9c140d3f83aa74ae4b782a0c6fbbb42 100644 (file)
@@ -28,8 +28,8 @@ stop(Host) ->
     gen_iq_handler:remove_iq_handler(ejabberd_local, Host, ?NS_VERSION).
 
 
-process_local_iq(From, To, #iq{id = ID, type = Type,
-                              xmlns = XMLNS, sub_el = SubEl} = IQ) ->
+process_local_iq(_From, To, #iq{id = _ID, type = Type,
+                              xmlns = _XMLNS, sub_el = SubEl} = IQ) ->
     case Type of
        set ->
            IQ#iq{type = error, sub_el = [SubEl, ?ERR_NOT_ALLOWED]};