mirror of
https://github.com/processone/ejabberd.git
synced 2024-10-01 14:44:07 +02:00
Merge branch '2.2.x' of git+ssh://git@gitorious.process-one.net/+ejabberd-developers/ejabberd/maincustomers.git into 2.2.x
This commit is contained in:
commit
ecf7b0282e
@ -168,7 +168,11 @@ user_receive_packet(_DebugFlag,
|
||||
#jid{lserver = Server}, From, _To,
|
||||
{xmlelement, "presence", Attrs, Els}) ->
|
||||
Type = xml:get_attr_s("type", Attrs),
|
||||
if Type == ""; Type == "available" ->
|
||||
IsRemote = not lists:member(From#jid.lserver, ?MYHOSTS),
|
||||
%% Local users presence caps are already handled by user_send_packet.
|
||||
%% Otherwise we could send multiple request when broadcasting presence
|
||||
%% to every local subscriber.
|
||||
if IsRemote and ((Type == "") or (Type == "available")) ->
|
||||
case read_caps(Els) of
|
||||
nothing ->
|
||||
ok;
|
||||
|
@ -1,7 +1,7 @@
|
||||
%%%----------------------------------------------------------------------
|
||||
%%% File : sha.erl
|
||||
%%% Author : Alexey Shchepin <alexey@process-one.net>
|
||||
%%% Purpose :
|
||||
%%% Purpose :
|
||||
%%% Created : 20 Dec 2002 by Alexey Shchepin <alexey@process-one.net>
|
||||
%%%
|
||||
%%%
|
||||
@ -28,7 +28,7 @@
|
||||
-author('alexey@process-one.net').
|
||||
|
||||
-export([start/0, sha/1, sha1/1, sha224/1, sha256/1, sha384/1,
|
||||
sha512/1]).
|
||||
sha512/1, to_hexlist/1]).
|
||||
|
||||
-ifdef(HAVE_MD2).
|
||||
-export([md2/1]).
|
||||
@ -61,6 +61,9 @@ digit_to_xchar(D) ->
|
||||
|
||||
sha(Text) ->
|
||||
Bin = crypto:sha(Text),
|
||||
to_hexlist(Bin).
|
||||
|
||||
to_hexlist(Bin) ->
|
||||
lists:reverse(ints_to_rxstr(binary_to_list(Bin), [])).
|
||||
|
||||
ints_to_rxstr([], Res) ->
|
||||
|
Loading…
Reference in New Issue
Block a user