Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-XMPP CPAN distribution.

Report information
The Basics
Id: 21609
Status: rejected
Priority: 0/
Queue: Net-XMPP

People
Owner: Nobody in particular
Requestors: peter [...] hartmann.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.0
Fixed in: (no value)



Subject: MessageSend does not work with Net::XMPP::Message
I had problems sending a message by passing a Net::XMPP::Message object to the MessageSend() function in Protocol.pm. Sending a message by passing the arguments directly to MessageSend(), however, worked: executing $Connection->Connect(...); ... $Connection->MessageSend('to' -> 'user@server', 'body' -> 'my message'); works fine, but $Connection->Connect(...); ... my $chatMessage = Net::XMPP::Message->new(); $chatMessage->SetMessage('to' -> 'user@server', 'body' -> 'my message'); $Connection->MessageSend($chatMessage); did not send anything. I think the problem in the MessageSend function in Protocol.pm is that $mess is constructed by executing "$mess = $self->_message();" and "$mess->SetMessage(@_);" although the message is already constructed and ready to be sent. I altered the function to: --- MessageSend-new in Net/XMPP/Protocol.pm --- sub MessageSend { my $self = shift; my $mess; if(ref($_[0]) eq "") { $mess = $self->_message(); $mess->SetMessage(@_); } else { $mess = shift; } $self->Send($mess); } --- end of MessageSend-new --- this works, but I cannot estimate how clean or dirty that is :) P.S.: my system (although I don't think this is important): distribution name: Net::XMPP 1.0 perl version: 5.8.8 uname -a: Linux mms2 2.6.17 #1 SMP PREEMPT Wed Aug 30 17:44:42 CEST 2006 i686 GNU/Linux
From: peter [...] hartmann.org
sorry, that was an error of mine. bug is resolved, or better, has never been one... On Fr. 22. Sep. 2006, 03:47:02, piotr_h wrote: Show quoted text
> I had problems sending a message by passing a Net::XMPP::Message object > to the MessageSend() function in Protocol.pm. Sending a message by > passing the arguments directly to MessageSend(), however, worked: > > executing > > > $Connection->Connect(...); > ... > $Connection->MessageSend('to' -> 'user@server', > 'body' -> 'my message'); > > > works fine, but > > > $Connection->Connect(...); > ... > my $chatMessage = Net::XMPP::Message->new(); > $chatMessage->SetMessage('to' -> 'user@server', > 'body' -> 'my message'); > $Connection->MessageSend($chatMessage); > > > did not send anything. I think the problem in the MessageSend function > in Protocol.pm is that $mess is constructed by executing "$mess = > $self->_message();" and "$mess->SetMessage(@_);" although the message is > already constructed and ready to be sent. > I altered the function to: > > --- MessageSend-new in Net/XMPP/Protocol.pm --- > > sub MessageSend > { > my $self = shift; > > my $mess; > if(ref($_[0]) eq "") { > $mess = $self->_message(); > $mess->SetMessage(@_); > } else { > $mess = shift; > } > $self->Send($mess); > } > > --- end of MessageSend-new --- > > this works, but I cannot estimate how clean or dirty that is :) > > P.S.: > my system (although I don't think this is important): > distribution name: Net::XMPP 1.0 > perl version: 5.8.8 > uname -a: Linux mms2 2.6.17 #1 SMP PREEMPT Wed Aug 30 17:44:42 CEST 2006 > i686 GNU/Linux
Okay, glad you got it sorted out Peter.  Send() accepts a Next::XMPP::Message object.  MessageSend() accepts a hash.

Darian

On Tue Sep 26 09:30:02 2006, piotr_h wrote:
Show quoted text
> sorry, that was an error of mine.
> bug is resolved, or better, has never been one...
>
>
> On Fr. 22. Sep. 2006, 03:47:02, piotr_h wrote:
> > I had problems sending a message by passing a Net::XMPP::Message object
> > to the MessageSend() function in Protocol.pm. Sending a message by
> > passing the arguments directly to MessageSend(), however, worked:
> >
> > executing
> >
> >
> > $Connection->Connect(...);
> > ...
> > $Connection->MessageSend('to' -> 'user@server',
> > 'body' -> 'my message');
> >
> >
> > works fine, but
> >
> >
> > $Connection->Connect(...);
> > ...
> > my $chatMessage = Net::XMPP::Message->new();
> > $chatMessage->SetMessage('to' -> 'user@server',
> > 'body' -> 'my message');
> > $Connection->MessageSend($chatMessage);
> >
> >
> > did not send anything. I think the problem in the MessageSend function
> > in Protocol.pm is that $mess is constructed by executing "$mess =
> > $self->_message();" and "$mess->SetMessage(@_);" although the message is
> > already constructed and ready to be sent.
> > I altered the function to:
> >
> > --- MessageSend-new in Net/XMPP/Protocol.pm ---
> >
> > sub MessageSend
> > {
> > my $self = shift;
> >
> > my $mess;
> > if(ref($_[0]) eq "") {
> > $mess = $self->_message();
> > $mess->SetMessage(@_);
> > } else {
> > $mess = shift;
> > }
> > $self->Send($mess);
> > }
> >
> > --- end of MessageSend-new ---
> >
> > this works, but I cannot estimate how clean or dirty that is :)
> >
> > P.S.:
> > my system (although I don't think this is important):
> > distribution name: Net::XMPP 1.0
> > perl version: 5.8.8
> > uname -a: Linux mms2 2.6.17 #1 SMP PREEMPT Wed Aug 30 17:44:42 CEST 2006
> > i686 GNU/Linux
>