GNOME Bugzilla – Bug 490551
Use purple_signal_register to avoid polling for blist changes
Last modified: 2008-04-21 14:01:51 UTC
The pidgin plugin is continously doing something... it doesn't seem to be right. See debug window screesnhot
Created attachment 97926 [details] Screenshot
It's working fine, that's what happens when there's no changes in the buddy list. There doesn't seem to be any way to do this without polling, as the Purple API doesn't provide any signals or callback functions for when the buddy list changes. Please report this as a bug against libpurple, we'll make the necessary changes when the API exists.
Bastien, can you please have a look here: http://developer.pidgin.im/ticket/4692 Is this enough? Or does nautilus-sendto need more?
I would have expected a signal on the PurpleBuddyList object, but I just noticed they aren't objects, so they suck boatloads. "buddy-signed-on" and "buddy-signed-off" would do, although the Pidgin developers should take a look at using the GObject signals, rather than reinventing the wheel with undocumented functions such as purple_signal_register().
For the record the purple_signal_register function is not undocumented, it is documented (and has always been documented) in the pidgin API documentation. Documentation, I might add, one would need to read to create a pidgin plugin to begin with. Furthermore, pidgin cannot just use GObject signals since, as you noticed, pidgin and purple objects are not (for the most part) GObjects. The plan is to move to using GObjects and thus gain the ability to use GObject signals but that is not a move that can be made swiftly or easily. I realize I am joining this party a bit late but I felt this needed commenting on.
Sorry I didn't find the API docs myself, the doxygen documentation sucks when you're used to the gtk-doc formatted ones. Docs: http://developer.pidgin.im/doxygen/2.2.0/html/blist-signals.html http://developer.pidgin.im/doxygen/dev/html/signals_8h.html#2c37dfb3566c3d84335d6db3d9a8cb90
I'm not particularly familiar with gtk-doc formatting so I am unable to comment on the relative merits of the two formats, I am however aware of the fact that our api search functions are broken at best (if not entirely useless) which is something we would like to fix but which none of us has invested any time in actually fixing (that I'm aware of). My intention was not to sound angry or insulting, just to point out some details that might otherwise have gone unnoticed.
2008-04-21 Bastien Nocera <hadess@hadess.net> * pidgin_plugin/nautilus-sendto-plugin.c (save_online_buddies), (plugin_load), (plugin_unload): Register to the changes in the buddy list instead of loading it every 5 seconds (Closes: #490551)