Autochange Buddy Icon

Matteo Landi matteo.landi at email.it
Wed Jan 23 19:09:45 EST 2008


well
first of all thanks for the answer! now the things i gonna do are more
clear that yesterday!
Actually the plugin i developed does nothing interesting, but the fact
that it simply "runs" is just a goal!
I implemented the scandir function, and before i was lookink in the
account.h file in order to find the functions for catching the current
account; here is the plan:
1)purple_accounts_get_all for a list of all the accounts registered
2)purple_account_get_active_status or purple_account_is_connected (which
one is better?) for the discovering of the account which activated the
plugin
3)purple_buddy_icons_set_custom_icon for the renewal of the buddy icon.

what do you think about that? tomorrow i'll try it, now it's better for
me to go to sleep!
Tnx in advance

M@

Ps. what about the second and the third params fo the
purple_buddy_icons_set_custom_icon (guchar *icon_data, size_t icon_len)?
how could i discover them from the pathname? .. well using the stat lib
the size is not so hard to discover, but what about the GUCHAR *? 

On Wed, 2008-01-23 at 02:41 -0500, Mark Doliner wrote:
> 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