responding to IM's with a plugin

Etan Reisner pidgin at unreliablesource.net
Mon Mar 3 11:46:46 EST 2008


On Sun, Mar 02, 2008 at 11:09:53AM -0600, Michael wrote:
> I'm having difficulty responding to received IM's using a plugin.  I was
> wondering if anyone has an example or sending a response based on what is
> received.  I happen to be using Perl but would welcome a C example as well.
> 
> The problem is that the received message has a $conv element that appears to be
> null.  If it wasn't null, I could just do the following in the received IM callback:
> 
> sub newmessage_cb
> {
>      my ($account, $sender, $message, $conv, $flags, $data) = @_;
> 
>      ...
> 
>      $im = $conv->get_im_data();
>      $im->send("Message Test.");
> }
> 
> Again, unfortunately $conv appears to be null upon receiving a message even
> though the $sender and $message appear to be valid.  I cannot seem to find
> another way to get the $im (or PurpleConvIm *im).
> 
> Thanks in advance for the help,
> Michael

Are you trying to do this in reposonse to the very first IM in a
conversation? If you are then the conversation in fact doesn't exist yet
and you can either use a later signal or create the conversation yourself
and then use it.

    -Etan




More information about the Devel mailing list