You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ev...@us...> - 2006-12-10 03:01:45
|
Revision: 17933 http://svn.sourceforge.net/gaim/?rev=17933&view=rev Author: evands Date: 2006-12-09 19:01:42 -0800 (Sat, 09 Dec 2006) Log Message: ----------- I answered my own question. Modified Paths: -------------- trunk/gtk/gtkblist.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-10 02:58:30 UTC (rev 17932) +++ trunk/gtk/gtkblist.c 2006-12-10 03:01:42 UTC (rev 17933) @@ -2600,11 +2600,9 @@ } else if (GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_BUDDY(node)) { - /* NOTE: THIS FUNCTION IS NO LONGER CALLED FOR CONTACTS - * See create_tip_for_node(). - * - * create_tip_for_node() calls this function - what does the above mean? -evands */ - + /* NOTE: THIS FUNCTION IS NO LONGER CALLED FOR CONTACTS. + * It is only called by create_tip_for_node(), and create_tip_for_node() is never called for a contact. + */ GaimContact *c; GaimBuddy *b; GaimPresence *presence; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-10 02:58:30
|
Revision: 17932 http://svn.sourceforge.net/gaim/?rev=17932&view=rev Author: evands Date: 2006-12-09 18:58:30 -0800 (Sat, 09 Dec 2006) Log Message: ----------- API Changelog for [17929] Modified Paths: -------------- trunk/ChangeLog.API Modified: trunk/ChangeLog.API =================================================================== --- trunk/ChangeLog.API 2006-12-10 02:54:26 UTC (rev 17931) +++ trunk/ChangeLog.API 2006-12-10 02:58:30 UTC (rev 17932) @@ -84,8 +84,8 @@ * GaimPluginProtocolInfo: Added offline_message * GaimPluginProtocolInfo: Added whiteboard_prpl_ops * GaimPluginProtocolInfo: Added media_prpl_ops - * GaimPluginProtocolInfo: Added "str" argument to tooltip_text, changed - the return type to void + * GaimPluginProtocolInfo: Added "user_info" argument to tooltip_text, + changed the return type to void * GaimPluginProtocolInfo: Added "full" argument to tooltip_text * gaim_pounce_new(): Added option argument for pounce options * gaim_network_listen() and gaim_network_listen_range(): Added @@ -100,6 +100,7 @@ * Smiley Themes: Backslashes must be backslash-escaped. * Plugins: Depedencies are now honored when unloading plugins. * gaim_markup_extract_info_field(): Added format_cb parameter. + * gaim_markup_extract_info_field(): Changed GString parameter to a GaimNotifyUserInfo paramter. * gaim_str_to_time(): Added support for parsing the MM/DD/YYYY format. * gaim_plugin_action_new(): label is now const char * * gaim_plugin_pref_new_with_name(): name is now const char * @@ -144,6 +145,8 @@ * gaim_gtk_set_custom_buddy_icon() sets custom icon for a user. * Hid the definition of _GaimStringref, which already had a warning to avoid accessing it directly. + * notify_userinfo() UI op is passed a GaimNotifyUserInfo instead of a char* + for the user information Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute @@ -510,7 +513,8 @@ * Renamed: show_confirm_del_contact to gaim_gtkdialogs_remove_contact * Renamed: show_about to gaim_gtkdialogs_about * Added: gaim_notify_userinfo() and the associated notify_userinfo() UI op - (someone who knows just why we have this can edit here) + which pass account and contact information associated with the + userinfo Buddy List API: * Changed: gaim_blist_request_add_chat(), added name parameter This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-10 02:54:26
|
Revision: 17931 http://svn.sourceforge.net/gaim/?rev=17931&view=rev Author: evands Date: 2006-12-09 18:54:26 -0800 (Sat, 09 Dec 2006) Log Message: ----------- gntgaim changes for GaimNotifyUserInfo introduced in [17929] Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntnotify.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-12-10 02:53:54 UTC (rev 17930) +++ trunk/console/gntblist.c 2006-12-10 02:54:26 UTC (rev 17931) @@ -1148,29 +1148,27 @@ GaimPlugin *prpl; GaimPluginProtocolInfo *prpl_info; GaimAccount *account; + GaimNotifyUserInfo *user_info; const char *alias = gaim_buddy_get_alias(buddy); + char *tmp, *strip; + user_info = gaim_notify_user_info_new(); + account = gaim_buddy_get_account(buddy); if (g_utf8_collate(gaim_buddy_get_name(buddy), alias)) - g_string_append_printf(str, _("Nickname: %s\n"), alias); - g_string_append_printf(str, _("Account: %s (%s)"), + gaim_notify_user_info_add_pair(user_info, _("Nickname"), alias); + + tmp = g_strdup_printf("%s (%s)", gaim_account_get_username(account), gaim_account_get_protocol_name(account)); + gaim_notify_user_info_add_pair(user_info, _("Account"), tmp); + g_free(tmp); prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); if (prpl_info && prpl_info->tooltip_text) { - GString *tip = g_string_new(""); - char *strip, *br; - prpl_info->tooltip_text(buddy, tip, TRUE); - - br = gaim_strreplace(tip->str, "\n", "<br>"); - strip = gaim_markup_strip_html(br); - g_string_append(str, strip); - g_string_free(tip, TRUE); - g_free(strip); - g_free(br); + prpl_info->tooltip_text(buddy, user_info, TRUE); } if (gaim_prefs_get_bool("/gaim/gnt/blist/idletime")) { @@ -1179,11 +1177,19 @@ time_t idle = gaim_presence_get_idle_time(pre); if (idle > 0) { char *st = gaim_str_seconds_to_string(time(NULL) - idle); - g_string_append_printf(str, _("\nIdle: %s"), st); + gaim_notify_user_info_add_pair(user_info, _("Idle"), st); g_free(st); } } } + + tmp = gaim_notify_user_info_get_text_with_newline(user_info, "\n"); + gaim_notify_user_info_destroy(user_info); + + strip = gaim_markup_strip_html(tmp); + g_string_append(str, strip); + g_free(strip); + g_free(tmp); } static GString* Modified: trunk/console/gntnotify.c =================================================================== --- trunk/console/gntnotify.c 2006-12-10 02:53:54 UTC (rev 17930) +++ trunk/console/gntnotify.c 2006-12-10 02:54:26 UTC (rev 17931) @@ -220,14 +220,17 @@ } static void * -gg_notify_userinfo(GaimConnection *gc, const char *who, const char *text) +gg_notify_userinfo(GaimConnection *gc, const char *who, GaimNotifyUserInfo *user_info) { /* Xeroxed from gtknotify.c */ char *primary; + char *info; void *ui_handle; - + primary = g_strdup_printf(_("Info for %s"), who); - ui_handle = gg_notify_formatted(_("Buddy Information"), primary, NULL, text); + info = gaim_notify_user_info_get_text_with_newline(user_info, "\n"); + ui_handle = gg_notify_formatted(_("Buddy Information"), primary, NULL, info); + g_free(info); g_free(primary); return ui_handle; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-10 02:53:56
|
Revision: 17930 http://svn.sourceforge.net/gaim/?rev=17930&view=rev Author: evands Date: 2006-12-09 18:53:54 -0800 (Sat, 09 Dec 2006) Log Message: ----------- gtkgaim changes for GaimNotifyUserInfo introduced in [17929] Modified Paths: -------------- trunk/gtk/gtkblist.c trunk/gtk/gtknotify.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-10 02:53:09 UTC (rev 17929) +++ trunk/gtk/gtkblist.c 2006-12-10 02:53:54 UTC (rev 17930) @@ -2601,11 +2601,14 @@ else if (GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_BUDDY(node)) { /* NOTE: THIS FUNCTION IS NO LONGER CALLED FOR CONTACTS - * See create_tip_for_node(). */ + * See create_tip_for_node(). + * + * create_tip_for_node() calls this function - what does the above mean? -evands */ GaimContact *c; GaimBuddy *b; GaimPresence *presence; + GaimNotifyUserInfo *user_info; char *tmp; time_t idle_secs, signon; @@ -2627,15 +2630,17 @@ /* Buddy Name */ tmp = g_markup_escape_text(gaim_buddy_get_name(b), -1); - g_string_append_printf(str, "<span size='larger' weight='bold'>%s</span>", tmp); + g_string_append_printf(str, "<span size='larger' weight='bold'>%s</span>\n", tmp); g_free(tmp); + user_info = gaim_notify_user_info_new(); + /* Account */ if (full && g_list_length(gaim_connections_get_all()) > 1) { tmp = g_markup_escape_text(gaim_account_get_username( gaim_buddy_get_account(b)), -1); - g_string_append_printf(str, _("\n<b>Account:</b> %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Account"), tmp); g_free(tmp); } @@ -2647,7 +2652,7 @@ strcmp(c->alias, b->alias) != 0) { tmp = g_markup_escape_text(b->alias, -1); - g_string_append_printf(str, _("\n<b>Buddy Alias:</b> %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Buddy Alias"), tmp); g_free(tmp); } @@ -2659,7 +2664,7 @@ if (full && b->server_alias != NULL && b->server_alias[0] != '\0') { tmp = g_markup_escape_text(b->server_alias, -1); - g_string_append_printf(str, _("\n<b>Nickname:</b> %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Nickname"), tmp); g_free(tmp); } @@ -2668,7 +2673,7 @@ if (full && GAIM_BUDDY_IS_ONLINE(b) && signon > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - signon); - g_string_append_printf(str, _("\n<b>Logged In:</b> %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Logged In"), tmp); g_free(tmp); } @@ -2679,7 +2684,7 @@ if (idle_secs > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - idle_secs); - g_string_append_printf(str, _("\n<b>Idle:</b> %s"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Idle"), tmp); g_free(tmp); } } @@ -2714,7 +2719,7 @@ if (lastseen > 0) { tmp = gaim_str_seconds_to_string(time(NULL) - lastseen); - g_string_append_printf(str, _("\n<b>Last Seen:</b> %s ago"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Last Seen"), tmp); g_free(tmp); } } @@ -2723,22 +2728,28 @@ /* Offline? */ /* FIXME: Why is this status special-cased by the core? -- rlaager */ if (!GAIM_BUDDY_IS_ONLINE(b)) { - g_string_append_printf(str, _("\n<b>Status:</b> Offline")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Offline")); } if (prpl_info && prpl_info->tooltip_text) { /* Additional text from the PRPL */ - prpl_info->tooltip_text(b, str, full); + prpl_info->tooltip_text(b, user_info, full); } /* These are Easter Eggs. Patches to remove them will be rejected. */ if (!g_ascii_strcasecmp(b->name, "robflynn")) - g_string_append(str, _("\n<b>Description:</b> Spooky")); + gaim_notify_user_info_add_pair(user_info, _("Description"), _("Spooky")); if (!g_ascii_strcasecmp(b->name, "seanegn")) - g_string_append(str, _("\n<b>Status:</b> Awesome")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Awesome")); if (!g_ascii_strcasecmp(b->name, "chipx86")) - g_string_append(str, _("\n<b>Status:</b> Rockin'")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Rockin'")); + + tmp = gaim_notify_user_info_get_text_with_newline(user_info, "\n"); + g_string_append(str, tmp); + g_free(tmp); + + gaim_notify_user_info_destroy(user_info); } gaim_signal_emit(gaim_gtk_blist_get_handle(), Modified: trunk/gtk/gtknotify.c =================================================================== --- trunk/gtk/gtknotify.c 2006-12-10 02:53:09 UTC (rev 17929) +++ trunk/gtk/gtknotify.c 2006-12-10 02:53:54 UTC (rev 17930) @@ -841,13 +841,15 @@ static void * gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who, - const char *text) + GaimNotifyUserInfo *user_info) { - char *primary; + char *primary, *info; void *ui_handle; primary = g_strdup_printf(_("Info for %s"), who); - ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, text); + info = gaim_notify_user_info_get_text_with_newline(user_info, "<br />"); + ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, info); + g_free(info); g_free(primary); return ui_handle; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-10 02:53:12
|
Revision: 17929 http://svn.sourceforge.net/gaim/?rev=17929&view=rev Author: evands Date: 2006-12-09 18:53:09 -0800 (Sat, 09 Dec 2006) Log Message: ----------- User Info and Tooltips now use the GaimNotifyUserInfo object and methods defined in notify.h. GaimNotifyUserInfo objects encapsulate a list of GaimNotifyUserInfoEntry objects, each of which may have a label, a value, and be specified to be a section header. This moves the burden of UI generation of user information from the various prpls to the UI. The UI can choose how to display the information rather than being fenced into a particular HTML formatting. Consistency across the prpls' information presentation is now enforced, as well. gaim_notify_user_info_get_text_with_newline() generates text in the: <b>label</b>: value <b>label</b>: value format as was passed by convention from prpls in the past. Modified Paths: -------------- trunk/libgaim/notify.c trunk/libgaim/notify.h trunk/libgaim/protocols/gg/gg.c trunk/libgaim/protocols/irc/msgs.c trunk/libgaim/protocols/jabber/buddy.c trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/msn/msn.c trunk/libgaim/protocols/novell/novell.c trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/oscar/oscarcommon.h trunk/libgaim/protocols/qq/buddy_info.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/sametime/sametime.c trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/yahoo.h trunk/libgaim/protocols/yahoo/yahoo_profile.c trunk/libgaim/protocols/zephyr/zephyr.c trunk/libgaim/prpl.h trunk/libgaim/util.c trunk/libgaim/util.h Modified: trunk/libgaim/notify.c =================================================================== --- trunk/libgaim/notify.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/notify.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -36,6 +36,21 @@ gpointer cb_user_data; } GaimNotifyInfo; +/** + * Definition of a user info entry + */ +struct _GaimNotifyUserInfoEntry +{ + char *label; + char *value; + gboolean is_header; +}; + +struct _GaimNotifyUserInfo +{ + GList *user_info_entries; +}; + void * gaim_notify_message(void *handle, GaimNotifyMsgType type, const char *title, const char *primary, @@ -416,7 +431,7 @@ void * gaim_notify_userinfo(GaimConnection *gc, const char *who, - const char *text, GaimNotifyCloseCallback cb, gpointer user_data) + GaimNotifyUserInfo *user_info, GaimNotifyCloseCallback cb, gpointer user_data) { GaimNotifyUiOps *ops; @@ -426,21 +441,18 @@ if (ops != NULL && ops->notify_userinfo != NULL) { GaimNotifyInfo *info; - char *infotext = g_strdup(text); info = g_new0(GaimNotifyInfo, 1); info->type = GAIM_NOTIFY_USERINFO; info->handle = gc; gaim_signal_emit(gaim_notify_get_handle(), "displaying-userinfo", - gaim_connection_get_account(gc), who, &infotext); + gaim_connection_get_account(gc), who, user_info); - info->ui_handle = ops->notify_userinfo(gc, who, infotext); + info->ui_handle = ops->notify_userinfo(gc, who, user_info); info->cb = cb; info->cb_user_data = user_data; - g_free(infotext); - if (info->ui_handle != NULL) { handles = g_list_append(handles, info); @@ -463,6 +475,158 @@ return NULL; } +static GaimNotifyUserInfoEntry * +gaim_notify_user_info_entry_new(const char *label, const char *value) +{ + GaimNotifyUserInfoEntry *user_info_entry; + + user_info_entry = g_new0(GaimNotifyUserInfoEntry, 1); + user_info_entry->label = g_strdup(label); + user_info_entry->value = g_strdup(value); + user_info_entry->is_header = FALSE; + + return user_info_entry; +} + +static void +gaim_notify_user_info_entry_destroy(GaimNotifyUserInfoEntry *user_info_entry) +{ + g_return_if_fail(user_info_entry != NULL); + + g_free(user_info_entry->label); + g_free(user_info_entry->value); + g_free(user_info_entry); +} + +GaimNotifyUserInfo * +gaim_notify_user_info_new() +{ + GaimNotifyUserInfo *user_info; + + user_info = g_new0(GaimNotifyUserInfo, 1); + user_info->user_info_entries = NULL; + + return user_info; +} + +void +gaim_notify_user_info_destroy(GaimNotifyUserInfo *user_info) +{ + GList *l; + + for (l = user_info->user_info_entries; l != NULL; l = l->next) { + GaimNotifyUserInfoEntry *user_info_entry = l->data; + + gaim_notify_user_info_entry_destroy(user_info_entry); + } + + g_list_free(user_info->user_info_entries); +} + +GList * +gaim_notify_user_info_get_entries(GaimNotifyUserInfo *user_info) +{ + g_return_val_if_fail(user_info != NULL, NULL); + + return user_info->user_info_entries; +} + +char * +gaim_notify_user_info_get_text_with_newline(GaimNotifyUserInfo *user_info, const char *newline) +{ + GList *l; + GString *text; + + text = g_string_new(""); + + for (l = user_info->user_info_entries; l != NULL; l = l->next) { + GaimNotifyUserInfoEntry *user_info_entry = l->data; + if (user_info_entry->is_header) + g_string_append(text, newline); + + if (user_info_entry->label) + g_string_append_printf(text, "<b>%s</b>", user_info_entry->label); + if (user_info_entry->label && user_info_entry->value) + g_string_append(text, ": "); + if (user_info_entry->value) + g_string_append(text, user_info_entry->value); + + if (user_info_entry->is_header) + g_string_append(text, newline); + + if (l->next) + g_string_append(text, newline); + } + + return g_string_free(text, FALSE); +} + + +gchar * +gaim_notify_user_info_entry_get_label(GaimNotifyUserInfoEntry *user_info_entry) +{ + g_return_val_if_fail(user_info_entry != NULL, NULL); + + return user_info_entry->label; +} + +gchar * +gaim_notify_user_info_entry_get_value(GaimNotifyUserInfoEntry *user_info_entry) +{ + g_return_val_if_fail(user_info_entry != NULL, NULL); + + return user_info_entry->value; +} + +void +gaim_notify_user_info_add_pair(GaimNotifyUserInfo *user_info, const char *label, const char *value) +{ + GaimNotifyUserInfoEntry *entry; + + entry = gaim_notify_user_info_entry_new(label, value); + user_info->user_info_entries = g_list_append(user_info->user_info_entries, entry); +} + +void +gaim_notify_user_info_prepend_pair(GaimNotifyUserInfo *user_info, const char *label, const char *value) +{ + GaimNotifyUserInfoEntry *entry; + + entry = gaim_notify_user_info_entry_new(label, value); + user_info->user_info_entries = g_list_prepend(user_info->user_info_entries, entry); +} + +void +gaim_notify_user_info_add_section_header(GaimNotifyUserInfo *user_info, const char *label) +{ + GaimNotifyUserInfoEntry *entry; + + entry = gaim_notify_user_info_entry_new(label, NULL); + entry->is_header = TRUE; + + user_info->user_info_entries = g_list_append(user_info->user_info_entries, entry); +} + +/** + * Remove the last item which was added to user_info + * This is helpful for removing a section header if the section was empty. + */ +void +gaim_notify_user_info_remove_last_item(GaimNotifyUserInfo *user_info) +{ + user_info->user_info_entries = g_list_remove(user_info->user_info_entries, + g_list_last(user_info->user_info_entries)->data); +} + +void +gaim_notify_user_info_add_section_break(GaimNotifyUserInfo *user_info) +{ + /* This is for future expansion; section breaks should be marked as such so the UI + * can format them differently if desired. + */ + gaim_notify_user_info_add_pair(user_info, NULL, "<HR>"); +} + void * gaim_notify_uri(void *handle, const char *uri) { Modified: trunk/libgaim/notify.h =================================================================== --- trunk/libgaim/notify.h 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/notify.h 2006-12-10 02:53:09 UTC (rev 17929) @@ -29,9 +29,11 @@ #include <glib-object.h> #include <glib.h> +typedef struct _GaimNotifyUserInfoEntry GaimNotifyUserInfoEntry; +typedef struct _GaimNotifyUserInfo GaimNotifyUserInfo; + #include "connection.h" - /** * Notification close callbacks. */ @@ -154,7 +156,7 @@ void *data); void *(*notify_userinfo)(GaimConnection *gc, const char *who, - const char *text); + GaimNotifyUserInfo *user_info); void *(*notify_uri)(const char *uri); @@ -403,20 +405,113 @@ * The text is essentially a stripped-down format of HTML, the same that * IMs may send. * - * @param gc The GaimConnection handle associated with the information. - * @param who The username associated with the information. - * @param text The formatted text. - * @param cb The callback to call when the user closes - * the notification. - * @param user_data The data to pass to the callback. + * @param gc The GaimConnection handle associated with the information. + * @param who The username associated with the information. + * @param user_info The GaimNotifyUserInfo which contains the information + * @param cb The callback to call when the user closes + * the notification. + * @param user_data The data to pass to the callback. * * @return A UI-specific handle. */ void *gaim_notify_userinfo(GaimConnection *gc, const char *who, - const char *text, GaimNotifyCloseCallback cb, + GaimNotifyUserInfo *user_info, GaimNotifyCloseCallback cb, gpointer user_data); /** + * Create a new GaimNotifyUserInfo which is suitable for passing to gaim_notify_userinfo() + * + * @return A new GaimNotifyUserInfo, which the caller must destroy when done + */ +GaimNotifyUserInfo *gaim_notify_user_info_new(); + +/** + * Destroy a GaimNotifyUserInfo + * + * @param user_info The GaimNotifyUserInfo + */ +void gaim_notify_user_info_destroy(GaimNotifyUserInfo *user_info); + +/** + * Retrieve the array of GaimNotifyUserInfoEntry objects from a GaimNotifyUserInfo + * + * @param user_info The GaimNotifyUserInfo + * + * @result A GList of GaimNotifyUserInfoEntry objects + */ +GList *gaim_notify_user_info_get_entries(GaimNotifyUserInfo *user_info); + +/** + * Create a textual representation of a GaimNotifyUserInfo, separating entries with newline + * + * @param user_info The GaimNotifyUserInfo + * @param newline The separation character + */ +char *gaim_notify_user_info_get_text_with_newline(GaimNotifyUserInfo *user_info, const char *newline); + +/** + * Add a label/value pair to a GaimNotifyUserInfo object. GaimNotifyUserInfo keeps track of the order in which pairs are added. + * + * @param user_info The GaimNotifyUserInfo + * @param label A label, which for example might be displayed by a UI with a colon after it ("Status:"). Do not include a colon. + * If NULL, value will be displayed without a label. + * @param value The value, which might be displayed by a UI after the label. + * If NULL, label will still be displayed; the UI should then treat label as independent + * and not include a colon if it would otherwise. + */ +void gaim_notify_user_info_add_pair(GaimNotifyUserInfo *user_info, const char *label, const char *value); + +/** + * Prepend a label/value pair to a GaimNotifyUserInfo object + * + * @param user_info The GaimNotifyUserInfo + * @param label A label, which for example might be displayed by a UI with a colon after it ("Status:"). Do not include a colon. + * If NULL, value will be displayed without a label. + * @param value The value, which might be displayed by a UI after the label. + * If NULL, label will still be displayed; the UI should then treat label as independent + * and not include a colon if it would otherwise. + */ +void gaim_notify_user_info_prepend_pair(GaimNotifyUserInfo *user_info, const char *label, const char *value); + +/** + * Add a section break. A UI might display this as a horizontal line. + * + * @param user_info The GaimNotifyUserInfo + */ +void gaim_notify_user_info_add_section_break(GaimNotifyUserInfo *user_info); + +/** + * Add a section header. A UI might display this in a different font from other text. + * + * @param user_info The GaimNotifyUserInfo + * @param label The name of the section + */ +void gaim_notify_user_info_add_section_header(GaimNotifyUserInfo *user_info, const char *label); + +/** + * Remove the last item which was added to a GaimNotifyUserInfo. This could be used to remove a section header which is not needed. + */ +void gaim_notify_user_info_remove_last_item(GaimNotifyUserInfo *user_info); + +/** + * Get the label for a GaimNotifyUserInfoEntry + * + * @param user_info_entry The GaimNotifyUserInfoEntry + * + * @result The label + */ +gchar *gaim_notify_user_info_entry_get_label(GaimNotifyUserInfoEntry *user_info_entry); + +/** + * Get the value for a GaimNotifyUserInfoEntry + * + * @param user_info_entry The GaimNotifyUserInfoEntry + * + * @result The value + */ +gchar *gaim_notify_user_info_entry_get_value(GaimNotifyUserInfoEntry *user_info_entry); + +/** * Opens a URI or somehow presents it to the user. * * @param handle The plugin or connection handle. Modified: trunk/libgaim/protocols/gg/gg.c =================================================================== --- trunk/libgaim/protocols/gg/gg.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/gg/gg.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -1013,56 +1013,47 @@ static void ggp_pubdir_handle_info(GaimConnection *gc, gg_pubdir50_t req, GGPSearchForm *form) { - GString *text; + GaimNotifyUserInfo *user_info; char *val, *who; - text = g_string_new(""); + user_info = gaim_notify_user_info_new(); val = ggp_search_get_result(req, 0, GG_PUBDIR50_STATUS); /* XXX: Use of ggp_str_to_uin() is an ugly hack! */ - g_string_append_printf(text, "<b>%s:</b> %s<br/>", - _("Status"), ggp_status_by_id(ggp_str_to_uin(val))); + gaim_notify_user_info_add_pair(user_info, _("Status"), ggp_status_by_id(ggp_str_to_uin(val))); g_free(val); who = ggp_search_get_result(req, 0, GG_PUBDIR50_UIN); - g_string_append_printf(text, "<b>%s:</b> %s<br/>", - _("UIN"), who); + gaim_notify_user_info_add_pair(user_info, _("UIN"), who); val = ggp_search_get_result(req, 0, GG_PUBDIR50_FIRSTNAME); - g_string_append_printf(text, "<b>%s:</b> %s<br/>", - _("First Name"), val); + gaim_notify_user_info_add_pair(user_info, _("First Name"), val); g_free(val); val = ggp_search_get_result(req, 0, GG_PUBDIR50_NICKNAME); - g_string_append_printf(text, "<b>%s:</b> %s<br/>", - _("Nickname"), val); + gaim_notify_user_info_add_pair(user_info, _("Nickname"), val); g_free(val); val = ggp_search_get_result(req, 0, GG_PUBDIR50_CITY); - g_string_append_printf(text, "<b>%s:</b> %s<br/>", - _("City"), val); + gaim_notify_user_info_add_pair(user_info, _("City"), val); g_free(val); val = ggp_search_get_result(req, 0, GG_PUBDIR50_BIRTHYEAR); - if (strncmp(val, "0", 1) == 0) { - g_free(val); - val = g_strdup(""); + if (strncmp(val, "0", 1)) { + gaim_notify_user_info_add_pair(user_info, _("Birth Year"), val); } - g_string_append_printf(text, "<b>%s:</b> %s<br/>", - _("Birth Year"), val); g_free(val); val = ggp_buddy_get_name(gc, ggp_str_to_uin(who)); g_free(who); who = val; - val = gaim_strdup_withhtml(text->str); +/* val = gaim_strdup_withhtml(text->str); */ - gaim_notify_userinfo(gc, who, val, ggp_sr_close_cb, form); - - g_string_free(text, TRUE); + gaim_notify_userinfo(gc, who, user_info, ggp_sr_close_cb, form); g_free(val); g_free(who); + gaim_notify_user_info_destroy(user_info); } /* }}} */ @@ -1558,11 +1549,11 @@ } /* }}} */ -/* static void ggp_tooltip_text(GaimBuddy *b, GString *str, gboolean full) {{{ */ -static void ggp_tooltip_text(GaimBuddy *b, GString *str, gboolean full) +/* static void ggp_tooltip_text(GaimBuddy *b, GaimNotifyUserInfo *user_info, gboolean full) {{{ */ +static void ggp_tooltip_text(GaimBuddy *b, GaimNotifyUserInfo *user_info, gboolean full) { GaimStatus *status; - char *text; + char *text, *tmp; const char *msg, *name; g_return_if_fail(b != NULL); @@ -1574,16 +1565,15 @@ if (msg != NULL) { text = g_markup_escape_text(msg, -1); if (GAIM_BUDDY_IS_ONLINE(b)) { - g_string_append_printf(str, "\n<b>%s:</b> %s: %s", - _("Status"), name, text); + tmp = g_strdup_printf("%s: %s", name, text); + gaim_notify_user_info_add_pair(user_info, _("Status"), tmp); + g_free(tmp); } else { - g_string_append_printf(str, "\n<b>%s:</b>: %s", - _("Message"), text); + gaim_notify_user_info_add_pair(user_info, _("Message"), text); } g_free(text); - } else if (GAIM_BUDDY_IS_ONLINE(b)) { - g_string_append_printf(str, "\n<b>%s:</b> %s", - _("Status"), name); + } else { + gaim_notify_user_info_add_pair(user_info, _("Status"), name); } } /* }}} */ Modified: trunk/libgaim/protocols/irc/msgs.c =================================================================== --- trunk/libgaim/protocols/irc/msgs.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/irc/msgs.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -199,7 +199,8 @@ { GaimConnection *gc; GString *info; - char *str, *tmp; + char *str, *tmp, *tmp2; + GaimNotifyUserInfo *user_info; if (!irc->whois.nick) { gaim_debug(GAIM_DEBUG_WARNING, "irc", "Unexpected End of WHOIS for %s\n", args[1]); @@ -210,55 +211,59 @@ return; } - info = g_string_new(""); - tmp = g_markup_escape_text(args[1], -1); - g_string_append_printf(info, _("<b>%s:</b> %s"), _("Nick"), tmp); + user_info = gaim_notify_user_info_new(); + + tmp2 = g_markup_escape_text(args[1], -1); + tmp = g_strdup_printf("%s%s%s", tmp2, + (irc->whois.ircop ? _(" <i>(ircop)</i>") : ""), + (irc->whois.identified ? _(" <i>(identified)</i>") : "")); + gaim_notify_user_info_add_pair(user_info, _("Nick"), tmp); + g_free(tmp2); g_free(tmp); - g_string_append_printf(info, "%s%s<br>", - irc->whois.ircop ? _(" <i>(ircop)</i>") : "", - irc->whois.identified ? _(" <i>(identified)</i>") : ""); + if (irc->whois.away) { tmp = g_markup_escape_text(irc->whois.away, strlen(irc->whois.away)); g_free(irc->whois.away); - g_string_append_printf(info, _("<b>%s:</b> %s<br>"), _("Away"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Away"), tmp); g_free(tmp); } if (irc->whois.userhost) { tmp = g_markup_escape_text(irc->whois.name, strlen(irc->whois.name)); g_free(irc->whois.name); - g_string_append_printf(info, _("<b>%s:</b> %s<br>"), _("Username"), irc->whois.userhost); - g_string_append_printf(info, _("<b>%s:</b> %s<br>"), _("Real name"), tmp); + gaim_notify_user_info_add_pair(user_info, _("Username"), irc->whois.userhost); + gaim_notify_user_info_add_pair(user_info, _("Real name"), tmp); g_free(irc->whois.userhost); g_free(tmp); } if (irc->whois.server) { - g_string_append_printf(info, _("<b>%s:</b> %s"), _("Server"), irc->whois.server); - g_string_append_printf(info, " (%s)<br>", irc->whois.serverinfo); + tmp = g_strdup_printf("%s (%s)", irc->whois.server, irc->whois.serverinfo); + gaim_notify_user_info_add_pair(user_info, _("Server"), tmp); + g_free(tmp); g_free(irc->whois.server); g_free(irc->whois.serverinfo); } if (irc->whois.channels) { - g_string_append_printf(info, _("<b>%s:</b> %s<br>"), _("Currently on"), irc->whois.channels); + gaim_notify_user_info_add_pair(user_info, _("Currently on"), irc->whois.channels); g_free(irc->whois.channels); } if (irc->whois.idle) { gchar *timex = gaim_str_seconds_to_string(irc->whois.idle); - g_string_append_printf(info, _("<b>Idle for:</b> %s<br>"), timex); + gaim_notify_user_info_add_pair(user_info, _("Idle for"), timex); g_free(timex); - g_string_append_printf(info, _("<b>%s:</b> %s"), _("Online since"), - gaim_date_format_full(localtime(&irc->whois.signon))); + gaim_notify_user_info_add_pair(user_info, + _("Online since"), gaim_date_format_full(localtime(&irc->whois.signon))); } if (!strcmp(irc->whois.nick, "Paco-Paco")) { - g_string_append_printf(info, _("<br><b>Defining adjective:</b> Glorious<br>")); + gaim_notify_user_info_add_pair(user_info, + _("<b>Defining adjective:</b>"), _("Glorious")); } gc = gaim_account_get_connection(irc->account); - str = g_string_free(info, FALSE); - gaim_notify_userinfo(gc, irc->whois.nick, str, NULL, NULL); + gaim_notify_userinfo(gc, irc->whois.nick, user_info, NULL, NULL); + gaim_notify_user_info_destroy(user_info); g_free(irc->whois.nick); - g_free(str); memset(&irc->whois, 0, sizeof(irc->whois)); } Modified: trunk/libgaim/protocols/jabber/buddy.c =================================================================== --- trunk/libgaim/protocols/jabber/buddy.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/jabber/buddy.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -602,17 +602,17 @@ static void jabber_buddy_info_show_if_ready(JabberBuddyInfo *jbi) { - GString *info_text; - char *resource_name; + char *resource_name, *tmp; JabberBuddyResource *jbr; JabberBuddyInfoResource *jbir = NULL; GList *resources; + GaimNotifyUserInfo *user_info; /* not yet */ if(jbi->ids) return; - info_text = g_string_new(""); + user_info = gaim_notify_user_info_new(); resource_name = jabber_get_resource(jbi->jid); if(resource_name) { @@ -622,29 +622,29 @@ char *purdy = NULL; if(jbr->status) purdy = gaim_strdup_withhtml(jbr->status); - g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/>", - _("Status"), jabber_buddy_state_get_name(jbr->state), - purdy ? ": " : "", - purdy ? purdy : ""); - if(purdy) - g_free(purdy); + tmp = g_strdup_printf("%s%s%s", jabber_buddy_state_get_name(jbr->state), + (purdy ? ": " : ""), + (purdy ? purdy : "")); + gaim_notify_user_info_add_pair(user_info, _("Status"), tmp); + g_free(tmp); + g_free(purdy); } else { - g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", - _("Status"), _("Unknown")); + gaim_notify_user_info_add_pair(user_info, _("Status"), _("Unknown")); } if(jbir) { if(jbir->idle_seconds > 0) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", - _("Idle"), gaim_str_seconds_to_string(jbir->idle_seconds)); + gaim_notify_user_info_add_pair(user_info, _("Idle"), gaim_str_seconds_to_string(jbir->idle_seconds)); } } if(jbr && jbr->client.name) { - g_string_append_printf(info_text, "<b>%s:</b> %s %s<br/>", - _("Client:"), jbr->client.name, - jbr->client.version ? jbr->client.version : ""); + tmp = g_strdup_printf("%s%s%s", jbr->client.name, + (jbr->client.version ? " " : ""), + (jbr->client.version ? jbr->client.version : "")); + gaim_notify_user_info_add_pair(user_info, _("Client"), tmp); + g_free(tmp); + if(jbr->client.os) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", - _("Operating System"), jbr->client.os); + gaim_notify_user_info_add_pair(user_info, _("Operating System"), jbr->client.os); } } } else { @@ -654,54 +654,57 @@ if(jbr->status) purdy = gaim_strdup_withhtml(jbr->status); if(jbr->name) - g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", - _("Resource"), jbr->name); - g_string_append_printf(info_text, "<b>%s:</b> %d<br/>", - _("Priority"), jbr->priority); - g_string_append_printf(info_text, "<b>%s:</b> %s%s%s<br/>", - _("Status"), jabber_buddy_state_get_name(jbr->state), - purdy ? ": " : "", - purdy ? purdy : ""); - if(purdy) - g_free(purdy); + gaim_notify_user_info_add_pair(user_info, _("Resource"), jbr->name); + tmp = g_strdup_printf("%d", jbr->priority); + gaim_notify_user_info_add_pair(user_info, _("Priority"), tmp); + g_free(tmp); + tmp = g_strdup_printf("%s%s%s", jabber_buddy_state_get_name(jbr->state), + (purdy ? ": " : ""), + (purdy ? purdy : "")); + gaim_notify_user_info_add_pair(user_info, _("Status"), tmp); + g_free(tmp); + g_free(purdy); + if(jbr->name) jbir = g_hash_table_lookup(jbi->resources, jbr->name); if(jbir) { if(jbir->idle_seconds > 0) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", - _("Idle"), gaim_str_seconds_to_string(jbir->idle_seconds)); + gaim_notify_user_info_add_pair(user_info, _("Idle"), gaim_str_seconds_to_string(jbir->idle_seconds)); } } - if(jbr->client.name) { - g_string_append_printf(info_text, "<b>%s:</b> %s %s<br/>", - _("Client"), jbr->client.name, - jbr->client.version ? jbr->client.version : ""); + if(jbr && jbr->client.name) { + tmp = g_strdup_printf("%s%s%s", jbr->client.name, + (jbr->client.version ? " " : ""), + (jbr->client.version ? jbr->client.version : "")); + gaim_notify_user_info_add_pair(user_info, + _("Client"), tmp); + g_free(tmp); + if(jbr->client.os) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br/>", - _("Operating System"), jbr->client.os); + gaim_notify_user_info_add_pair(user_info, _("Operating System"), jbr->client.os); } } - - g_string_append_printf(info_text, "<br/>"); } } g_free(resource_name); - if (jbi->vcard_text != NULL) - info_text = g_string_append(info_text, jbi->vcard_text); + if (jbi->vcard_text != NULL) { + gaim_notify_user_info_add_section_break(user_info); + /* Should this have some sort of label? */ + gaim_notify_user_info_add_pair(user_info, NULL, jbi->vcard_text); + } - gaim_notify_userinfo(jbi->js->gc, jbi->jid, info_text->str, NULL, NULL); + gaim_notify_userinfo(jbi->js->gc, jbi->jid, user_info, NULL, NULL); + gaim_notify_user_info_destroy(user_info); while(jbi->vcard_imgids) { gaim_imgstore_unref(GPOINTER_TO_INT(jbi->vcard_imgids->data)); jbi->vcard_imgids = g_slist_delete_link(jbi->vcard_imgids, jbi->vcard_imgids); } - g_string_free(info_text, TRUE); - if (jbi->timeout_handle > 0) gaim_timeout_remove(jbi->timeout_handle); Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -1127,7 +1127,7 @@ return ret; } -static void jabber_tooltip_text(GaimBuddy *b, GString *str, gboolean full) +static void jabber_tooltip_text(GaimBuddy *b, GaimNotifyUserInfo *user_info, gboolean full) { JabberBuddy *jb; @@ -1160,12 +1160,14 @@ else sub = _("None"); } - g_string_append_printf(str, "\n<b>%s:</b> %s", _("Subscription"), sub); + + gaim_notify_user_info_add_pair(user_info, _("Subscription"), sub); } for(l=jb->resources; l; l = l->next) { char *text = NULL; char *res = NULL; + char *label, *value; const char *state; jbr = l->data; @@ -1188,20 +1190,23 @@ text = NULL; } - g_string_append_printf(str, "\n<b>%s%s:</b> %s%s%s", - _("Status"), - res ? res : "", - state, - text ? ": " : "", - text ? text : ""); + label = g_strdup_printf("%s%s", + _("Status"), (res ? res : "")); + value = g_strdup_printf("%s%s%s", + state, + (text ? ": " : ""), + (text ? text : "")); + gaim_notify_user_info_add_pair(user_info, label, value); + + g_free(label); + g_free(value); g_free(text); g_free(res); } if(!GAIM_BUDDY_IS_ONLINE(b) && jb->error_msg) { - g_string_append_printf(str, "\n<b>%s:</b> %s", - _("Error"), jb->error_msg); + gaim_notify_user_info_add_pair(user_info, _("Error"), jb->error_msg); } } } Modified: trunk/libgaim/protocols/msn/msn.c =================================================================== --- trunk/libgaim/protocols/msn/msn.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/msn/msn.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -67,10 +67,8 @@ MsnGetInfoData *info_data; char *stripped; char *url_buffer; - GString *s; + GaimNotifyUserInfo *user_info; char *photo_url_text; - char *tooltip_text; - const char *title; } MsnGetInfoStepTwoData; @@ -533,7 +531,7 @@ } static void -msn_tooltip_text(GaimBuddy *buddy, GString *str, gboolean full) +msn_tooltip_text(GaimBuddy *buddy, GaimNotifyUserInfo *user_info, gboolean full) { MsnUser *user; GaimPresence *presence = gaim_buddy_get_presence(buddy); @@ -541,27 +539,27 @@ user = buddy->proto_data; + if (gaim_presence_is_online(presence)) { - g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Status"), - gaim_presence_is_idle(presence) ? - _("Idle") : gaim_status_get_name(status)); + gaim_notify_user_info_add_pair(user_info, _("Status"), + (gaim_presence_is_idle(presence) ? _("Idle") : gaim_status_get_name(status))); } - + if (full && user) { - g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Has you"), - (user->list_op & (1 << MSN_LIST_RL)) ? - _("Yes") : _("No")); + gaim_notify_user_info_add_pair(user_info, _("Has you"), + ((user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No"))); + } /* XXX: This is being shown in non-full tooltips because the * XXX: blocked icon overlay isn't always accurate for MSN. * XXX: This can die as soon as gaim_privacy_check() knows that * XXX: this prpl always honors both the allow and deny lists. */ if (user) - g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Blocked"), - (user->list_op & (1 << MSN_LIST_BL)) ? - _("Yes") : _("No")); + { + gaim_notify_user_info_add_pair(user_info, _("Blocked"), + ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No"))); } } @@ -1341,47 +1339,44 @@ } } -static char * -msn_tooltip_info_text(MsnGetInfoData *info_data) +/** + * Extract info text from info_data and add it to user_info + */ +static gboolean +msn_tooltip_extract_info_text(GaimNotifyUserInfo *user_info, MsnGetInfoData *info_data) { - GString *s; GaimBuddy *b; - s = g_string_sized_new(80); /* wild guess */ - b = gaim_find_buddy(gaim_connection_get_account(info_data->gc), info_data->name); if (b) { - GString *str = g_string_new(""); char *tmp; if (b->alias && b->alias[0]) { char *aliastext = g_markup_escape_text(b->alias, -1); - g_string_append_printf(s, _("<b>Alias:</b> %s<br>"), aliastext); + gaim_notify_user_info_add_pair(user_info, _("Alias"), aliastext); g_free(aliastext); } if (b->server_alias) { char *nicktext = g_markup_escape_text(b->server_alias, -1); - g_string_append_printf(s, _("<b>%s:</b> "), _("Nickname")); - g_string_append_printf(s, "<font sml=\"msn\">%s</font><br>", - nicktext); + tmp = g_strdup_printf("<font sml=\"msn\">%s</font><br>", nicktext); + gaim_notify_user_info_add_pair(user_info, _("Nickname"), tmp); + g_free(tmp); g_free(nicktext); } - msn_tooltip_text(b, str, TRUE); - tmp = gaim_strreplace((*str->str == '\n' ? str->str + 1 : str->str), - "\n", "<br>"); - g_string_free(str, TRUE); - g_string_append_printf(s, "%s<br>", tmp); - g_free(tmp); + /* Add the tooltip information */ + msn_tooltip_text(b, user_info, TRUE); + + return TRUE; } - return g_string_free(s, FALSE); + return FALSE; } #if PHOTO_SUPPORT @@ -1419,7 +1414,7 @@ #endif #define MSN_GOT_INFO_GET_FIELD(a, b) \ - found = gaim_markup_extract_info_field(stripped, stripped_len, s, \ + found = gaim_markup_extract_info_field(stripped, stripped_len, user_info, \ "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \ if (found) \ sect_info = TRUE; @@ -1429,17 +1424,15 @@ const gchar *url_text, size_t len, const gchar *error_message) { MsnGetInfoData *info_data = (MsnGetInfoData *)data; - char *stripped, *p, *q; - char buf[1024]; - char *tooltip_text; + GaimNotifyUserInfo *user_info; + char *stripped, *p, *q, *tmp; char *user_url = NULL; gboolean found; + gboolean has_tooltip_text = FALSE; gboolean has_info = FALSE; gboolean sect_info = FALSE; - const char* title = NULL; + gboolean has_contact_info = FALSE; char *url_buffer; - char *personal = NULL; - char *business = NULL; GString *s, *s2; int stripped_len; #if PHOTO_SUPPORT @@ -1458,17 +1451,18 @@ return; } - tooltip_text = msn_tooltip_info_text(info_data); - title = _("MSN Profile"); + user_info = gaim_notify_user_info_new(); + has_tooltip_text = msn_tooltip_extract_info_text(user_info, info_data); if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { - g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>", - tooltip_text, _("Error retrieving profile")); + tmp = g_strdup_printf("<b>%s</b>", _("Error retrieving profile")); + gaim_notify_user_info_add_pair(user_info, NULL, tmp); + g_free(tmp); - gaim_notify_userinfo(info_data->gc, info_data->name, buf, NULL, NULL); + gaim_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); + gaim_notify_user_info_destroy(user_info); - g_free(tooltip_text); g_free(info_data->name); g_free(info_data); return; @@ -1528,10 +1522,16 @@ /* No we're not. */ s = g_string_sized_new(strlen(url_buffer)); s2 = g_string_sized_new(strlen(url_buffer)); - + + /* General section header */ + if (has_tooltip_text) + gaim_notify_user_info_add_section_break(user_info); + + gaim_notify_user_info_add_section_header(user_info, _("General")); + /* Extract their Name and put it in */ - MSN_GOT_INFO_GET_FIELD("Name", _("Name")) - + MSN_GOT_INFO_GET_FIELD("Name", _("Name")); + /* General */ MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); MSN_GOT_INFO_GET_FIELD("Age", _("Age")); @@ -1540,7 +1540,7 @@ MSN_GOT_INFO_GET_FIELD("Location", _("Location")); /* Extract their Interests and put it in */ - found = gaim_markup_extract_info_field(stripped, stripped_len, s, + found = gaim_markup_extract_info_field(stripped, stripped_len, user_info, "\nInterests\t", 0, " (/default.aspx?page=searchresults", 0, "Undisclosed", _("Hobbies and Interests") /* _("Interests") */, 0, NULL, NULL); @@ -1549,20 +1549,24 @@ sect_info = TRUE; MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me")); - + if (sect_info) { - /* trim off the trailing "<br>\n" */ - g_string_truncate(s, strlen(s->str) - 5); - g_string_append_printf(s2, _("%s<b>General</b><br>%s"), - (*tooltip_text) ? "<hr>" : "", s->str); - s = g_string_truncate(s, 0); has_info = TRUE; sect_info = FALSE; } - - + else + { + /* Remove the section header */ + gaim_notify_user_info_remove_last_item(user_info); + if (has_tooltip_text) + gaim_notify_user_info_remove_last_item(user_info); + } + /* Social */ + gaim_notify_user_info_add_section_break(user_info); + gaim_notify_user_info_add_section_header(user_info, _("Social")); + MSN_GOT_INFO_GET_FIELD("Marital status", _("Marital Status")); MSN_GOT_INFO_GET_FIELD("Interested in", _("Interests")); MSN_GOT_INFO_GET_FIELD("Pets", _("Pets")); @@ -1575,14 +1579,22 @@ if (sect_info) { - g_string_append_printf(s2, _("%s<b>Social</b><br>%s"), has_info ? "<br><hr>" : "", s->str); - s = g_string_truncate(s, 0); has_info = TRUE; sect_info = FALSE; } + else + { + /* Remove the section header */ + gaim_notify_user_info_remove_last_item(user_info); + gaim_notify_user_info_remove_last_item(user_info); + } /* Contact Info */ /* Personal */ + gaim_notify_user_info_add_section_break(user_info); + gaim_notify_user_info_add_section_header(user_info, _("Contact Info")); + gaim_notify_user_info_add_section_header(user_info, _("Personal")); + MSN_GOT_INFO_GET_FIELD("Name", _("Name")); MSN_GOT_INFO_GET_FIELD("Significant other", _("Significant Other")); MSN_GOT_INFO_GET_FIELD("Home phone", _("Home Phone")); @@ -1598,13 +1610,18 @@ if (sect_info) { - personal = g_strdup_printf(_("<br><b>Personal</b><br>%s"), s->str); - s = g_string_truncate(s, 0); - sect_info = FALSE; has_info = TRUE; + sect_info = FALSE; + has_contact_info = TRUE; } + else + { + /* Remove the section header */ + gaim_notify_user_info_remove_last_item(user_info); + } /* Business */ + gaim_notify_user_info_add_section_header(user_info, _("Work")); MSN_GOT_INFO_GET_FIELD("Name", _("Name")); MSN_GOT_INFO_GET_FIELD("Job title", _("Job Title")); MSN_GOT_INFO_GET_FIELD("Company", _("Company")); @@ -1623,27 +1640,22 @@ if (sect_info) { - business = g_strdup_printf(_("<br><b>Business</b><br>%s"), s->str); - s = g_string_truncate(s, 0); + has_info = TRUE; sect_info = FALSE; + has_contact_info = TRUE; } + else + { + /* Remove the section header */ + gaim_notify_user_info_remove_last_item(user_info); + } - if ((personal != NULL) || (business != NULL)) + if (!has_contact_info) { - /* trim off the trailing "<br>\n" */ - g_string_truncate(s, strlen(s->str) - 5); - - has_info = TRUE; - g_string_append_printf(s2, _("<hr><b>Contact Info</b>%s%s"), - personal ? personal : "", - business ? business : ""); + /* Remove the Contact Info section header */ + gaim_notify_user_info_remove_last_item(user_info); } - g_free(personal); - g_free(business); - g_string_free(s, TRUE); - s = s2; - #if 0 /* these probably don't show up any more */ /* * The fields, 'A Little About Me', 'Favorite Things', 'Hobbies @@ -1768,12 +1780,9 @@ /* If we were able to fetch a homepage url earlier, stick it in there */ if (user_url != NULL) { - g_snprintf(buf, sizeof(buf), - "<b>%s:</b><br><a href=\"%s\">%s</a><br>\n", - _("Homepage"), user_url, user_url); - - g_string_append(s, buf); - + tmp = g_strdup_printf("<a href=\"%s\">%s</a>", user_url, user_url); + gaim_notify_user_info_add_pair(user_info, _("Homepage"), tmp); + g_free(tmp); g_free(user_url); has_info = TRUE; @@ -1792,26 +1801,23 @@ char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\""); GaimBuddy *b = gaim_find_buddy (gaim_connection_get_account(info_data->gc), info_data->name); - g_string_append_printf(s, "<br><b>%s</b><br>%s<br><br>", - _("Error retrieving profile"), - ((p && b)? - _("The user has not created a public profile."): - p? _("MSN reported not being able to find the user's profile. " - "This either means that the user does not exist, " - "or that the user exists " - "but has not created a public profile."): - _("Gaim could not find " /* This should never happen */ - "any information in the user's profile. " - "The user most likely does not exist."))); + gaim_notify_user_info_add_pair(user_info, _("Error retrieving profile"), + ((p && b) ? _("The user has not created a public profile.") : + (p ? _("MSN reported not being able to find the user's profile. " + "This either means that the user does not exist, " + "or that the user exists " + "but has not created a public profile.") : + _("Gaim could not find " /* This should never happen */ + "any information in the user's profile. " + "The user most likely does not exist.")))); } + /* put a link to the actual profile URL */ - g_string_append_printf(s, _("<hr><b>%s:</b> "), _("Profile URL")); - g_string_append_printf(s, "<br><a href=\"%s%s\">%s%s</a><br>", - PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); + tmp = g_strdup_printf("<a href=\"%s%s\">%s%s</a>", + PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); + gaim_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); + g_free(tmp); - /* Finish it off, and show it to them */ - g_string_append(s, "</body></html>\n"); - #if PHOTO_SUPPORT /* Find the URL to the photo; must be before the marshalling [Bug 994207] */ photo_url_text = msn_get_photo_url(url_text); @@ -1821,10 +1827,8 @@ info2_data->info_data = info_data; info2_data->stripped = stripped; info2_data->url_buffer = url_buffer; - info2_data->s = s; + info2_data->user_info = user_info; info2_data->photo_url_text = photo_url_text; - info2_data->tooltip_text = tooltip_text; - info2_data->title = title; /* Try to put the photo in there too, if there's one */ if (photo_url_text) @@ -1851,9 +1855,8 @@ MsnGetInfoData *info_data = info2_data->info_data; char *stripped = info2_data->stripped; char *url_buffer = info2_data->url_buffer; - GString *s = info2_data->s; + GaimNotifyUserInfo *user_info = info2_data->user_info; char *photo_url_text = info2_data->photo_url_text; - char *tooltip_text = info2_data->tooltip_text; /* Make sure the connection is still valid if we got here by fetching a photo url */ if (url_text && (error_message != NULL || @@ -1862,8 +1865,7 @@ gaim_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); g_free(stripped); g_free(url_buffer); - g_string_free(s, TRUE); - g_free(tooltip_text); + g_free(user_info); g_free(info_data->name); g_free(info_data); g_free(photo_url_text); @@ -1889,20 +1891,17 @@ gaim_debug_info("msn", "%s is %d bytes\n", photo_url_text, len); id = gaim_imgstore_add(url_text, len, NULL); g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id); - g_string_prepend(s, buf); + gaim_notify_user_info_prepend_pair(user_info, NULL, buf); } } /* We continue here from msn_got_info, as if nothing has happened */ #endif + gaim_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); - g_string_prepend(s, tooltip_text); - gaim_notify_userinfo(info_data->gc, info_data->name, s->str, NULL, NULL); - g_free(stripped); g_free(url_buffer); - g_string_free(s, TRUE); - g_free(tooltip_text); + gaim_notify_user_info_destroy(user_info); g_free(info_data->name); g_free(info_data); #if PHOTO_SUPPORT Modified: trunk/libgaim/protocols/novell/novell.c =================================================================== --- trunk/libgaim/protocols/novell/novell.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/novell/novell.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -1494,6 +1494,7 @@ static void _show_info(GaimConnection * gc, NMUserRecord * user_record) { + GaimNotifyUserInfo *user_info = gaim_notify_user_info_new(); GString *info_text; int count, i; NMProperty *property; @@ -1504,21 +1505,20 @@ tag = _("User ID"); value = nm_user_record_get_userid(user_record); if (value) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br>", tag, value); + gaim_notify_user_info_add_pair(user_info, tag, value); } /* tag = _("DN"); value = nm_user_record_get_dn(user_record); if (value) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br>", - tag, value); + gaim_notify_user_info_add_pair(user_info, tag, value); } */ tag = _("Full name"); value = nm_user_record_get_full_name(user_record); if (value) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br>", tag, value); + gaim_notify_user_info_add_pair(user_info, tag, value); } count = nm_user_record_get_property_count(user_record); @@ -1528,17 +1528,15 @@ tag = _map_property_tag(nm_property_get_tag(property)); value = nm_property_get_value(property); if (tag && value) { - g_string_append_printf(info_text, "<b>%s:</b> %s<br>", - tag, value); + gaim_notify_user_info_add_pair(user_info, tag, value); } nm_release_property(property); } } gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), - info_text->str, NULL, NULL); - - g_string_free(info_text, TRUE); + user_info, NULL, NULL); + gaim_notify_user_info_destroy(user_info); } /* Send a join conference, the first item in the parms list is the @@ -2826,7 +2824,7 @@ } static void -novell_tooltip_text(GaimBuddy * buddy, GString * str, gboolean full) +novell_tooltip_text(GaimBuddy * buddy, GaimNotifyUserInfo * user_info, gboolean full) { NMUserRecord *user_record = NULL; GaimConnection *gc; @@ -2869,14 +2867,10 @@ break; } + gaim_notify_user_info_add_pair(user_info, _("Status"), status_str); + if (text) - g_string_append_printf(str, "\n<b>%s:</b> %s" - "\n<b>%s:</b> %s", - _("Status"), status_str, - _("Message"), text); - else - g_string_append_printf(str, "\n<b>%s:</b> %s", - _("Status"), status_str); + gaim_notify_user_info_add_pair(user_info, _("Message"), text); } } } Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-09 20:20:17 UTC (rev 17928) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-10 02:53:09 UTC (rev 17929) @@ -705,15 +705,26 @@ } static void -oscar_string_append(GString *str, const char *newline, - const char *name, const char *value) +oscar_user_info_add_pair(GaimNotifyUserInfo *user_info, const char *name, const char *value) { if (value && value[0]) { - g_string_append_printf(str, "%s<b>%s:</b> %s", newline, name, value); + gaim_notify_user_info_add_pair(user_info, name, value); } } static void +oscar_user_info_convert_and_add_pair(GaimAccount *account, GaimNotifyUserInfo *user_info, + const char *name, const char *value) +{ + gchar *utf8; + + if (value && value[0] && (utf8 = oscar_utf8_try_convert(account, value))) { + gaim_notify_user_info_add_pair(user_info, name, utf8); + g_free(utf8); + } +} + +static void oscar_string_convert_and_append(GaimAccount *account, GString *str, const char *newline, const char *name, const char *value) { @@ -725,8 +736,20 @@ } } -static void oscar_string_append_info(GaimConnection *gc, GString *str, const char *newline, GaimBuddy *b, aim_userinfo_t *userinfo) +static void +oscar_user_info_convert_and_add(GaimAccount *account, GaimNotifyUserInfo *user_info, + const char *name, const char *value) { + gchar *utf8; + + if (value && value[0] && (utf8 = oscar_utf8_try_convert(account, value))) { + gaim_notify_user_info_add_pair(user_info, name, value); + g_free(utf8); + } +} + +static void oscar_string_append_info(GaimConnection *gc, GaimNotifyUserInfo *user_info, GaimBuddy *b, aim_userinfo_t *userinfo) +{ OscarData *od; GaimAccount *account; GaimPresence *presence = NULL; @@ -738,7 +761,7 @@ od = gc->proto_data; account = gaim_connection_get_account(gc); - if ((str == NULL) || (newline == NULL) || ((b == NULL) && (userinfo == NULL))) + if ((user_info == NULL) || ((b == NULL) && (userinfo == NULL))) return; if (userinfo == NULL) @@ -760,17 +783,14 @@ if (gaim_presence_is_online(presence)) { if (aim_sn_is_icq(b->name)) { GaimStatus *status = gaim_presence_get_active_status(presence); - oscar_string_append(str, newline, _("Status"), - gaim_status_get_name(status)); + oscar_user_info_add_pair(user_info, _("Status"), gaim_status_get_name(status)); } } else { tmp = aim_ssi_itemlist_findparentname(od->ssi.local, b->name); if (aim_ssi_waitingforauth(od->ssi.local, tmp, b->name)) - oscar_string_append(str, newline, _("Status"), - _("Not Authorized")); + oscar_user_info_add_pair(user_info, _("Status"), _("Not Authorized")); else - oscar_string_append(str, newline, _("Status"), - _("Offline")); + oscar_user_info_add_pair(user_info, _("Status"), _("Offline")); } } @@ -780,14 +800,14 @@ (bi->ipaddr & 0x00ff0000) >> 16, (bi->ipaddr & 0x0000ff00) >> 8, (bi->ipaddr & 0x000000ff)); - oscar_string_append(str, newline, _("IP Address"), tmp); + oscar_user_info_add_pair(user_info, _("IP Address"), tmp); g_free(tmp); } if ((userinfo != NULL) && (userinfo->warnlevel != 0)) { tmp = g_strdup_printf("%d", (int)(userinfo->warnlevel/10.0 + .5)); - oscar_string_append(str, newline, _("Warning Level"), tmp); + oscar_user_info_add_pair(user_info, _("Warning Level"), tmp); g_free(tmp); } @@ -796,7 +816,8 @@ if (tmp != NULL) { char *tmp2 = g_markup_escape_text(tmp, strlen(tmp)); g_free(tmp); - oscar_string_convert_and_append(account, str, newline, _("Buddy Comment"), tmp2); + + oscar_user_info_convert_and_add_pair(account, user_info, _("Buddy Comment"), tmp2); g_free(tmp2); } } @@ -2581,21 +2602,25 @@ switch(reason) { case 0x0003: { /* Reply from an ICQ status message request */ - char *title, *statusmsg, **splitmsg, *dialogmsg; + char *statusmsg, **splitmsg; + GaimNotifyUserInfo *user_info; - title = g_strdup_printf(_("Info for %s"), who); - /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ statusmsg = oscar_icqstatus(state); splitmsg = g_strsplit(msg, "\r\n", 0); - dialogmsg = g_strdup_printf(_("<B>UIN:</B> %s<BR><B>Status:</B> %s<HR>%s"), who, statusmsg, g_strjoinv("<BR>", splitmsg)); + + user_info = gaim_notify_user_info_new(); + + gaim_notify_user_info_add_pair(user_info, _("UIN"), who); + gaim_notify_user_info_add_pair(user_info, _("Status"), statusmsg); + gaim_notify_user_info_add_pair(user_info, NULL, g_strjoinv("<BR>", splitmsg)); + g_free(statusmsg); g_strfreev(splitmsg); - gaim_notify_userinfo(gc, who, dialogmsg, NULL, NULL); + gaim_notify_userinfo(gc, who, user_info, NULL, NULL); + gaim_notify_user_info_destroy(user_info); - g_free(title); - g_free(dialogmsg); } break; default: { @@ -2766,7 +2791,7 @@ static int gaim_parse_userinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { GaimConnection *gc = od->gc; GaimAccount *account = gaim_connection_get_account(gc); - GString *str; + GaimNotifyUserInfo *user_info; gchar *tmp = NULL, *info_utf8 = NULL, *away_utf8 = NULL; va_list ap; aim_userinfo_t *userinfo; @@ -2775,33 +2800,36 @@ userinfo = va_arg(ap, aim_userinfo_t *); va_end(ap); - str = g_string_new(""); - g_string_append_printf(str, "<b>%s:</b> %s", _("Screen Name"), userinfo->sn); - g_string_append_printf(str, "\n<br><b>%s</b>: %d%%", _("Warning Level"), (int)((userinfo->warnlevel/10.0) + 0.5)); + user_info = gaim_notify_user_info_new(); + gaim_notify_user_info_add_pair(user_info, _("Screen Name"), userinfo->sn); + tmp = g_strdup_printf("%d", (int)((userinfo->warnlevel/10.0) + 0.5)); + gaim_notify_user_info_add_pair(user_info, _("Warning Level"), tmp); + g_free(tmp); + if (userinfo->present & AIM_USERINFO_PRESENT_ONLINESINCE) { time_t t = userinfo->onlinesince - od->timeoffset; - oscar_string_append(str, "\n<br>", _("Online Since"), gaim_date_format_full(localtime(&t))); + oscar_user_info_add_pair(user_info, _("Online Since"), gaim_date_format_full(localtime(&t))); } if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE) { time_t t = userinfo->membersince - od->timeoffset; - oscar_string_append(str, "\n<br>", _("Member Since"), gaim_date_format_full(localtime(&t))); + oscar_user_info_add_pair(user_info, _("Member Since"), gaim_date_format_full(localtime(&t))); } if (userinfo->capabilities != 0) { tmp = oscar_caps_to_string(userinfo->capabilities); - oscar_string_append(str, "\n<br>", _("Capabilities"), tmp); + oscar_user_info_add_pair(user_info, _("Capabilities"), tmp); g_free(tmp); } if (userinfo->present & AIM_USERINFO_PRESENT_IDLE) { tmp = gaim_str_seconds_to_string(userinfo->idletime*60); - oscar_string_append(str, "\n<br>", _("Idle"), tmp); + oscar_user_info_add_pair(user_info, _("Idle"), tmp); g_free(tmp); } - oscar_string_append_info(gc, str, "\n<br>", NULL, userinfo); + oscar_string_append_info(gc, user_info, NULL, userinfo); /* Available message */ if ((userinfo->status != NULL) && !(userinfo->flags & AIM_FLAG_AWAY)) @@ -2809,7 +2837,7 @@ if (userinfo->status[0] != '\0') tmp = oscar_encoding_to_utf8(userinfo->status_encoding, userinfo->status, userinfo->status_len); - oscar_string_convert_and_append(account, str, "\n<br>", _("Available Message"), tmp); + oscar_user_info_add_pair(user_info, _("Available Message"), tmp); g_free(tmp); } @@ -2819,7 +2847,9 @@ away_utf8 = oscar_encoding_to_utf8(tmp, userinfo->away, userinfo->away_len); g_free(tmp); if (away_utf8 != NULL) { - g_string_append_printf(str, "\n<hr>%s", away_utf8); + tmp = gaim_str_sub_away_formatters(away_utf8, gaim_account_get_username(account)); + oscar_user_info_add_pair(user_info, NULL, tmp); + g_free(tmp); g_free(away_utf8); } } @@ -2830,16 +2860,15 @@ info_utf8 = oscar_encoding_to_utf8(tmp, userinfo->info, userinfo->info_len); g_free(tmp); if (info_utf8 != NULL) { - g_string_append_printf(str, "\n<hr>%s", info_utf8); + tmp = gaim_str_sub_away_formatters(info_utf8, gaim_account_get_username(account)); + oscar_user_info_add_pair(user_info, _("Profile"), tmp); + g_free(tmp); g_free(info_utf8); } } - tmp = gaim_str_sub_away_formatters(str->str, gaim_account_get_username(account)); - g_string_free(str, TRUE); - gaim_str_strip_char(tmp, '\r'); - gaim_notify_userinfo(gc, userinfo->sn, tmp, NULL, NULL); - g_free(tmp); + gaim_notify_userinfo(gc, userinfo->sn, user_info, NULL, NULL); + gaim_notify_user_info_destroy(user_info); return 1; } @@ -3581,8 +3610,10 @@ GaimBuddy *buddy; struct buddyinfo *bi; gchar who[16]; - GString *str; + GaimNotifyUserInfo *user_info; + GString *tmp; gchar *utf8; + gchar *buf; const gchar *alias; va_list ap; struct aim_icq_info *info; @@ -3597,7 +3628,8 @@ if (!info->uin) return 0; - str = g_string_sized_new(100); + user_info = gaim_notify_user_info_new(); + g_snprintf(who, sizeof(who), "%u", info->uin); buddy = gaim_find_buddy(gaim_connection_get_account(gc), who); if (buddy != NULL) @@ -3605,35 +3637,41 @@ else bi = NULL; - g_string_append_printf(str, "<b>%s:</b> %s", _("UIN"), who); - oscar_string_convert_and_append(account, str, "\n<br>", _("Nick"), info->nick); + gaim_notify_user_info_add_pair(user_info, _("UIN"), who); + oscar_user_info_convert_and_add(account, user_info, _("Nick"), info->nick); if ((bi != NULL) && (bi->ipaddr != 0)) { char *tstr = g_strdup_printf("%hhu.%hhu.%hhu.%hhu", (bi->ipaddr & 0xff000000) >> 24, (bi->ipaddr & 0x00ff0000) >> 16, (bi->ipaddr & 0x0000ff00) >> 8, (bi->ipaddr & 0x000000ff)); - oscar_string_append(str, "\n<br>", _("IP Address"), tstr); + gaim_notify_user_info_add_pair(user_info, _("IP Address"), tstr); g_free(tstr); } - oscar_string_convert_and_append(account, str, "\n<br>", _("First Name"), info->first); - oscar_string_convert_and_append(account, str, "\n<br>", _("Last Name"), info->last); + oscar_user_info_convert_and_add(account, user_info, _("First Name"), info->first); + oscar_user_info_convert_and_add(account, user_info, _("Last Name"), info->last); if (info->email && info->email[0] && (utf8 = oscar_utf8_try_convert(gc->account, info->email))) { - g_string_append_printf(str, "\n<br><b>%s:</b> <a href=\"mailto:%s\">%s</a>", _("E-Mail Address"), utf8, utf8); + buf = g_strdup_printf("<a href=\"mailto:%s\">%s</a>", utf8, utf8); + gaim_notify_user_info_add_pair(user_info, _("E-Mail Address"), buf); + g_free(buf); g_free(utf8); } if (info->numaddresses && info->email2) { int i; for (i = 0; i < info->numaddresses; i++) { if (info->email2[i] && info->email2[i][0] && (utf8 = oscar_utf8_try_convert(gc->account, info->email2[i]))) { - g_string_append_printf(str, "\n<br><b>%s:</b> <a href=\"mailto:%s\">%s</a>", _("E-Mail Address"), utf8, utf8); + buf = g_strdup_printf("<a href=\"mailto:%s\">%s</a>", utf8, utf8); + gaim_notify_user_info_add_pair(user_info, _("E-Mail Address"), buf); + g_free(buf); g_free(utf8); } } } - oscar_string_convert_and_append(account, str, "\n<br>", _("Mobile Phone"), info->mobile); + oscar_user_info_convert_and_add(account, user_info, _("Mobile Phone"), info->mobile); + if (info->gender != 0) - oscar_string_append(str, "\n<br>", _("Gender"), info->gender == 1 ? _("Female") : _("Male")); + gaim_notify_user_info_add_pair(user_info, _("Gender"), (info->gender == 1 ? _("Female") : _("Male"))); + if ((info->birthyear > 1900) && (info->birthmonth > 0) && (info->birthday > 0)) { /* Initialize the struct properly or strftime() will crash * under some conditions (e.g. Debian sarge w/ LANG=en_HK). */ @@ -3649,57 +3687,68 @@ * feel free to remove it. --rlaager */ mktime(tm); - oscar_string_append(str, "\n<br>", _("Birthday"), - gaim_date_format_short(tm)); + oscar_user_info_convert_and_add(account, user_info, _("Birthday"), gaim_date_format_short(tm)); } if ((info->age > 0) && (info->age < 255)) { char age[5]; snprintf(age, sizeof(age), "%hhd", info->age); - oscar_string_append(str, "\n<br>", _("Age"), age); + gaim_notify_user_info_add_pair(user_info, + _("Age"), age); } if (info->personalwebpage && info->personalwebpage[0] && (utf8 = oscar_utf8_try_convert(gc->account, info->personalwebpage))) { - g_string_append_printf(str, "\n<br><b>%s:</b> <a href=\"%s\">%s</a>", _("Personal Web Page"), utf8, utf8); + buf = g_strdup_printf("<a href=\"%s\">%s</a>", utf8, utf8); + gaim_notify_user_info_add_pair(user_info, _("Personal Web Page"), buf); + g_free(buf); g_free(utf8); } - if (info->info && info->info[0] && (utf8 = oscar_utf8_try_convert(gc->account, info->info))) { - g_string_append_printf(str, "<hr><b>%s:</b><br>%s", _("Additional Information"), utf8); - g_free(utf8); - } - g_string_append_printf(str, "<hr>"); + + oscar_user_info_convert_and_add(account, user_info, _("Additional Information"), info->info); + +/* g_string_append_printf(str, "<hr>"); */ + if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) { - g_string_append_printf(str, "<b>%s:</b>", _("Home Address")); - oscar_string_convert_and_append(account, str, "\n<br>", _("Address"), info->homeaddr); - oscar_string_convert_and_append(account, str, "\n<br>", _("City"), info->homecity); - oscar_string_convert_and_append(account, str, "\n<br>", _("State"), info->homestate); - oscar_string_convert_and_append(account, str, "\n<br>", _("Zip Code"), info->homezip); - g_string_append_printf(str, "\n<hr>"); + tmp = g_string_sized_new(100); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("Address"), info->homeaddr); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("City"), info->homecity); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("State"), info->homestate); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("Zip Code"), info->homezip); + + gaim_notify_user_info_add_pair(user_info, _("Home Address"), tmp->str); + + g_string_free(tmp, TRUE); } if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) { - g_string_append_printf(str, "<b>%s:</b>", _("Work Address")); - oscar_string_convert_and_append(account, str, "\n<br>", _("Address"), info->workaddr); - oscar_string_convert_and_append(account, str, "\n<br>", _("City"), info->workcity); - oscar_string_convert_and_append(account, str, "\n<br>", _("State"), info->workstate); - oscar_string_convert_and_append(account, str, "\n<br>", _("Zip Code"), info->workzip); - g_string_append_printf(str, "\n<hr>"); + tmp = g_string_sized_new(100); + + oscar_string_convert_and_append(account, tmp, "\n<br>", _("Address"), info->workaddr); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("City"), info->workcity); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("State"), info->workstate); + oscar_string_convert_and_append(account, tmp, "\n<br>", _("Zip Code"), info->workzip); + + gaim_notify_user_info_add_pair(user_info, _("Work Address"), tmp->str); + + g_string_free(tmp, TRUE); } if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) { - g_string_append_printf(str, "<b>%s:</b>", _("Work Information")); - oscar_string_convert_and_append(account... [truncated message content] |
From: <the...@us...> - 2006-12-09 20:20:25
|
Revision: 17928 http://svn.sourceforge.net/gaim/?rev=17928&view=rev Author: thekingant Date: 2006-12-09 12:20:17 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Get rid of a few small compile warnings Modified Paths: -------------- trunk/libgaim/protocols/msn/userlist.c trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/libgaim/protocols/msn/userlist.c =================================================================== --- trunk/libgaim/protocols/msn/userlist.c 2006-12-09 20:11:43 UTC (rev 17927) +++ trunk/libgaim/protocols/msn/userlist.c 2006-12-09 20:20:17 UTC (rev 17928) @@ -74,7 +74,7 @@ pa->gc = gc; gaim_account_request_authorization(gaim_connection_get_account(gc), passport, NULL, friendly, NULL, - gaim_find_buddy(gaim_connection_get_account(gc), passport), + gaim_find_buddy(gaim_connection_get_account(gc), passport) != NULL, G_CALLBACK(msn_accept_add_cb), G_CALLBACK(msn_cancel_add_cb), pa); } Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-09 20:11:43 UTC (rev 17927) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-09 20:20:17 UTC (rev 17928) @@ -2330,8 +2330,9 @@ data->name = sn; data->nick = NULL; - gaim_account_request_authorization(account, sn, - NULL, NULL, reason, gaim_find_buddy(account, sn), G_CALLBACK(gaim_auth_grant), + gaim_account_request_authorization(account, sn, NULL, NULL, + reason, gaim_find_buddy(account, sn) != NULL, + G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(reason); } @@ -5042,8 +5043,8 @@ data->name = g_strdup(sn); data->nick = NULL; - gaim_account_request_authorization(account, nombre, - NULL, NULL, reason, buddy, G_CALLBACK(gaim_auth_grant), + gaim_account_request_authorization(account, nombre, NULL, NULL, + reason, buddy != NULL, G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(nombre); g_free(reason); Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-09 20:11:43 UTC (rev 17927) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-09 20:20:17 UTC (rev 17928) @@ -996,7 +996,7 @@ * this should probably be moved to the core. */ gaim_account_request_authorization(gaim_connection_get_account(gc), add_req->who, add_req->id, - NULL, add_req->msg, gaim_find_buddy(gaim_connection_get_account(gc),add_req->who), + NULL, add_req->msg, gaim_find_buddy(gaim_connection_get_account(gc),add_req->who) != NULL, G_CALLBACK(yahoo_buddy_add_authorize_cb), G_CALLBACK(yahoo_buddy_add_deny_reason_cb), add_req); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-09 20:11:55
|
Revision: 17927 http://svn.sourceforge.net/gaim/?rev=17927&view=rev Author: thekingant Date: 2006-12-09 12:11:43 -0800 (Sat, 09 Dec 2006) Log Message: ----------- Stephen Pope in #gaim found a bug in our perl stuff where we were creating some hash tables that used g_direct_hash instead of g_str_hash Modified Paths: -------------- trunk/COPYRIGHT trunk/libgaim/blist.h trunk/libgaim/plugins/perl/common/BuddyList.xs trunk/libgaim/plugins/perl/common/Server.xs trunk/libgaim/server.h Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-12-09 07:39:29 UTC (rev 17926) +++ trunk/COPYRIGHT 2006-12-09 20:11:43 UTC (rev 17927) @@ -241,6 +241,7 @@ Julien Pivotto Ari Pollak Robey Pointer +Stephen Pope Nathan Poznick Jory A. Pratt Brent Priddy Modified: trunk/libgaim/blist.h =================================================================== --- trunk/libgaim/blist.h 2006-12-09 07:39:29 UTC (rev 17926) +++ trunk/libgaim/blist.h 2006-12-09 20:11:43 UTC (rev 17927) @@ -314,7 +314,9 @@ * * @param account The account this chat will get added to * @param alias The alias of the new chat - * @param components The info the prpl needs to join the chat + * @param components The info the prpl needs to join the chat. The + * hash function should be g_str_hash() and the + * equal function should be g_str_equal(). * @return A newly allocated chat */ GaimChat *gaim_chat_new(GaimAccount *account, const char *alias, GHashTable *components); Modified: trunk/libgaim/plugins/perl/common/BuddyList.xs =================================================================== --- trunk/libgaim/plugins/perl/common/BuddyList.xs 2006-12-09 07:39:29 UTC (rev 17926) +++ trunk/libgaim/plugins/perl/common/BuddyList.xs 2006-12-09 20:11:43 UTC (rev 17927) @@ -310,7 +310,7 @@ char *t_key, *t_value; CODE: t_HV = (HV *)SvRV(components); - t_GHash = g_hash_table_new(NULL, NULL); + t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); Modified: trunk/libgaim/plugins/perl/common/Server.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Server.xs 2006-12-09 07:39:29 UTC (rev 17926) +++ trunk/libgaim/plugins/perl/common/Server.xs 2006-12-09 20:11:43 UTC (rev 17927) @@ -80,7 +80,7 @@ char *t_key, *t_value; CODE: t_HV = (HV *)SvRV(components); - t_GHash = g_hash_table_new(NULL, NULL); + t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); @@ -135,7 +135,7 @@ char *t_key, *t_value; CODE: t_HV = (HV *)SvRV(components); - t_GHash = g_hash_table_new(NULL, NULL); + t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); @@ -165,7 +165,7 @@ char *t_key, *t_value; CODE: t_HV = (HV *)SvRV(components); - t_GHash = g_hash_table_new(NULL, NULL); + t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); Modified: trunk/libgaim/server.h =================================================================== --- trunk/libgaim/server.h 2006-12-09 07:39:29 UTC (rev 17926) +++ trunk/libgaim/server.h 2006-12-09 20:11:43 UTC (rev 17927) @@ -59,8 +59,6 @@ void serv_rem_permit(GaimConnection *, const char *); void serv_rem_deny(GaimConnection *, const char *); void serv_set_permit_deny(GaimConnection *); -void serv_join_chat(GaimConnection *, GHashTable *); -void serv_reject_chat(GaimConnection *, GHashTable *); void serv_chat_invite(GaimConnection *, int, const char *, const char *); void serv_chat_leave(GaimConnection *, int); void serv_chat_whisper(GaimConnection *, int, const char *, const char *); @@ -91,9 +89,27 @@ void serv_got_im(GaimConnection *gc, const char *who, const char *msg, GaimMessageFlags flags, time_t mtime); + +/** + * @param data The hash function should be g_str_hash() and the equal + * function should be g_str_equal(). + */ +void serv_join_chat(GaimConnection *, GHashTable *); + +/** + * @param data The hash function should be g_str_hash() and the equal + * function should be g_str_equal(). + */ +void serv_reject_chat(GaimConnection *, GHashTable *); + +/** + * @param data The hash function should be g_str_hash() and the equal + * function should be g_str_equal(). + */ void serv_got_chat_invite(GaimConnection *gc, const char *name, const char *who, const char *message, GHashTable *data); + GaimConversation *serv_got_joined_chat(GaimConnection *gc, int id, const char *name); void serv_got_chat_left(GaimConnection *g, int id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-12-09 07:39:41
|
Revision: 17926 http://svn.sourceforge.net/gaim/?rev=17926&view=rev Author: markhuetsch Date: 2006-12-08 23:39:29 -0800 (Fri, 08 Dec 2006) Log Message: ----------- Mark these strings for translation. Modified Paths: -------------- trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/utils.c Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-12-09 07:20:46 UTC (rev 17925) +++ trunk/libgaim/protocols/qq/qq.c 2006-12-09 07:39:29 UTC (rev 17926) @@ -167,23 +167,23 @@ switch(q_bud->status) { case QQ_BUDDY_OFFLINE: - g_string_append(status, "Offline"); + g_string_append(status, _("Offline")); break; case QQ_BUDDY_ONLINE_NORMAL: return NULL; break; /* TODO What does this status mean? Labelling it as offline... */ case QQ_BUDDY_ONLINE_OFFLINE: - g_string_append(status, "Offline"); + g_string_append(status, _("Offline")); break; case QQ_BUDDY_ONLINE_AWAY: - g_string_append(status, "Away"); + g_string_append(status, _("Away")); break; case QQ_BUDDY_ONLINE_INVISIBLE: - g_string_append(status, "Invisible"); + g_string_append(status, _("Invisible")); break; default: - g_string_printf(status, "Unknown-%d", q_bud->status); + g_string_printf(status, _("Unknown-%d"), q_bud->status); } return g_string_free(status, FALSE); @@ -205,27 +205,27 @@ { ip_str = gen_ip_str(q_bud->ip); if (strlen(ip_str) != 0) { - g_string_append_printf(tooltip, "\n<b>%s Address:</b> %s:%d", + g_string_append_printf(tooltip, _("\n<b>%s Address:</b> %s:%d"), (q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) ? "TCP" : "UDP", ip_str, q_bud->port); } g_free(ip_str); - g_string_append_printf(tooltip, "\n<b>Age:</b> %d", q_bud->age); + g_string_append_printf(tooltip, _("\n<b>Age:</b> %d"), q_bud->age); switch (q_bud->gender) { case QQ_BUDDY_GENDER_GG: - g_string_append(tooltip, "\n<b>Gender:</b> Male"); + g_string_append(tooltip, _("\n<b>Gender:</b> Male")); break; case QQ_BUDDY_GENDER_MM: - g_string_append(tooltip, "\n<b>Gender:</b> Female"); + g_string_append(tooltip, _("\n<b>Gender:</b> Female")); break; case QQ_BUDDY_GENDER_UNKNOWN: - g_string_append(tooltip, "\n<b>Gender:</b> Unknown"); + g_string_append(tooltip, _("\n<b>Gender:</b> Unknown")); break; default: - g_string_append_printf(tooltip, "\n<b>Gender:</b> ERROR(%d)", q_bud->gender); + g_string_append_printf(tooltip, _("\n<b>Gender:</b> ERROR(%d)"), q_bud->gender); } if (q_bud->level) - g_string_append_printf(tooltip, "\n<b>Level:</b> %d", q_bud->level); + g_string_append_printf(tooltip, _("\n<b>Level:</b> %d"), q_bud->level); /* For debugging */ /* g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1); Modified: trunk/libgaim/protocols/qq/utils.c =================================================================== --- trunk/libgaim/protocols/qq/utils.c 2006-12-09 07:20:46 UTC (rev 17925) +++ trunk/libgaim/protocols/qq/utils.c 2006-12-09 07:39:29 UTC (rev 17926) @@ -340,16 +340,6 @@ return icon_num_str; } -/* -gint face_to_icon_num(const gchar *face) -{ - gchar *icon_str = face_to_icon_str(face); - gint icon_num = strtol(icon_str, NULL, 10); - g_free(icon_str); - return icon_num; -} -*/ - /* return the location of the buddy icon dir * any application using libgaim but not installing the QQ buddy icons * under datadir needs to set the pref below, or buddy icons won't work */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-12-09 07:20:47
|
Revision: 17925 http://svn.sourceforge.net/gaim/?rev=17925&view=rev Author: markhuetsch Date: 2006-12-08 23:20:46 -0800 (Fri, 08 Dec 2006) Log Message: ----------- This seems like a reasonable way to tell the prpl if we're using a local or global buddy icon. Modified Paths: -------------- trunk/gtk/gtkaccount.c trunk/gtk/gtkstatusbox.c trunk/libgaim/protocols/qq/buddy_info.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-09 06:34:48 UTC (rev 17924) +++ trunk/gtk/gtkaccount.c 2006-12-09 07:20:46 UTC (rev 17925) @@ -622,7 +622,7 @@ gaim_account_get_check_mail(dialog->account)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), - !gaim_account_get_ui_bool(dialog->account, GAIM_GTK_UI, "use-global-buddyicon", + !gaim_account_get_bool(dialog->account, "use-global-buddyicon", TRUE)); set_dialog_icon(dialog, g_strdup(gaim_account_get_ui_string(dialog->account, @@ -1142,12 +1142,12 @@ prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin); if (prpl_info != NULL && prpl_info->icon_spec.format != NULL) { - if (new || gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) == + if (new || gaim_account_get_bool(account, "use-global-buddyicon", TRUE) == gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) { icon_change = TRUE; } - gaim_account_set_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); + gaim_account_set_bool(account, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); gaim_account_set_ui_string(account, GAIM_GTK_UI, "non-global-buddyicon-cached-path", dialog->cached_icon_path); gaim_account_set_ui_string(account, GAIM_GTK_UI, "non-global-buddyicon-path", dialog->icon_path); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-09 06:34:48 UTC (rev 17924) +++ trunk/gtk/gtkstatusbox.c 2006-12-09 07:20:46 UTC (rev 17925) @@ -331,7 +331,7 @@ gtk_widget_show(status_box->icon_box); if (status_box->account && - !gaim_account_get_ui_bool(status_box->account, GAIM_GTK_UI, "use-global-buddyicon", TRUE)) + !gaim_account_get_bool(status_box->account, "use-global-buddyicon", TRUE)) { char *string = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(status_box->account)); gtk_gaim_status_box_set_buddy_icon(status_box, string); @@ -1340,7 +1340,7 @@ char *icon = NULL; if (filename) icon = gaim_gtk_convert_buddy_icon(plug, filename); - gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", (filename != NULL)); + gaim_account_set_bool(box->account, "use-global-buddyicon", (filename != NULL)); gaim_account_set_ui_string(box->account, GAIM_GTK_UI, "non-global-buddyicon-cached-path", icon); gaim_account_set_buddy_icon_path(box->account, filename); gaim_account_set_buddy_icon(box->account, icon); @@ -1355,7 +1355,7 @@ if (plug) { GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); if (prplinfo != NULL && - gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && + gaim_account_get_bool(account, "use-global-buddyicon", TRUE) && prplinfo->icon_spec.format) { char *icon = NULL; if (filename) Modified: trunk/libgaim/protocols/qq/buddy_info.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_info.c 2006-12-09 06:34:48 UTC (rev 17924) +++ trunk/libgaim/protocols/qq/buddy_info.c 2006-12-09 07:20:46 UTC (rev 17925) @@ -548,7 +548,7 @@ } } -/* TODO: custom faces */ +/* TODO: custom faces for QQ members and users with level >= 16 */ void qq_set_my_buddy_icon(GaimConnection *gc, const gchar *iconfile) { gchar *icon; @@ -561,6 +561,7 @@ gint dir_len = strlen(buddy_icon_dir); gint icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), buddy_icon_dir, ".", NULL); + gboolean icon_global = gaim_account_get_bool(gc->account, "use-global-buddyicon", TRUE); /* make sure we're using an appropriate icon */ if (!(g_ascii_strncasecmp(icon_path, buddy_icon_dir, dir_len) == 0 @@ -568,7 +569,10 @@ && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 && icon_len <= 3)) { - gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); + if (icon_global) + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "%s\n", errmsg); + else + gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); g_free(errmsg); return; } @@ -578,7 +582,10 @@ g_free(icon); /* ensure face number in proper range */ if (icon_num > QQ_FACES) { - gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); + if (icon_global) + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "%s\n", errmsg); + else + gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); g_free(errmsg); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-12-09 06:34:49
|
Revision: 17924 http://svn.sourceforge.net/gaim/?rev=17924&view=rev Author: markhuetsch Date: 2006-12-08 22:34:48 -0800 (Fri, 08 Dec 2006) Log Message: ----------- Added support for QQ levels Allow 3rd party clients to specify the location of the buddy icon dir Minor code cleanup Modified Paths: -------------- trunk/libgaim/protocols/qq/Makefile.am trunk/libgaim/protocols/qq/buddy_info.c trunk/libgaim/protocols/qq/buddy_info.h trunk/libgaim/protocols/qq/buddy_list.c trunk/libgaim/protocols/qq/buddy_status.c trunk/libgaim/protocols/qq/header_info.c trunk/libgaim/protocols/qq/header_info.h trunk/libgaim/protocols/qq/keep_alive.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/qq.h trunk/libgaim/protocols/qq/recv_core.c trunk/libgaim/protocols/qq/send_core.h trunk/libgaim/protocols/qq/utils.c trunk/libgaim/protocols/qq/utils.h Modified: trunk/libgaim/protocols/qq/Makefile.am =================================================================== --- trunk/libgaim/protocols/qq/Makefile.am 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/Makefile.am 2006-12-09 06:34:48 UTC (rev 17924) @@ -94,7 +94,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libgaim \ -DVERSION=\"$(VERSION)\" \ - -DQQBUDDYICONDIR=\"$(datadir)/pixmaps/gaim/buddy_icons/qq\" \ + -DQQ_BUDDY_ICON_DIR=\"$(datadir)/pixmaps/gaim/buddy_icons/qq\" \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(GAIM_CFLAGS) Modified: trunk/libgaim/protocols/qq/buddy_info.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_info.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/buddy_info.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -548,27 +548,27 @@ } } -/* TODO: figure out how/when we can use a custom face - * for now, only allow the stock icons */ +/* TODO: custom faces */ void qq_set_my_buddy_icon(GaimConnection *gc, const gchar *iconfile) { gchar *icon; gint icon_num; GaimAccount *account = gaim_connection_get_account(gc); const gchar *icon_path = gaim_account_get_buddy_icon_path(account); + const gchar *buddy_icon_dir = qq_buddy_icon_dir(); gint prefix_len = strlen(QQ_ICON_PREFIX); gint suffix_len = strlen(QQ_ICON_SUFFIX); - gint dir_len = strlen(QQBUDDYICONDIR); + gint dir_len = strlen(buddy_icon_dir); gint icon_len = strlen(icon_path) - dir_len - 1 - prefix_len - suffix_len; - gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), QQBUDDYICONDIR, ".", NULL); + gchar *errmsg = g_strconcat(_("You are attempting to set a custom face. Gaim currently only allows the standard faces. Please choose an image from "), buddy_icon_dir, ".", NULL); /* make sure we're using an appropriate icon */ - if (!(g_ascii_strncasecmp(icon_path, QQBUDDYICONDIR, dir_len) == 0 + if (!(g_ascii_strncasecmp(icon_path, buddy_icon_dir, dir_len) == 0 && icon_path[dir_len] == G_DIR_SEPARATOR && g_ascii_strncasecmp(icon_path + dir_len + 1, QQ_ICON_PREFIX, prefix_len) == 0 && g_ascii_strncasecmp(icon_path + dir_len + 1 + prefix_len + icon_len, QQ_ICON_SUFFIX, suffix_len) == 0 && icon_len <= 3)) { - gaim_notify_error(gc, _("Invalid QQ Facea"), errmsg, NULL); + gaim_notify_error(gc, _("Invalid QQ Face"), errmsg, NULL); g_free(errmsg); return; } @@ -589,6 +589,24 @@ qq_set_buddy_icon_for_user(account, account->username, icon_path); } + +static void _qq_update_buddy_icon(GaimAccount *account, const gchar *name, gint face) +{ + gchar *icon_path; + GaimBuddyIcon *icon = gaim_buddy_icons_find(account, name); + gchar *icon_num_str = face_to_icon_str(face); + const gchar *old_path = gaim_buddy_icon_get_path(icon); + const gchar *buddy_icon_dir = qq_buddy_icon_dir(); + + icon_path = g_strconcat(buddy_icon_dir, G_DIR_SEPARATOR_S, QQ_ICON_PREFIX, + icon_num_str, QQ_ICON_SUFFIX, NULL); + if (icon == NULL || old_path == NULL + || g_ascii_strcasecmp(icon_path, old_path) != 0) + qq_set_buddy_icon_for_user(account, name, icon_path); + g_free(icon_num_str); + g_free(icon_path); +} + /* after getting info or modify myself, refresh the buddy list accordingly */ void qq_refresh_buddy_and_myself(contact_info *info, GaimConnection *gc) { @@ -617,6 +635,7 @@ if (alias_utf8 != NULL) q_bud->nickname = g_strdup(alias_utf8); qq_update_buddy_contact(gc, q_bud); + _qq_update_buddy_icon(gc->account, gaim_name, q_bud->face); } g_free(gaim_name); g_free(alias_utf8); @@ -699,13 +718,98 @@ gaim_debug(GAIM_DEBUG_INFO, "QQ", "%d info queries are freed!\n", i); } -#ifdef _WIN32 -const char *qq_win32_buddy_icon_dir(void) +void qq_send_packet_get_level(GaimConnection *gc, guint32 uid) { - static char *dir = NULL; - if (dir == NULL) - dir = g_build_filename(wgaim_install_dir(), "pixmaps", - "gaim", "buddy_icons", "qq", NULL); - return dir; + guint8 buf[5]; + guint32 tmp = g_htonl(uid); + buf[0] = 0; + memcpy(buf+1, &tmp, 4); + qq_send_cmd(gc, QQ_CMD_GET_LEVEL, TRUE, 0, TRUE, buf, 5); } -#endif + +void qq_send_packet_get_buddies_levels(GaimConnection *gc) +{ + guint8 *buf, *tmp, size; + qq_buddy *q_bud; + GList *node; + qq_data *qd = (qq_data *) gc->proto_data; + + /* server only sends back levels for online buddies, no point + * in asking for anyone else */ + size = 4*g_list_length(qd->buddies) + 1; + buf = g_new0(guint8, size); + tmp = buf + 1; + + for (node = qd->buddies; node != NULL; node = node->next) { + guint32 tmp4; + q_bud = (qq_buddy *) node->data; + if (q_bud != NULL) { + tmp4 = g_htonl(q_bud->uid); + memcpy(tmp, &tmp4, 4); + tmp += 4; + } + } + qq_send_cmd(gc, QQ_CMD_GET_LEVEL, TRUE, 0, TRUE, buf, size); + qd->last_get_levels = time(NULL); + g_free(buf); +} + +void qq_process_get_level_reply(guint8 *buf, gint buf_len, GaimConnection *gc) +{ + guint32 uid, onlineTime; + guint16 level, timeRemainder; + gchar *gaim_name; + GaimBuddy *b; + qq_buddy *q_bud; + gint decr_len, i; + guint8 *decr_buf, *tmp; + GaimAccount *account = gaim_connection_get_account(gc); + qq_data *qd = (qq_data *) gc->proto_data; + + decr_len = buf_len; + decr_buf = g_new0(guint8, buf_len); + if (!qq_crypt(DECRYPT, buf, buf_len, qd->session_key, decr_buf, &decr_len)) { + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Couldn't decrypt get level packet\n"); + } + + decr_len--; + if (decr_len % 12 != 0) { + gaim_debug(GAIM_DEBUG_ERROR, "QQ", + "Get levels list of abnormal length. Truncating last %d bytes.\n", decr_len % 12); + decr_len -= (decr_len % 12); + } + + tmp = decr_buf + 1; + /* this byte seems random */ + /* + gaim_debug(GAIM_DEBUG_INFO, "QQ", "Byte one of get_level packet: %d\n", buf[0]); + */ + for (i = 0; i < decr_len; i += 12) { + uid = g_ntohl(*(guint32 *) tmp); + tmp += 4; + onlineTime = g_ntohl(*(guint32 *) tmp); + tmp += 4; + level = g_ntohs(*(guint16 *) tmp); + tmp += 2; + timeRemainder = g_ntohs(*(guint16 *) tmp); + tmp += 2; + /* + gaim_debug(GAIM_DEBUG_INFO, "QQ", "Level packet entry:\nuid: %d\nonlineTime: %d\nlevel: %d\ntimeRemainder: %d\n", + uid, onlineTime, level, timeRemainder); + */ + gaim_name = uid_to_gaim_name(uid); + b = gaim_find_buddy(account, gaim_name); + q_bud = (b == NULL) ? NULL : (qq_buddy *) b->proto_data; + + if (q_bud != NULL) { + q_bud->onlineTime = onlineTime; + q_bud->level = level; + q_bud->timeRemainder = timeRemainder; + } else { + gaim_debug(GAIM_DEBUG_ERROR, "QQ", + "Got an online buddy %d, but not in my buddy list\n", uid); + } + g_free(gaim_name); + } + g_free(decr_buf); +} Modified: trunk/libgaim/protocols/qq/buddy_info.h =================================================================== --- trunk/libgaim/protocols/qq/buddy_info.h 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/buddy_info.h 2006-12-09 06:34:48 UTC (rev 17924) @@ -92,5 +92,8 @@ void qq_process_modify_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc); void qq_process_get_info_reply(guint8 *buf, gint buf_len, GaimConnection *gc); void qq_info_query_free(qq_data *qd); +void qq_send_packet_get_level(GaimConnection *gc, guint32 uid); +void qq_send_packet_get_buddies_levels(GaimConnection *gc); +void qq_process_get_level_reply(guint8 *buf, gint buf_len, GaimConnection *gc); #endif Modified: trunk/libgaim/protocols/qq/buddy_list.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_list.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/buddy_list.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -28,6 +28,7 @@ #include "notify.h" #include "utils.h" #include "packet_parse.h" +#include "buddy_info.h" #include "buddy_list.h" #include "buddy_status.h" #include "buddy_opt.h" @@ -235,6 +236,7 @@ qq_send_packet_get_buddies_online(gc, position); } else { + qq_send_packet_get_buddies_levels(gc); qq_refresh_all_buddy_status(gc); } Modified: trunk/libgaim/protocols/qq/buddy_status.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_status.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/buddy_status.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -26,6 +26,7 @@ #include "debug.h" #include "prefs.h" +#include "buddy_info.h" #include "buddy_status.h" #include "crypt.h" #include "header_info.h" @@ -261,6 +262,8 @@ q_bud->status = s->status; if(0 != s->client_version) q_bud->client_version = s->client_version; + if (q_bud->status == QQ_BUDDY_ONLINE_NORMAL) + qq_send_packet_get_level(gc, q_bud->uid); qq_update_buddy_contact(gc, q_bud); } else { gaim_debug(GAIM_DEBUG_ERROR, "QQ", Modified: trunk/libgaim/protocols/qq/header_info.c =================================================================== --- trunk/libgaim/protocols/qq/header_info.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/header_info.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -32,6 +32,7 @@ #define QQ_CLIENT_0B2F 0x0b2f /* GB QQ2003iii build 0117 */ #define QQ_CLIENT_0B35 0x0b35 /* GB QQ2003iii build 0304 (offical release) */ #define QQ_CLIENT_0B37 0x0b37 /* GB QQ2003iii build 0304 (April 05 updates) */ + #define QQ_SERVER_0100 0x0100 /* server */ /* given command alias, return the command name accordingly */ @@ -74,6 +75,8 @@ return "QQ_CMD_GROUP_CMD"; case QQ_CMD_GET_ALL_LIST_WITH_GROUP: return "QQ_CMD_GET_ALL_LIST_WITH_GROUP"; + case QQ_CMD_GET_LEVEL: + return "QQ_CMD_GET_LEVEL"; case QQ_CMD_REQUEST_LOGIN_TOKEN: return "QQ_CMD_REQUEST_LOGIN_TOKEN"; case QQ_CMD_RECV_MSG_SYS: Modified: trunk/libgaim/protocols/qq/header_info.h =================================================================== --- trunk/libgaim/protocols/qq/header_info.h 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/header_info.h 2006-12-09 06:34:48 UTC (rev 17924) @@ -33,7 +33,7 @@ #define QQ_PACKET_TAG 0x02 /* all QQ text packets starts with it */ #define QQ_PACKET_TAIL 0x03 /* all QQ text packets end with it */ -/* #define QQ_CLIENT 0x0b37 */ /* QQ2003iii build 0304, Aprili 05 update */ +#define QQ_CLIENT 0x0E1B /* list of known QQ commands */ enum { @@ -57,8 +57,9 @@ QQ_CMD_GET_FRIENDS_ONLINE = 0x0027, /* get my online friends list */ QQ_CMD_CELL_PHONE_2 = 0x0029, /* cell phone 2 */ QQ_CMD_GROUP_CMD = 0x0030, /* group command */ - QQ_CMD_GET_ALL_LIST_WITH_GROUP = 0x58, - QQ_CMD_REQUEST_LOGIN_TOKEN = 0x62, + QQ_CMD_GET_ALL_LIST_WITH_GROUP = 0x0058, + QQ_CMD_GET_LEVEL = 0x005C, /* get level for one or more buddies */ + QQ_CMD_REQUEST_LOGIN_TOKEN = 0x0062, /* get login token */ QQ_CMD_RECV_MSG_SYS = 0x0080, /* receive a system message */ QQ_CMD_RECV_MSG_FRIEND_CHANGE_STATUS = 0x0081, /* friends change status */ }; Modified: trunk/libgaim/protocols/qq/keep_alive.c =================================================================== --- trunk/libgaim/protocols/qq/keep_alive.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/keep_alive.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -42,6 +42,7 @@ #include "utils.h" #define QQ_UPDATE_ONLINE_INTERVAL 300 /* in sec */ +#define QQ_UPDATE_LEVELS_INTERVAL 600 /* in sec */ /* send keep-alive packet to QQ server (it is a heart-beat) */ void qq_send_packet_keep_alive(GaimConnection *gc) @@ -62,7 +63,8 @@ } /* parse the return of keep-alive packet, it includes some system information */ -void qq_process_keep_alive_reply(guint8 *buf, gint buf_len, GaimConnection *gc) { +void qq_process_keep_alive_reply(guint8 *buf, gint buf_len, GaimConnection *gc) +{ qq_data *qd; gint len; gchar **segments; @@ -90,9 +92,11 @@ gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Error decrypt keep alive reply\n"); /* we refresh buddies's online status periodically */ - /* qd->lasat_get_online is updated when setting get_buddies_online packet */ + /* qd->last_get_online is updated when setting get_buddies_online packet */ if ((time(NULL) - qd->last_get_online) >= QQ_UPDATE_ONLINE_INTERVAL) qq_send_packet_get_buddies_online(gc, QQ_FRIENDS_ONLINE_POSITION_START); + if ((time(NULL) - qd->last_get_levels) >= QQ_UPDATE_LEVELS_INTERVAL) + qq_send_packet_get_buddies_levels(gc); } /* refresh all buddies online/offline, @@ -119,20 +123,7 @@ } } -static void _qq_update_buddy_icon(GaimAccount *account, const gchar *name, gint face) -{ - GaimBuddyIcon *icon = gaim_buddy_icons_find(account, name); - gchar *icon_num_str = face_to_icon_str(face); - gchar *icon_path = g_strconcat(QQBUDDYICONDIR, G_DIR_SEPARATOR_S, - QQ_ICON_PREFIX, icon_num_str, QQ_ICON_SUFFIX, NULL); - const gchar *old_path = gaim_buddy_icon_get_path(icon); - if (icon == NULL || old_path == NULL - || g_ascii_strcasecmp(icon_path, old_path) != 0) - qq_set_buddy_icon_for_user(account, name, icon_path); - g_free(icon_num_str); - g_free(icon_path); -} - +/*TODO: maybe this should be qq_update_buddy_status() ?*/ void qq_update_buddy_contact(GaimConnection *gc, qq_buddy *q_bud) { gchar *name; @@ -176,7 +167,6 @@ } gaim_debug(GAIM_DEBUG_INFO, "QQ", "set buddy %d to %s\n", q_bud->uid, status_id); gaim_prpl_got_user_status(gc->account, name, status_id, NULL); - _qq_update_buddy_icon(gc->account, name, q_bud->face); } else { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "unknown buddy: %d\n", q_bud->uid); } Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/qq.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -224,6 +224,8 @@ default: g_string_append_printf(tooltip, "\n<b>Gender:</b> ERROR(%d)", q_bud->gender); } + if (q_bud->level) + g_string_append_printf(tooltip, "\n<b>Level:</b> %d", q_bud->level); /* For debugging */ /* g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1); @@ -368,6 +370,7 @@ return; } + qq_send_packet_get_level(gc, uid); qq_send_packet_get_info(gc, uid, TRUE); } @@ -609,7 +612,6 @@ } qq_send_packet_keep_alive(gc); - } /* convert chat nickname to qq-uid to get this buddy info */ Modified: trunk/libgaim/protocols/qq/qq.h =================================================================== --- trunk/libgaim/protocols/qq/qq.h 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/qq.h 2006-12-09 06:34:48 UTC (rev 17924) @@ -37,7 +37,7 @@ #ifdef _WIN32 const char *qq_win32_buddy_icon_dir(void); -#define QQBUDDYICONDIR qq_win32_buddy_icon_dir() +#define QQ_BUDDY_ICON_DIR qq_win32_buddy_icon_dir() #endif typedef struct _qq_data qq_data; @@ -55,6 +55,9 @@ guint8 flag1; guint8 comm_flag; /* details in qq_buddy_list.c */ guint16 client_version; + guint8 onlineTime; + guint16 level; + guint16 timeRemainder; time_t signon; time_t idle; time_t last_refresh; @@ -94,6 +97,7 @@ guint16 my_icon; /* my icon index */ guint32 all_online; /* the number of online QQ users */ time_t last_get_online; /* last time send get_friends_online packet */ + time_t last_get_levels; /* last time send get_buddies_levels packet */ guint8 window[1 << 13]; /* check up for duplicated packet */ gint sendqueue_timeout; Modified: trunk/libgaim/protocols/qq/recv_core.c =================================================================== --- trunk/libgaim/protocols/qq/recv_core.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/recv_core.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -263,6 +263,9 @@ case QQ_CMD_GET_ALL_LIST_WITH_GROUP: qq_process_get_all_list_with_group_reply(cursor, len, gc); break; + case QQ_CMD_GET_LEVEL: + qq_process_get_level_reply(cursor, len, gc); + break; case QQ_CMD_REQUEST_LOGIN_TOKEN: qq_process_request_login_token_reply(cursor, len, gc); break; Modified: trunk/libgaim/protocols/qq/send_core.h =================================================================== --- trunk/libgaim/protocols/qq/send_core.h 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/send_core.h 2006-12-09 06:34:48 UTC (rev 17924) @@ -28,10 +28,6 @@ #include <glib.h> #include "connection.h" - -#define QQ_CLIENT 0x0E1B -/* #define QQ_CLIENT 0x0F3F */ - gint qq_send_cmd(GaimConnection *gc, guint16 cmd, gboolean is_auto_seq, guint16 seq, gboolean need_ack, guint8 *data, gint len); gint _qq_send_packet(GaimConnection * gc, guint8 *buf, gint len, guint16 cmd); Modified: trunk/libgaim/protocols/qq/utils.c =================================================================== --- trunk/libgaim/protocols/qq/utils.c 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/utils.c 2006-12-09 06:34:48 UTC (rev 17924) @@ -349,3 +349,25 @@ return icon_num; } */ + +/* return the location of the buddy icon dir + * any application using libgaim but not installing the QQ buddy icons + * under datadir needs to set the pref below, or buddy icons won't work */ +const char *qq_buddy_icon_dir(void) +{ + if (gaim_prefs_exists("/prpl/qq/buddy_icon_dir")) + return gaim_prefs_get_string("/prpl/qq/buddy_icon_dir"); + else + return QQ_BUDDY_ICON_DIR; +} + +#ifdef _WIN32 +const char *qq_win32_buddy_icon_dir(void) +{ + static char *dir = NULL; + if (dir == NULL) + dir = g_build_filename(wgaim_install_dir(), "pixmaps", + "gaim", "buddy_icons", "qq", NULL); + return dir; +} +#endif Modified: trunk/libgaim/protocols/qq/utils.h =================================================================== --- trunk/libgaim/protocols/qq/utils.h 2006-12-08 03:03:52 UTC (rev 17923) +++ trunk/libgaim/protocols/qq/utils.h 2006-12-09 06:34:48 UTC (rev 17924) @@ -49,4 +49,7 @@ guint8 *hex_str_to_bytes(const gchar *buf, gint *out_len); gchar *hex_dump_to_str(const guint8 *buf, gint buf_len); +const gchar *qq_buddy_icon_dir(void); +const gchar *qq_win32_buddy_icon_dir(void); + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2006-12-08 07:41:03
|
Revision: 17920 http://svn.sourceforge.net/gaim/?rev=17920&view=rev Author: boler Date: 2006-12-07 15:16:04 -0800 (Thu, 07 Dec 2006) Log Message: ----------- gg: Display status message of offline buddies. Modified Paths: -------------- trunk/libgaim/protocols/gg/gg.c Modified: trunk/libgaim/protocols/gg/gg.c =================================================================== --- trunk/libgaim/protocols/gg/gg.c 2006-12-07 18:54:17 UTC (rev 17919) +++ trunk/libgaim/protocols/gg/gg.c 2006-12-07 23:16:04 UTC (rev 17920) @@ -1567,20 +1567,21 @@ g_return_if_fail(b != NULL); - if (!GAIM_BUDDY_IS_ONLINE(b)) { - return; - } - status = gaim_presence_get_active_status(gaim_buddy_get_presence(b)); msg = gaim_status_get_attr_string(status, "message"); name = gaim_status_get_name(status); if (msg != NULL) { text = g_markup_escape_text(msg, -1); - g_string_append_printf(str, "\n<b>%s:</b> %s: %s", - _("Status"), name, text); + if (GAIM_BUDDY_IS_ONLINE(b)) { + g_string_append_printf(str, "\n<b>%s:</b> %s: %s", + _("Status"), name, text); + } else { + g_string_append_printf(str, "\n<b>%s:</b>: %s", + _("Message"), text); + } g_free(text); - } else { + } else if (GAIM_BUDDY_IS_ONLINE(b)) { g_string_append_printf(str, "\n<b>%s:</b> %s", _("Status"), name); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-08 03:04:03
|
Revision: 17923 http://svn.sourceforge.net/gaim/?rev=17923&view=rev Author: sadrul Date: 2006-12-07 19:03:52 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Make the cursor invisible again after a refresh. Make the last window in the taskbar take up all the available space. Modified Paths: -------------- trunk/console/libgnt/gntwm.c Modified: trunk/console/libgnt/gntwm.c =================================================================== --- trunk/console/libgnt/gntwm.c 2006-12-08 02:57:50 UTC (rev 17922) +++ trunk/console/libgnt/gntwm.c 2006-12-08 03:03:52 UTC (rev 17923) @@ -100,7 +100,10 @@ color = GNT_COLOR_NORMAL; } wbkgdset(taskbar, '\0' | COLOR_PAIR(color)); - mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), width); + if (iter->next) + mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), width); + else + mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), getmaxx(stdscr) - width * i); title = GNT_BOX(w)->title; mvwprintw(taskbar, 0, width * i, "%s", title ? title : "<gnt>"); if (i) @@ -744,6 +747,7 @@ endwin(); refresh(); + curs_set(0); /* endwin resets the cursor to normal */ g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL); update_screen(wm); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-08 02:57:50
|
Revision: 17922 http://svn.sourceforge.net/gaim/?rev=17922&view=rev Author: seanegan Date: 2006-12-07 18:57:50 -0800 (Thu, 07 Dec 2006) Log Message: ----------- small leak Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-12-08 02:51:47 UTC (rev 17921) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-12-08 02:57:50 UTC (rev 17922) @@ -997,6 +997,7 @@ if(js->sasl_cb) g_free(js->sasl_cb); #endif + g_free(js->server_name); g_free(js); gc->proto_data = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-08 02:51:53
|
Revision: 17921 http://svn.sourceforge.net/gaim/?rev=17921&view=rev Author: seanegan Date: 2006-12-07 18:51:47 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Etan had changed the account notify stuff so that the prpl decides if the person is a buddy or not; I totally wiped that out with my authorization stuff. This brings it back. Additionally, I added a googletalk flag to JabberStream which can determine at runtime if you're connected to Google Talk. All of the Google Talk extensions can be detected individually with disco, but this might be used for working with perfectly standard XMPP that's implemented in what might be considered a quirky way in Google Talk. For instance, Google Talk automatically adds buddies to your roster when you authorize them to add you. I was going to use this flag so that the Jabber prpl would never ask me to add a Google Talk buddy who's just been automatically added anyway. I decided to keep it, though, since I may still want to specify what group he's in. This opens the door for more Google Talk customization though >:) Modified Paths: -------------- trunk/gtk/gtkaccount.c trunk/gtk/gtkutils.c trunk/libgaim/account.c trunk/libgaim/account.h trunk/libgaim/protocols/jabber/disco.c trunk/libgaim/protocols/jabber/jabber.h trunk/libgaim/protocols/jabber/presence.c trunk/libgaim/protocols/msn/userlist.c trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/gtk/gtkaccount.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -2420,7 +2420,7 @@ static void gaim_gtk_accounts_request_authorization(GaimAccount *account, const char *remote_user, - const char *id, const char *alias, const char *message, + const char *id, const char *alias, const char *message, gboolean on_list, GCallback auth_cb, GCallback deny_cb, void *user_data) { char *buffer; @@ -2445,7 +2445,7 @@ (message != NULL ? message : "")); - if (!gaim_find_buddy(account, remote_user)) { + if (!on_list) { struct auth_and_add *aa = g_new0(struct auth_and_add, 1); aa->auth_cb = (GaimAccountRequestAuthorizationCb)auth_cb; aa->deny_cb = (GaimAccountRequestAuthorizationCb)deny_cb; Modified: trunk/gtk/gtkutils.c =================================================================== --- trunk/gtk/gtkutils.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/gtk/gtkutils.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -2927,15 +2927,12 @@ primary_esc, secondary ? "\n" : "", secondary?secondary_esc:""); g_free(primary_esc); label = gtk_label_new(NULL); - gtk_widget_set_size_request(label, gaim_prefs_get_int("/gaim/gtk/blist/width")-16,-1); + gtk_widget_set_size_request(label, gaim_prefs_get_int("/gaim/gtk/blist/width")-25,-1); gtk_widget_modify_text(vbox, GTK_STATE_NORMAL, &(label->style->white)); gtk_label_set_markup(GTK_LABEL(label), label_text); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); -#if GTK_CHECK_VERSION(2,6,0) - // g_object_set(label, "ellipsize", PANGO_ELLIPSIZE_END, NULL); -#endif hbox2 = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0); Modified: trunk/libgaim/account.c =================================================================== --- trunk/libgaim/account.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/account.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -1055,7 +1055,7 @@ void gaim_account_request_authorization(GaimAccount *account, const char *remote_user, - const char *id, const char *alias, const char *message, + const char *id, const char *alias, const char *message, gboolean on_list, GCallback auth_cb, GCallback deny_cb, void *user_data) { GaimAccountUiOps *ui_ops; @@ -1066,7 +1066,7 @@ ui_ops = gaim_accounts_get_ui_ops(); if (ui_ops != NULL && ui_ops->request_authorize != NULL) - ui_ops->request_authorize(account, remote_user, id, alias, message, auth_cb, deny_cb, user_data); + ui_ops->request_authorize(account, remote_user, id, alias, message, on_list, auth_cb, deny_cb, user_data); } Modified: trunk/libgaim/account.h =================================================================== --- trunk/libgaim/account.h 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/account.h 2006-12-08 02:51:47 UTC (rev 17921) @@ -54,7 +54,7 @@ const char *id, const char *alias, const char *message); void (*request_authorize)(GaimAccount *account, const char *remote_user, const char *id, - const char *alias, const char *message, + const char *alias, const char *message, gboolean on_list, GCallback authorize_cb, GCallback deny_cb, void *user_data); }; @@ -194,7 +194,7 @@ * @param user_data Data to be passed back to the above callbacks */ void gaim_account_request_authorization(GaimAccount *account, const char *remote_user, - const char *id, const char *alias, const char *message, + const char *id, const char *alias, const char *message, gboolean on_list, GCallback auth_cb, GCallback deny_cb, void *user_data); /** Modified: trunk/libgaim/protocols/jabber/disco.c =================================================================== --- trunk/libgaim/protocols/jabber/disco.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/protocols/jabber/disco.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -212,8 +212,49 @@ } static void -jabber_disco_server_result_cb(JabberStream *js, xmlnode *packet, gpointer data) +jabber_disco_server_info_result_cb(JabberStream *js, xmlnode *packet, gpointer data) { + xmlnode *query, *child; + const char *from = xmlnode_get_attrib(packet, "from"); + const char *type = xmlnode_get_attrib(packet, "type"); + + if(!from || !type) + return; + + if(strcmp(from, js->user->domain)) + return; + + if(strcmp(type, "result")) + return; + + query = xmlnode_get_child(packet, "query"); + + if (!query) return; + + for (child = xmlnode_get_child(query, "category"); child; + child = xmlnode_get_next_twin(child)) { + const char *category, *type, *name; + category = xmlnode_get_attrib(child, "category"); + if (!category || strcmp(category, "server")) + continue; + type = xmlnode_get_attrib(child, "type"); + if (!type || strcmp(type, "im")) + continue; + + name = xmlnode_get_attrib(child, "name"); + if (!name) + continue; + + g_free(js->server_name); + js->server_name = g_strdup(name); + if (!strcmp(name, "Google Talk")) + js->googletalk = TRUE; + } +} + +static void +jabber_disco_server_items_result_cb(JabberStream *js, xmlnode *packet, gpointer data) +{ xmlnode *query, *child; const char *from = xmlnode_get_attrib(packet, "from"); const char *type = xmlnode_get_attrib(packet, "type"); @@ -255,8 +296,14 @@ xmlnode_set_attrib(iq->node, "to", js->user->domain); - jabber_iq_set_callback(iq, jabber_disco_server_result_cb, NULL); + jabber_iq_set_callback(iq, jabber_disco_server_items_result_cb, NULL); jabber_iq_send(iq); + + iq = jabber_iq_new_query(js, JABBER_IQ_GET, + "http://jabber.org/protocol/disco#info"); + xmlnode_set_attrib(iq->node, "to", js->user->domain); + jabber_iq_set_callback(iq, jabber_disco_server_info_result_cb, NULL); + jabber_iq_send(iq); } void jabber_disco_info_do(JabberStream *js, const char *who, JabberDiscoInfoCallback *callback, gpointer data) Modified: trunk/libgaim/protocols/jabber/jabber.h =================================================================== --- trunk/libgaim/protocols/jabber/jabber.h 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/protocols/jabber/jabber.h 2006-12-08 02:51:47 UTC (rev 17921) @@ -120,6 +120,9 @@ gboolean reinit; + gboolean googletalk; + char *server_name; + /* OK, this stays at the end of the struct, so plugins can depend * on the rest of the stuff being in the right place */ Modified: trunk/libgaim/protocols/jabber/presence.c =================================================================== --- trunk/libgaim/protocols/jabber/presence.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/protocols/jabber/presence.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -280,13 +280,22 @@ jb->error_msg = msg ? msg : g_strdup(_("Unknown Error in presence")); } else if(type && !strcmp(type, "subscribe")) { struct _jabber_add_permit *jap = g_new0(struct _jabber_add_permit, 1); + gboolean onlist = FALSE; + GaimBuddy *buddy = gaim_find_buddy(gaim_connection_get_account(js->gc), from); + JabberBuddy *jb = NULL; + if (buddy) { + jb = jabber_buddy_find(js, from, TRUE); + if ((jb->subscription & JABBER_SUB_TO) == 0) + onlist = TRUE; + } + jap->gc = js->gc; jap->who = g_strdup(from); jap->js = js; - gaim_account_request_authorization(gaim_connection_get_account(js->gc), from, NULL, NULL, NULL, - G_CALLBACK(authorize_add_cb), G_CALLBACK(deny_add_cb), jap); + gaim_account_request_authorization(gaim_connection_get_account(js->gc), from, NULL, NULL, NULL, onlist, + G_CALLBACK(authorize_add_cb), G_CALLBACK(deny_add_cb), jap); jabber_id_free(jid); return; } else if(type && !strcmp(type, "subscribed")) { Modified: trunk/libgaim/protocols/msn/userlist.c =================================================================== --- trunk/libgaim/protocols/msn/userlist.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/protocols/msn/userlist.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -74,6 +74,7 @@ pa->gc = gc; gaim_account_request_authorization(gaim_connection_get_account(gc), passport, NULL, friendly, NULL, + gaim_find_buddy(gaim_connection_get_account(gc), passport), G_CALLBACK(msn_accept_add_cb), G_CALLBACK(msn_cancel_add_cb), pa); } Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -2331,7 +2331,7 @@ data->nick = NULL; gaim_account_request_authorization(account, sn, - NULL, NULL, reason, G_CALLBACK(gaim_auth_grant), + NULL, NULL, reason, gaim_find_buddy(account, sn), G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(reason); } @@ -5043,7 +5043,7 @@ data->nick = NULL; gaim_account_request_authorization(account, nombre, - NULL, NULL, reason, G_CALLBACK(gaim_auth_grant), + NULL, NULL, reason, buddy, G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(nombre); g_free(reason); Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-07 23:16:04 UTC (rev 17920) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-08 02:51:47 UTC (rev 17921) @@ -996,7 +996,8 @@ * this should probably be moved to the core. */ gaim_account_request_authorization(gaim_connection_get_account(gc), add_req->who, add_req->id, - NULL, add_req->msg, G_CALLBACK(yahoo_buddy_add_authorize_cb), + NULL, add_req->msg, gaim_find_buddy(gaim_connection_get_account(gc),add_req->who), + G_CALLBACK(yahoo_buddy_add_authorize_cb), G_CALLBACK(yahoo_buddy_add_deny_reason_cb), add_req); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-07 18:54:28
|
Revision: 17919 http://svn.sourceforge.net/gaim/?rev=17919&view=rev Author: evands Date: 2006-12-07 10:54:17 -0800 (Thu, 07 Dec 2006) Log Message: ----------- The pig says, "Function prototypes should match their declarations in return type". :) Actually, it doesn't; pigs don't talk. The pig is, however, suspicious of the talking cow. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-07 18:27:41 UTC (rev 17918) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-07 18:54:17 UTC (rev 17919) @@ -928,7 +928,7 @@ /* 0x000b */ int aim_im_denytransfer(OscarData *od, const char *sn, const guchar *cookie, guint16 code); /* 0x0014 */ int aim_im_sendmtn(OscarData *od, guint16 type1, const char *sn, guint16 type2); void aim_icbm_makecookie(guchar* cookie); -char *oscar_encoding_extract(const char *encoding); +gchar *oscar_encoding_extract(const char *encoding); gchar *oscar_encoding_to_utf8(const char *encoding, const char *text, int textlen); gchar *gaim_plugin_oscar_decode_im_part(GaimAccount *account, const char *sourcesn, guint16 charset, guint16 charsubset, const gchar *data, gsize datalen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-07 18:27:56
|
Revision: 17918 http://svn.sourceforge.net/gaim/?rev=17918&view=rev Author: thekingant Date: 2006-12-07 10:27:41 -0800 (Thu, 07 Dec 2006) Log Message: ----------- The cow says, "Non-static functions should be in header files" Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-07 15:15:23 UTC (rev 17917) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-07 18:27:41 UTC (rev 17918) @@ -928,6 +928,7 @@ /* 0x000b */ int aim_im_denytransfer(OscarData *od, const char *sn, const guchar *cookie, guint16 code); /* 0x0014 */ int aim_im_sendmtn(OscarData *od, guint16 type1, const char *sn, guint16 type2); void aim_icbm_makecookie(guchar* cookie); +char *oscar_encoding_extract(const char *encoding); gchar *oscar_encoding_to_utf8(const char *encoding, const char *text, int textlen); gchar *gaim_plugin_oscar_decode_im_part(GaimAccount *account, const char *sourcesn, guint16 charset, guint16 charsubset, const gchar *data, gsize datalen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-12-07 15:15:31
|
Revision: 17917 http://svn.sourceforge.net/gaim/?rev=17917&view=rev Author: evands Date: 2006-12-07 07:15:23 -0800 (Thu, 07 Dec 2006) Log Message: ----------- 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. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-07 14:08:45 UTC (rev 17916) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-07 15:15:23 UTC (rev 17917) @@ -268,7 +268,7 @@ * one of us-ascii, utf-8, iso-8859-1, or unicode-2-0, and * return a newly allocated string containing bleh. */ -static gchar * +gchar * oscar_encoding_extract(const char *encoding) { gchar *ret = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-12-07 14:10:50
|
Revision: 17916 http://svn.sourceforge.net/gaim/?rev=17916&view=rev Author: nosnilmot Date: 2006-12-07 06:08:45 -0800 (Thu, 07 Dec 2006) Log Message: ----------- MSN only does PNG Modified Paths: -------------- trunk/libgaim/protocols/msn/msn.c Modified: trunk/libgaim/protocols/msn/msn.c =================================================================== --- trunk/libgaim/protocols/msn/msn.c 2006-12-07 08:23:18 UTC (rev 17915) +++ trunk/libgaim/protocols/msn/msn.c 2006-12-07 14:08:45 UTC (rev 17916) @@ -1955,7 +1955,7 @@ OPT_PROTO_MAIL_CHECK, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png,gif,jpeg", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ + {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ msn_list_icon, /* list_icon */ msn_list_emblems, /* list_emblems */ msn_status_text, /* status_text */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-07 08:29:46
|
Revision: 17915 http://svn.sourceforge.net/gaim/?rev=17915&view=rev Author: thekingant Date: 2006-12-07 00:23:18 -0800 (Thu, 07 Dec 2006) Log Message: ----------- * Add a little cushion to the rate average calculation to hopefully account for any inaccuracies due to network lag and stuff * If one of our connections is disconnected, close the socket and don't try to write to it again. This will hopefully fix a weird race condition that Kevin was running into? Modified Paths: -------------- trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/peer.c Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-07 08:06:48 UTC (rev 17914) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-07 08:23:18 UTC (rev 17915) @@ -129,7 +129,8 @@ new_current = rateclass_get_new_current(conn, rateclass, &now); - if (new_current < rateclass->alert) + if (new_current < rateclass->alert + 100) + /* (Add 100ms padding to account for inaccuracies in the calculation) */ /* Not ready to send this SNAC yet--keep waiting. */ return TRUE; @@ -185,8 +186,9 @@ gettimeofday(&now, NULL); new_current = rateclass_get_new_current(conn, rateclass, &now); - if (new_current < rateclass->alert) + if (new_current < rateclass->alert + 100) { + /* (Add 100ms padding to account for inaccuracies in the calculation) */ enqueue = TRUE; } else @@ -905,6 +907,10 @@ return; /* Error! */ + gaim_input_remove(conn->watcher_outgoing); + conn->watcher_outgoing = 0; + close(conn->fd); + conn->fd = -1; flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); return; @@ -930,7 +936,7 @@ gaim_circ_buffer_append(conn->buffer_outgoing, bs->data, count); /* If we haven't already started writing stuff, then start the cycle */ - if (conn->watcher_outgoing == 0) + if ((conn->watcher_outgoing == 0) && (conn->fd != -1)) { conn->watcher_outgoing = gaim_input_add(conn->fd, GAIM_INPUT_WRITE, send_cb, conn); Modified: trunk/libgaim/protocols/oscar/peer.c =================================================================== --- trunk/libgaim/protocols/oscar/peer.c 2006-12-07 08:06:48 UTC (rev 17914) +++ trunk/libgaim/protocols/oscar/peer.c 2006-12-07 08:23:18 UTC (rev 17915) @@ -421,8 +421,14 @@ return; if (conn->ready) + { + gaim_input_remove(conn->watcher_outgoing); + conn->watcher_outgoing = 0; + close(conn->fd); + conn->fd = -1; peer_connection_schedule_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION, NULL); + } else { /* @@ -450,7 +456,7 @@ gaim_circ_buffer_append(conn->buffer_outgoing, bs->data, bs->len); /* If we haven't already started writing stuff, then start the cycle */ - if (conn->watcher_outgoing == 0) + if ((conn->watcher_outgoing == 0) && (conn->fd != -1)) { conn->watcher_outgoing = gaim_input_add(conn->fd, GAIM_INPUT_WRITE, send_cb, conn); @@ -708,8 +714,6 @@ gaim_debug_info("oscar", "Peer connection timed out after 5 seconds. " "Trying next method...\n"); - peer_connection_close(conn); - peer_connection_trynext(conn); /* Cancel this timer. It'll be added again, if needed. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-07 08:13:53
|
Revision: 17914 http://svn.sourceforge.net/gaim/?rev=17914&view=rev Author: thekingant Date: 2006-12-07 00:06:48 -0800 (Thu, 07 Dec 2006) Log Message: ----------- Fix the crash I just emailed gaim-devel about. Thanks to sadrul for noticing the fix. Modified Paths: -------------- trunk/gtk/gtkscrollbook.c Modified: trunk/gtk/gtkscrollbook.c =================================================================== --- trunk/gtk/gtkscrollbook.c 2006-12-07 07:05:20 UTC (rev 17913) +++ trunk/gtk/gtkscrollbook.c 2006-12-07 08:06:48 UTC (rev 17914) @@ -184,7 +184,7 @@ gtk_box_pack_start(GTK_BOX(scroll_book), scroll_book->notebook, TRUE, TRUE, 0); g_signal_connect_swapped(G_OBJECT(scroll_book->notebook), "add", G_CALLBACK(page_count_change_cb), scroll_book); - g_signal_connect(G_OBJECT(scroll_book->notebook), "remove", G_CALLBACK(page_count_change_cb), scroll_book); + g_signal_connect_swapped(G_OBJECT(scroll_book->notebook), "remove", G_CALLBACK(page_count_change_cb), scroll_book); g_signal_connect(G_OBJECT(scroll_book->notebook), "switch-page", G_CALLBACK(switch_page_cb), scroll_book); gtk_widget_hide(scroll_book->hbox); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 07:13:08
|
Revision: 17913 http://svn.sourceforge.net/gaim/?rev=17913&view=rev Author: sadrul Date: 2006-12-06 23:05:20 -0800 (Wed, 06 Dec 2006) Log Message: ----------- I think this fixed some compile error on some platform for Alver. Modified Paths: -------------- trunk/console/libgnt/Makefile.am Modified: trunk/console/libgnt/Makefile.am =================================================================== --- trunk/console/libgnt/Makefile.am 2006-12-07 07:03:40 UTC (rev 17912) +++ trunk/console/libgnt/Makefile.am 2006-12-07 07:05:20 UTC (rev 17913) @@ -56,7 +56,7 @@ libgnt_lainclude_HEADERS = \ $(libgnt_la_headers) -libgnt_la_DEPENDENCIES = @LIBOBJS@ $(STATIC_LINK_LIBS) +libgnt_la_DEPENDENCIES = $(STATIC_LINK_LIBS) libgnt_la_LDFLAGS = -export-dynamic libgnt_la_LIBADD = \ $(GLIB_LIBS) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 07:09:50
|
Revision: 17912 http://svn.sourceforge.net/gaim/?rev=17912&view=rev Author: sadrul Date: 2006-12-06 23:03:40 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Forgot to update the manpage. Modified Paths: -------------- trunk/console/libgnt/gntentry.c trunk/doc/gaim-text.1.in Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-12-07 07:01:32 UTC (rev 17911) +++ trunk/console/libgnt/gntentry.c 2006-12-07 07:03:40 UTC (rev 17912) @@ -615,10 +615,6 @@ GNT_KEY_CTRL_K, NULL); gnt_bindable_class_register_action(bindable, "delete-prev-word", del_prev_word, GNT_KEY_CTRL_W, NULL); -#if 0 - gnt_bindable_class_register_action(bindable, "delete-next-word", del_next_word, - NULL, 1, NULL); -#endif gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word, "\033" "b", NULL); gnt_bindable_class_register_action(bindable, "cursor-prev", move_back, Modified: trunk/doc/gaim-text.1.in =================================================================== --- trunk/doc/gaim-text.1.in 2006-12-07 07:01:32 UTC (rev 17911) +++ trunk/doc/gaim-text.1.in 2006-12-07 07:03:40 UTC (rev 17912) @@ -250,6 +250,8 @@ a-b = cursor-prev-word .br a-f = cursor-next-word +.br +a-d = delete-next-word .br [GntTree::binding] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 07:05:05
|
Revision: 17911 http://svn.sourceforge.net/gaim/?rev=17911&view=rev Author: sadrul Date: 2006-12-06 23:01:32 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Add action delete-next-word with a-d as the default binding. Unfortunately, this is also the default binding for the wm to dump an html screenshot. So you will need to unbind that first to make this work. Modified Paths: -------------- trunk/console/libgnt/gntentry.c Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-12-07 06:43:37 UTC (rev 17910) +++ trunk/console/libgnt/gntentry.c 2006-12-07 07:01:32 UTC (rev 17911) @@ -428,14 +428,16 @@ } static gboolean -move_forward_word(GntBindable *bind, GList *list) +delete_forward_word(GntBindable *bind, GList *list) { GntEntry *entry = GNT_ENTRY(bind); GntWidget *widget = GNT_WIDGET(bind); - entry->cursor = (char *)next_begin_word(entry->cursor, entry->end); - while (gnt_util_onscreen_width(entry->scroll, entry->cursor) >= widget->priv.width) { - entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); - } + char *iter = (char *)next_begin_word(entry->cursor, entry->end); + int len = entry->end - iter + 1; + memmove(entry->cursor, iter, len); + len = iter - entry->cursor; + entry->end -= len; + memset(entry->end, '\0', len); entry_redraw(widget); return TRUE; } @@ -627,7 +629,7 @@ gnt_bindable_register_binding(bindable, "cursor-next", GNT_KEY_CTRL_F, NULL); gnt_bindable_class_register_action(bindable, "cursor-next-word", move_forward_word, "\033" "f", NULL); - gnt_bindable_class_register_action(bindable, "cursor-next-word", delete_forward_word, + gnt_bindable_class_register_action(bindable, "delete-next-word", delete_forward_word, "\033" "d", NULL); gnt_bindable_class_register_action(bindable, "suggest-show", suggest_show, "\t", NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 06:48:30
|
Revision: 17910 http://svn.sourceforge.net/gaim/?rev=17910&view=rev Author: sadrul Date: 2006-12-06 22:43:37 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Fix cursor-prev-word and delete-prev-word for non-ascii characters. Add new action cursor-next-word with a-f as the default binding. Update the manpage for the changes. Modified Paths: -------------- trunk/console/libgnt/gntentry.c trunk/doc/gaim-text.1.in Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-12-07 05:57:53 UTC (rev 17909) +++ trunk/console/libgnt/gntentry.c 2006-12-07 06:43:37 UTC (rev 17910) @@ -334,28 +334,49 @@ return TRUE; } +#define SAME(a,b) ((g_unichar_isalpha(a) && g_unichar_isalpha(b)) || \ + (g_unichar_isdigit(a) && g_unichar_isdigit(b)) || \ + (g_unichar_isspace(a) && g_unichar_isspace(b)) || \ + (g_unichar_iswide(a) && g_unichar_iswide(b))) + static const char * begin_word(const char *text, const char *begin) { - char ch; - while (text > begin && (isspace(*text) || !*text)) - text--; - ch = *text; -#define SAME(a,b) ((isalpha(a) && isalpha(b)) || (isdigit(a) && isdigit(b)) || (isspace(a) && isspace(b))) - while (--text >= begin) { - if (!SAME(ch, *text)) + gunichar ch = 0; + while (text > begin && (!*text || g_unichar_isspace(g_utf8_get_char(text)))) + text = g_utf8_find_prev_char(begin, text); + ch = g_utf8_get_char(text); + while ((text = g_utf8_find_prev_char(begin, text)) >= begin) { + gunichar cur = g_utf8_get_char(text); + if (!SAME(ch, cur)) break; } -#undef SAME - return ++text; + return (text ? g_utf8_find_next_char(text, NULL) : begin); } +static const char * +next_begin_word(const char *text, const char *end) +{ + gunichar ch = 0; + ch = g_utf8_get_char(text); + while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) { + gunichar cur = g_utf8_get_char(text); + if (!SAME(ch, cur)) + break; + } + + while (text && text < end && g_unichar_isspace(g_utf8_get_char(text))) + text = g_utf8_find_next_char(text, end); + return (text ? text : end); +} + +#undef SAME static gboolean move_back_word(GntBindable *bind, GList *null) { GntEntry *entry = GNT_ENTRY(bind); - const char *iter = entry->cursor - 1; + const char *iter = g_utf8_find_prev_char(entry->start, entry->cursor); if (iter < entry->start) return TRUE; @@ -372,7 +393,7 @@ { GntWidget *widget = GNT_WIDGET(bind); GntEntry *entry = GNT_ENTRY(bind); - char *iter = entry->cursor - 1; + char *iter = g_utf8_find_prev_char(entry->start, entry->cursor); int count; if (iter < entry->start) @@ -394,6 +415,32 @@ } static gboolean +move_forward_word(GntBindable *bind, GList *list) +{ + GntEntry *entry = GNT_ENTRY(bind); + GntWidget *widget = GNT_WIDGET(bind); + entry->cursor = (char *)next_begin_word(entry->cursor, entry->end); + while (gnt_util_onscreen_width(entry->scroll, entry->cursor) >= widget->priv.width) { + entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); + } + entry_redraw(widget); + return TRUE; +} + +static gboolean +move_forward_word(GntBindable *bind, GList *list) +{ + GntEntry *entry = GNT_ENTRY(bind); + GntWidget *widget = GNT_WIDGET(bind); + entry->cursor = (char *)next_begin_word(entry->cursor, entry->end); + while (gnt_util_onscreen_width(entry->scroll, entry->cursor) >= widget->priv.width) { + entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); + } + entry_redraw(widget); + return TRUE; +} + +static gboolean gnt_entry_key_pressed(GntWidget *widget, const char *text) { GntEntry *entry = GNT_ENTRY(widget); @@ -571,13 +618,17 @@ NULL, 1, NULL); #endif gnt_bindable_class_register_action(bindable, "cursor-prev-word", move_back_word, - NULL, NULL); + "\033" "b", NULL); gnt_bindable_class_register_action(bindable, "cursor-prev", move_back, GNT_KEY_LEFT, NULL); gnt_bindable_register_binding(bindable, "cursor-prev", GNT_KEY_CTRL_B, NULL); gnt_bindable_class_register_action(bindable, "cursor-next", move_forward, GNT_KEY_RIGHT, NULL); gnt_bindable_register_binding(bindable, "cursor-next", GNT_KEY_CTRL_F, NULL); + gnt_bindable_class_register_action(bindable, "cursor-next-word", move_forward_word, + "\033" "f", NULL); + gnt_bindable_class_register_action(bindable, "cursor-next-word", delete_forward_word, + "\033" "d", NULL); gnt_bindable_class_register_action(bindable, "suggest-show", suggest_show, "\t", NULL); gnt_bindable_class_register_action(bindable, "suggest-next", suggest_next, Modified: trunk/doc/gaim-text.1.in =================================================================== --- trunk/doc/gaim-text.1.in 2006-12-07 05:57:53 UTC (rev 17909) +++ trunk/doc/gaim-text.1.in 2006-12-07 06:43:37 UTC (rev 17910) @@ -245,11 +245,11 @@ .br up = suggest-prev .br -# The following actions don't have any default binding: +c-w = delete-prev-word .br -# delete-prev-word +a-b = cursor-prev-word .br -# cursor-prev-word +a-f = cursor-next-word .br [GntTree::binding] @@ -266,10 +266,13 @@ .br pagedown = page-down .br +# Following is the default binding for the context-menu +.br +menu = context-menu +.br # The following will let you open the context-menu in the buddylist with c-b .br -c-b = context-menu -.br +# c-b = context-menu .br [GntWidget::binding] @@ -341,7 +344,7 @@ .br [GntS::binding] .br -c-t = toggle-buddylist +a-b = toggle-buddylist .SH Conversation Commands There are a few helpful commands in addition to the regular commands. You can This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-07 06:03:49
|
Revision: 17909 http://svn.sourceforge.net/gaim/?rev=17909&view=rev Author: faceprint Date: 2006-12-06 21:57:53 -0800 (Wed, 06 Dec 2006) Log Message: ----------- fix 1586525 Modified Paths: -------------- trunk/gtk/gtkroomlist.c trunk/libgaim/protocols/gg/gg.c trunk/libgaim/protocols/irc/irc.c trunk/libgaim/protocols/jabber/chat.c trunk/libgaim/protocols/jabber/chat.h trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/msn/msn.c trunk/libgaim/protocols/novell/novell.c trunk/libgaim/protocols/oscar/libaim.c trunk/libgaim/protocols/oscar/libicq.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/simple/simple.c trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/zephyr/zephyr.c trunk/libgaim/prpl.h Modified: trunk/gtk/gtkroomlist.c =================================================================== --- trunk/gtk/gtkroomlist.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/gtk/gtkroomlist.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -199,7 +199,21 @@ static void do_add_room_cb(GtkWidget *w, struct _menu_cb_info *info) { - gaim_blist_request_add_chat(info->list->account, NULL, NULL, info->room->name); + char *name; + GaimConnection *gc = gaim_account_get_connection(info->list->account); + GaimPluginProtocolInfo *prpl_info = NULL; + + if(gc != NULL) + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); + + if(prpl_info != NULL && prpl_info->roomlist_room_serialize) + name = prpl_info->roomlist_room_serialize(info->room); + else + name = g_strdup(info->room->name); + + gaim_blist_request_add_chat(info->list->account, NULL, NULL, name); + + g_free(name); } static void add_room_to_blist_cb(GtkButton *button, GaimGtkRoomlistDialog *dialog) Modified: trunk/libgaim/protocols/gg/gg.c =================================================================== --- trunk/libgaim/protocols/gg/gg.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/gg/gg.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -2119,6 +2119,7 @@ ggp_offline_message, /* offline_message */ NULL, /* whiteboard_prpl_ops */ NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; /* }}} */ Modified: trunk/libgaim/protocols/irc/irc.c =================================================================== --- trunk/libgaim/protocols/irc/irc.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/irc/irc.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -868,7 +868,8 @@ irc_dccsend_new_xfer, /* new_xfer */ NULL, /* offline_message */ NULL, /* whiteboard_prpl_ops */ - irc_send_raw, /* send_raw */ + irc_send_raw, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static gboolean load_plugin (GaimPlugin *plugin) { Modified: trunk/libgaim/protocols/jabber/chat.c =================================================================== --- trunk/libgaim/protocols/jabber/chat.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/jabber/chat.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -84,6 +84,8 @@ g_hash_table_insert(defaults, "room", g_strdup(jid->node)); if(jid->domain) g_hash_table_replace(defaults, "server", g_strdup(jid->domain)); + if(jid->resource) + g_hash_table_replace(defaults, "handle", g_strdup(jid->resource)); jabber_id_free(jid); } } @@ -749,6 +751,12 @@ jabber_iq_send(iq); } +char *jabber_roomlist_room_serialize(GaimRoomlistRoom *room) +{ + + return g_strdup_printf("%s@%s", (char*)room->fields->data, (char*)room->fields->next->data); +} + GaimRoomlist *jabber_roomlist_get_list(GaimConnection *gc) { JabberStream *js = gc->proto_data; Modified: trunk/libgaim/protocols/jabber/chat.h =================================================================== --- trunk/libgaim/protocols/jabber/chat.h 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/jabber/chat.h 2006-12-07 05:57:53 UTC (rev 17909) @@ -89,5 +89,7 @@ void jabber_chat_disco_traffic(JabberChat *chat); +char *jabber_roomlist_room_serialize(GaimRoomlistRoom *room); + #endif /* _GAIM_JABBER_CHAT_H_ */ Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -1902,6 +1902,7 @@ jabber_offline_message, /* offline_message */ NULL, /* whiteboard_prpl_ops */ jabber_prpl_send_raw, /* send_raw */ + jabber_roomlist_room_serialize, /* roomlist_room_serialize */ }; static gboolean load_plugin(GaimPlugin *plugin) Modified: trunk/libgaim/protocols/msn/msn.c =================================================================== --- trunk/libgaim/protocols/msn/msn.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/msn/msn.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -2013,6 +2013,7 @@ NULL, /* offline_message */ NULL, /* whiteboard_prpl_ops */ NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static GaimPluginInfo info = Modified: trunk/libgaim/protocols/novell/novell.c =================================================================== --- trunk/libgaim/protocols/novell/novell.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/novell/novell.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -3534,6 +3534,8 @@ NULL, /* offline_message */ NULL, /* whiteboard_prpl_ops */ NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ + }; static GaimPluginInfo info = { Modified: trunk/libgaim/protocols/oscar/libaim.c =================================================================== --- trunk/libgaim/protocols/oscar/libaim.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/oscar/libaim.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -89,7 +89,8 @@ oscar_new_xfer, /* new_xfer */ oscar_offline_message, /* offline_message */ NULL, /* whiteboard_prpl_ops */ - NULL, /* send_raw */ + NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static GaimPluginInfo info = Modified: trunk/libgaim/protocols/oscar/libicq.c =================================================================== --- trunk/libgaim/protocols/oscar/libicq.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/oscar/libicq.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -90,7 +90,8 @@ oscar_new_xfer, /* new_xfer */ oscar_offline_message, /* offline_message */ NULL, /* whiteboard_prpl_ops */ - NULL, /* send_raw */ + NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static GaimPluginInfo info = Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/qq/qq.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -695,6 +695,7 @@ NULL, /* offline_message */ NULL, /* GaimWhiteboardPrplOps */ NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static GaimPluginInfo info = { Modified: trunk/libgaim/protocols/simple/simple.c =================================================================== --- trunk/libgaim/protocols/simple/simple.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/simple/simple.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -1794,7 +1794,8 @@ NULL, /* new_xfer */ NULL, /* offline_message */ NULL, /* whiteboard_prpl_ops */ - simple_send_raw, /* send_raw */ + simple_send_raw, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -3878,7 +3878,8 @@ yahoo_new_xfer, yahoo_offline_message, /* offline_message */ &yahoo_whiteboard_prpl_ops, - NULL /* send_raw */ + NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static GaimPluginInfo info = Modified: trunk/libgaim/protocols/zephyr/zephyr.c =================================================================== --- trunk/libgaim/protocols/zephyr/zephyr.c 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/protocols/zephyr/zephyr.c 2006-12-07 05:57:53 UTC (rev 17909) @@ -2916,6 +2916,7 @@ NULL, /* offline_message */ NULL, /* whiteboard_prpl_ops */ NULL, /* send_raw */ + NULL, /* roomlist_room_serialize */ }; static GaimPluginInfo info = { Modified: trunk/libgaim/prpl.h =================================================================== --- trunk/libgaim/prpl.h 2006-12-07 04:25:29 UTC (rev 17908) +++ trunk/libgaim/prpl.h 2006-12-07 05:57:53 UTC (rev 17909) @@ -301,6 +301,9 @@ /* For use in plugins that may understand the underlying protocol */ int (*send_raw)(GaimConnection *gc, const char *buf, int len); + + /* room list serialize */ + char *(*roomlist_room_serialize)(GaimRoomlistRoom *room); }; #define GAIM_IS_PROTOCOL_PLUGIN(plugin) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |