[Opensrf-commits] r1730 - trunk/src/perl/lib/OpenSRF/Transport/SlimJabber (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 29 08:53:51 EDT 2009


Author: erickson
Date: 2009-07-29 08:53:49 -0400 (Wed, 29 Jul 2009)
New Revision: 1730

Modified:
   trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Client.pm
Log:
set the 'from' address in outbound xmpp messages

Modified: trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Client.pm
===================================================================
--- trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Client.pm	2009-07-28 20:27:42 UTC (rev 1729)
+++ trunk/src/perl/lib/OpenSRF/Transport/SlimJabber/Client.pm	2009-07-29 12:53:49 UTC (rev 1730)
@@ -113,6 +113,7 @@
 	my $self = shift;
     my $msg = OpenSRF::Transport::SlimJabber::XMPPMessage->new(@_);
     $msg->osrf_xid($logger->get_osrf_xid);
+    $msg->from($self->xmpp_id);
     $self->reader->send($msg->to_xml);
 }
 
@@ -130,8 +131,6 @@
 	my $resource	= $self->params->{resource};
 	my $password	= $self->params->{password};
 
-    my $jid = "$username\@$host/$resource";
-
 	my $conf = OpenSRF::Utils::Config->current;
 
 	my $tail = "_$$";
@@ -153,10 +152,19 @@
     throw OpenSRF::EX::Jabber("Could not authenticate with Jabber server: $@")
 	    unless ( $self->reader->connected );
 
+    $self->xmpp_id("$username\@$host/$resource");
 	return $self;
 }
 
 
+# Our full login:  username at host/resource
+sub xmpp_id {
+    my($self, $xmpp_id) = @_;
+    $self->{xmpp_id} = $xmpp_id if $xmpp_id;
+    return $self->{xmpp_id};
+}
+
+
 =head2 construct
 
 =cut



More information about the opensrf-commits mailing list