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

Fix dialyzer warnings for mod_mam

This commit is contained in:
Evgeniy Khramtsov 2016-09-13 16:56:34 +03:00
parent e987b88848
commit 151668ac10
3 changed files with 5 additions and 8 deletions

View File

@ -4,7 +4,7 @@
timestamp = p1_time_compat:timestamp() :: erlang:timestamp() | '_' | '$1', timestamp = p1_time_compat:timestamp() :: erlang:timestamp() | '_' | '$1',
peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3' | undefined, peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3' | undefined,
bare_peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3', bare_peer = {<<"">>, <<"">>, <<"">>} :: ljid() | '_' | '$3',
packet = #xmlel{} :: xmlel() | '_', packet = #xmlel{} :: xmlel() | message() | '_',
nick = <<"">> :: binary(), nick = <<"">> :: binary(),
type = chat :: chat | groupchat}). type = chat :: chat | groupchat}).

View File

@ -945,7 +945,7 @@ filter_by_max(Msgs, Len) when is_integer(Len), Len >= 0 ->
filter_by_max(_Msgs, _Junk) -> filter_by_max(_Msgs, _Junk) ->
{[], true}. {[], true}.
-spec limit_max(rsm_set(), binary()) -> rsm_set(). -spec limit_max(rsm_set(), binary()) -> rsm_set() | undefined.
limit_max(RSM, ?NS_MAM_TMP) -> limit_max(RSM, ?NS_MAM_TMP) ->
RSM; % XEP-0313 v0.2 doesn't require clients to support RSM. RSM; % XEP-0313 v0.2 doesn't require clients to support RSM.
limit_max(#rsm_set{max = Max} = RSM, _NS) when not is_integer(Max) -> limit_max(#rsm_set{max = Max} = RSM, _NS) when not is_integer(Max) ->

View File

@ -217,13 +217,10 @@ make_sql_query(User, LServer,
true -> true ->
[] []
end, end,
WithTextClause = case WithText of WithTextClause = if is_binary(WithText), WithText /= <<>> ->
{text, <<>>} ->
[];
{text, Txt} ->
[<<" and match (txt) against ('">>, [<<" and match (txt) against ('">>,
Escape(Txt), <<"')">>]; Escape(WithText), <<"')">>];
undefined -> true ->
[] []
end, end,
WithClause = case catch jid:tolower(With) of WithClause = case catch jid:tolower(With) of