Description:
Emitted when a chat message is received. The callback can replace the name of the sender, the message, or the flags by modifying the pointer to the strings. This can also be used to cancel displaying a message by returning TRUE.
I would like to replace the message using a perl plugin, but my Perl syntax knowledge is really weak. I can create a working plugin and capture the message from the call back, but the altering the message part so that it appears in Pidgin is giving me trouble.
The basic callback would look like this:
sub receiving_chat_msg_cb {
my ($account, $sender, $message, $conv, $flag) = @_;
Purple::Debug::info("testplugin", "$sender : $message");
}
What would I need to do to alter the message?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Description:
Emitted when a chat message is received. The callback can replace the name of the sender, the message, or the flags by modifying the pointer to the strings. This can also be used to cancel displaying a message by returning TRUE.
I would like to replace the message using a perl plugin, but my Perl syntax knowledge is really weak. I can create a working plugin and capture the message from the call back, but the altering the message part so that it appears in Pidgin is giving me trouble.
The basic callback would look like this:
sub receiving_chat_msg_cb {
my ($account, $sender, $message, $conv, $flag) = @_;
Purple::Debug::info("testplugin", "$sender : $message");
}
What would I need to do to alter the message?
I believe you just need to change the correct items in @_, so something like $_[2] = "foobar";.
Thanks, that was exactly what I needed. I thought it was an array but wasn't sure of the syntax.
I looked it up, PERL sure is full of lazy catch-all variables.