LP#1703411: Move OpenSRF XMPP attrs to subelement
[opensrf-equinox.git] / src / perl / lib / OpenSRF / Transport / SlimJabber / XMPPReader.pm
index 9e15ecd..737cf96 100644 (file)
@@ -306,8 +306,13 @@ sub start_element {
 
         my $msg = $self->{message};
         $msg->{to} = $attrs{'to'};
-        $msg->{from} = $attrs{router_from} if $attrs{router_from};
-        $msg->{from} = $attrs{from} unless $msg->{from};
+        $msg->{from} = $attrs{from};
+
+    } elsif($name eq 'opensrf') {
+
+        # These will be authoritative if they exist
+        my $msg = $self->{message};
+        $msg->{from} = $attrs{router_from};
         $msg->{osrf_xid} = $attrs{'osrf_xid'};
         $msg->{type} = $attrs{type};