Autochange Buddy Icon

Mark Doliner mark at kingant.net
Wed Jan 23 02:41:18 EST 2008


On Wed, 23 Jan 2008 00:38:56 +0100, Matteo Landi wrote
> Hi all 
> i'm trying to develope a simple plugin that ask the user for a path,
> and 
> every 10secs (it could be dynamically set), change the buddy icon!
> 
> 1) the first approach was to modify the config file located in 
> ~/.purple; no usefull solution; in fact i imagine that the file is 
> used @ startup, so changing something inside of it, will not 
> generate any change!

That is correct.

> 2) so i decided to take a look at the pidgin source, and maybe i 
> found the function i gotta use: 
> purple_account_set_buddy_icon_path(PurpleAccount *account, const 
> char *path)! Is this the correct function? If so, i have also to 
> find the current account id isn't it?

There are two functions that deal with setting the icon for an account. 
purple_account_set_buddy_icon_path() saves the path to the icon in your
~/.purple/accounts.xml file.  The other function,
purple_buddy_icons_set_account_icon(), actually sends the icon data to the
appropriate protocol plugin so that all your buddies will see it.

You probably want to call the latter function.  You may or may not want to
call the former function.  See pidgin/gtkaccount.c for example usage, and see
http://developer.pidgin.im/doxygen/ for some documentation.  You can use
purple_accounts_find() to look up the appropriate PurpleAccount.

-Mark




More information about the Devel mailing list