25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Fix even more dialyzer warnings

This commit is contained in:
Badlop 2015-03-27 12:28:11 +01:00
parent 8707c0b045
commit 30dc82a98a
4 changed files with 6 additions and 22 deletions

View File

@ -1689,13 +1689,7 @@ handle_info({route, From, To,
end;
_ -> {true, Attrs, StateData}
end,
if Pass == exit ->
%% When Pass==exit, NewState contains a string instead of a #state{}
Lang = StateData#state.lang,
send_element(StateData, ?SERRT_CONFLICT(Lang, NewState)),
send_trailer(StateData),
{stop, normal, StateData};
Pass ->
if Pass ->
Attrs2 =
jlib:replace_from_to_attrs(jlib:jid_to_string(From),
jlib:jid_to_string(To), NewAttrs),

View File

@ -138,13 +138,6 @@ build_script(Dir, UpdatedBeams) ->
LowLevelScript,
[{ejabberd, "", filename:join(Dir, "..")}]),
Check1 = case Check of
ok ->
%% This clause is for OTP R14B03 and older.
%% Newer Dialyzer reports a never match pattern; don't worry.
?DEBUG("script: ~p~n", [Script]),
?DEBUG("low level script: ~p~n", [LowLevelScript]),
?DEBUG("check: ~p~n", [Check]),
ok;
{ok, []} ->
?DEBUG("script: ~p~n", [Script]),
?DEBUG("low level script: ~p~n", [LowLevelScript]),

View File

@ -317,7 +317,7 @@ commands() ->
#ejabberd_commands{name = set_nickname, tags = [vcard],
desc = "Set nickname in a user's vCard",
module = ?MODULE, function = set_nickname,
args = [{user, string}, {host, string}, {nickname, string}],
args = [{user, binary}, {host, binary}, {nickname, binary}],
result = {res, rescode}},
#ejabberd_commands{name = get_vcard, tags = [vcard],
@ -933,7 +933,7 @@ set_nickname(User, Host, Nickname) ->
]
}}),
case R of
{iq, [], result, [], _L, []} ->
{iq, <<>>, result, <<>>, _L, []} ->
ok;
_ ->
error
@ -988,7 +988,7 @@ get_vcard([<<"TEL">>, TelType], {_, _, _, OldEls}) ->
get_vcard([Data1, Data2], A1) ->
case get_subtag(A1, Data1) of
false -> false;
[false] -> false;
A2List ->
lists:flatten([get_vcard([Data2], A2) || A2 <- A2List])
end;
@ -1200,7 +1200,7 @@ push_roster_item(LU, LS, U, S, Action) ->
push_roster_item(LU, LS, R, U, S, Action) ->
LJID = jlib:make_jid(LU, LS, R),
BroadcastEl = build_broadcast(U, S, Action),
ejabberd_router:route(LJID, LJID, BroadcastEl),
ejabberd_sm:route(LJID, LJID, BroadcastEl),
Item = build_roster_item(U, S, Action),
ResIQ = build_iq_roster_push(Item),
ejabberd_router:route(LJID, LJID, ResIQ).

View File

@ -1057,10 +1057,7 @@ count_offline_messages(LUser, LServer, riak) ->
Res;
_ ->
0
end;
count_offline_messages(_Acc, User, Server) ->
N = count_offline_messages(User, Server),
{stop, N}.
end.
%% Return the number of records matching a given match expression.
%% This function is intended to be used inside a Mnesia transaction.