IM Chat using Perl

Daniel Atallah daniel.atallah at gmail.com
Mon Mar 14 12:23:00 EDT 2011


On Mon, Mar 14, 2011 at 10:54, Gabor Szabo <szabgab at gmail.com> wrote:
> On Mon, Mar 14, 2011 at 3:54 PM, Gabor Szabo <szabgab at gmail.com> wrote:
>> Using the signals-test.pl example in the Pidgin distribution I can now
>> get a signal when someone sends me an IM.
>>
>> Unfortunately I have not yet figured out how to send an IM.
>> Neither as a response to the received IM message nor as an initiated IM.
>>
>> The signal handler looks like this:
>>
>> sub conv_received_msg
>> {
>>        my ($account, $sender, $message, $conv, $flags, $data) = @_;
>> ...
>> }
>>
>> From the $account  I can get the connection object using
>>
>> my $con = $account->get_connection;
>>
>> but I am not sure how to go on.
>>
>> Your help would be appreciated.
>>
>> Gabor
>
> I was expecting $conv to hold the Purple::Conversation object but it is undef.

For the first message, the Purple::Conversation doesn't exist yet.

If you can tie into the Pidgin signals, you can use displaying-im-message:

http://developer.pidgin.im/doxygen/2.7.11/html/gtkconv-signals.html#displaying-im-msg

>
> Also when following the example in
> http://developer.pidgin.im/doxygen/dev/html/perl-howto.html under
> "Conversation API" I don't see where the IM is connected to a buddy. I
> tried to run that code but it seems to just talk locally.
>
> Gabor
>
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>




More information about the Devel mailing list