Perl API - send an IM
pidgin at unreliablesource.net
Tue Jul 10 23:02:21 EDT 2007
On Mon, Jul 09, 2007 at 03:35:59PM -0400, Greg Chagnon wrote:
> $account = Purple::Accounts::find($account_name, $protocol);
> $conv1 = Purple::Conversation->new(1, $account, "Test Conversation 1");
> $im = $conv1->get_im_data();
> $im->send("Message Test.");
> Should $account_name be the account that I want to send the IM to? Or is
> that who it's from?
As I'm certain I've told you before the 'name' of the conversation is the
buddy with whom you are having the conversation. The account is the local
account you are having the conversation with.
So to have a conversation from your yahoo account 'account1' with buddy
'yahoo_buddy_1' you would Purple::Accounts::find('account1', 'prpl-yahoo')
and then Purple::Conversation->new(1, $account, 'yahoo_buddy_1').
More information about the Devel