]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_c2s.erl: Add resource to the from packet attribute if missing (EJAB...
authorMickaël Rémond <mickael.remond@process-one.net>
Sun, 28 Dec 2008 12:23:20 +0000 (12:23 +0000)
committerMickaël Rémond <mickael.remond@process-one.net>
Sun, 28 Dec 2008 12:23:20 +0000 (12:23 +0000)
SVN Revision: 1760

ChangeLog
src/ejabberd_c2s.erl

index 1b33d3d512bc0cd9c10162534836855db7f30507..b7e5aa176215f501776b693aaf9464acd4b2849e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 46020ee84420fb963a9920435880ea7a27c22e7f..44b05f51e34c944decda03d95598fc77802de84d 100644 (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;