[Pidgin] #1393: perl: modifying message in "received-im-msg" callback not working

Pidgin trac at pidgin.im
Tue May 29 19:39:54 EDT 2007


#1393: perl: modifying message in "received-im-msg" callback not working
----------------------------------+-----------------------------------------
 Reporter:  kbolay                |       Type:  defect
   Status:  new                   |   Priority:  minor 
Component:  libpurple             |    Version:  2.0.1 
 Keywords:  perl received-im-msg  |    Pending:  0     
----------------------------------+-----------------------------------------
 I'm trying to write a plugin using the Perl API which modifies message
 content. I'm registering a call-back function using:


 {{{
     Purple::Signal::connect($conv, "received-im-msg", $plugin,
                             \&conv_received_msg, "received im message");

 }}}

 The callback is simple:


 {{{
 sub conv_received_msg {
     my ($account, $sender, $message, $conv, $flags, $data) = @_;

     my $modified_message = "modified! original :'$message'";
     Purple::Debug::info("conv_received_msg()", "trying to modify
 '$message'");
     $_[2] = $modified_message;
     return 0;
 }
 }}}


 Unfortunately the message that gets to the chat window is unchanged. Is
 this a bug or am I using the API wrong?

-- 
Ticket URL: <http://developer.pidgin.im/ticket/1393>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list