25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00
SVN Revision: 1748
This commit is contained in:
Christophe Romain 2008-12-23 10:53:06 +00:00
parent 4d20367a0c
commit 17cbd1614a

View File

@ -234,16 +234,16 @@ handle_cast({note_caps, From,
#state{host = Host, disco_requests = Requests} = State) ->
%% XXX: this leads to race conditions where ejabberd will send
%% lots of caps disco requests.
{U, S, R} = jlib:jid_tolower(From),
BJID = list_to_binary(jlib:jid_to_string(From)),
mnesia:dirty_write(#user_caps{jid = BJID, caps = Caps}),
case ejabberd_sm:get_user_resources(LUser, LServer) of
case ejabberd_sm:get_user_resources(U, S) of
[] ->
ok;
_ ->
% only store default resource of external contacts
{_, _, R} = jlib:jid_tolower(From),
BUID = list_to_binary(jlib:jid_to_string(jlib:jid_remove_resource(From))),
mnesia:dirty_write(#user_caps_default{uid = BUID, resource = R}),
mnesia:dirty_write(#user_caps_default{uid = BUID, resource = R})
end,
SubNodes = [Version | Exts],
%% Now, find which of these are not already in the database.