* src/ejabberd_c2s.erl: Add resource to the from packet attribute if missing (EJAB-812).

SVN Revision: 1760
This commit is contained in:
Mickaël Rémond 2008-12-28 12:23:20 +00:00
parent 3a3a89007a
commit c0cc236196
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-12-28 Mickael Remond <mremond@process-one.net>
* src/ejabberd_c2s.erl: Add resource to the from packet attribute
if missing (EJAB-812).
2008-12-24 Badlop <badlop@process-one.net>
* src/aclocal.m4: Fixes in configure script: fix

View File

@ -1980,7 +1980,14 @@ check_from(El, FromJID) ->
%% Matching JID: The stanza is ok
if JIDEl#jid.luser == FromJID#jid.luser andalso
JIDEl#jid.lserver == FromJID#jid.lserver ->
El;
%% We force the resource on the from attribute in the packet.
%% This is strictly needed only for IQ (to
%% reply to the client), but I do not see
%% any good reason for now not to do it on
%% all packets.
%% Need to be changed to support multiple
%% resource binding per connection.
jlib:replace_from(FromJID, El);
true ->
'invalid-from'
end;