From: Evan S. <ev...@dr...> - 2006-12-07 19:36:09
|
On Dec 7, 2006, at 2:17 PM, Sean Egan wrote: >> oscar_encoding_extract() is useful for a plugin or UI doing oscar >> prpl specific things, such as getting a contact's profile directly >> (rather than the full formatted info text sent to >> gaim_notify_userinfo()). Removed the static so it can be used >> elsewhere. > > As a rule, we generally don't like non-static functions in prpls other > than plugin_init. When you say "used elsewhere." > Ah. I figured it was okay because many of the other functions in oscar.c are also non-static; for example, just below it is gchar * oscar_encoding_to_utf8(const char *encoding, const char *text, int textlen) > A much better approach would be an abstracted "get info" function that > doesn't spawn UI. The problem is not spawning of UI -- I'm actually using the notify_userinfo() callback which gtk gaim uses to spawn UI to be notified that the information is available and associate it with the contact. The problem is that I wanted direct access to the profile information without the full Screenname: someguy Warning Level: 0% Away message: yadda profile: blah string... What if rather than returning a string from the get info function, an array of objects were returned each of which specified a label and a string? The UI could then assemble the information in any way it wanted.... and a plugin (or picky UI) knowing what it's looking for could get specific information out easily. -Evan |