Sample Plugin

Mark Doliner mark at kingant.net
Wed Jul 18 14:02:39 EDT 2007


On Wed, 18 Jul 2007 13:31:52 +0200, Markus Zuercher wrote
> > You may have figured this out already, but are you changing accounts.xml and
> > then you want Pidgin to reload it?  If so, that's not really a good idea.  You
> > should just tell Pidgin to create a new account (or modify an existing
> > account, or whatever) and let Pidgin take care of writing it to accounts.xml.
> 
> I'd love to, but I don't know yet how to use the libpurple functions.
> 
> I just want to know how I can change an account's buddy icon. I saw
> that Pidgin creates a *.png file with an md5 hash as file name. I 
> want to set a picture in the Plugin, and the plugin calls the corresponding
> libpurple function to change that picture.
> 
> In buddyicon.h, I found the following function:
> 
> purple_buddy_icons_set_for_user(PurpleAccount *account, const char 
> *username,                                void *icon_data, size_t 
> icon_len,                                const char *checksum);
> 
> Can anyone pls give me an example so I can understand how it's made? 
> I don't know what *account is, I thought it was like 
> "mymsnaccount at hotmail.com", but why the username?
> 
> Thank you!

I think you want purple_account_set_buddy_icon_path(PurpleAccount *account,
const char *filename);

You'll have to look up the account based on the user name and protocol.  And I
don't know if the filename should be anything special.

-Mark




More information about the Devel mailing list