25
1
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:
Alexey Shchepin 2012-02-03 17:53:17 +02:00
commit ecf7b0282e
2 changed files with 10 additions and 3 deletions

View File

@ -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;

View File

@ -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) ->