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: <fac...@us...> - 2006-12-07 04:32:31
|
Revision: 17908 http://svn.sourceforge.net/gaim/?rev=17908&view=rev Author: faceprint Date: 2006-12-06 20:25:29 -0800 (Wed, 06 Dec 2006) Log Message: ----------- maybe fix 1608655 Modified Paths: -------------- trunk/libgaim/xmlnode.c Modified: trunk/libgaim/xmlnode.c =================================================================== --- trunk/libgaim/xmlnode.c 2006-12-07 04:04:11 UTC (rev 17907) +++ trunk/libgaim/xmlnode.c 2006-12-07 04:25:29 UTC (rev 17908) @@ -294,9 +294,12 @@ g_string_append_printf(text, "<%s", node_name); if (node->namespace) { - char *namespace = g_markup_escape_text(node->namespace, -1); - g_string_append_printf(text, " xmlns='%s'", namespace); - g_free(namespace); + if(!node->parent || !node->parent->namespace || strcmp(node->namespace, node->parent->namespace)) + { + char *namespace = g_markup_escape_text(node->namespace, -1); + g_string_append_printf(text, " xmlns='%s'", namespace); + g_free(namespace); + } } for(c = node->child; c; c = c->next) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 04:11:16
|
Revision: 17907 http://svn.sourceforge.net/gaim/?rev=17907&view=rev Author: sadrul Date: 2006-12-06 20:04:11 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Mostly whitespace cleanups. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-07 03:40:27 UTC (rev 17906) +++ trunk/gtk/gtkstatusbox.c 2006-12-07 04:04:11 UTC (rev 17907) @@ -773,7 +773,6 @@ gtk_tree_row_reference_free(status_box->active_row); if (path) { /* path should never be NULL */ status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); - gaim_debug_fatal("XXXX", "%s\n", gtk_tree_path_to_string(path)); gtk_tree_path_free(path); } else status_box->active_row = NULL; @@ -1519,57 +1518,56 @@ text_rend = gtk_cell_renderer_text_new(); icon_rend = gtk_cell_renderer_pixbuf_new(); - - status_box->popup_window = gtk_window_new (GTK_WINDOW_POPUP); + status_box->popup_window = gtk_window_new (GTK_WINDOW_POPUP); - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (status_box)); - if (GTK_IS_WINDOW (toplevel)) { - gtk_window_set_transient_for (GTK_WINDOW (status_box->popup_window), - GTK_WINDOW (toplevel)); - } + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (status_box)); + if (GTK_IS_WINDOW (toplevel)) { + gtk_window_set_transient_for (GTK_WINDOW (status_box->popup_window), + GTK_WINDOW (toplevel)); + } - gtk_window_set_resizable (GTK_WINDOW (status_box->popup_window), FALSE); - gtk_window_set_screen (GTK_WINDOW (status_box->popup_window), - gtk_widget_get_screen (GTK_WIDGET (status_box))); - status_box->popup_frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (status_box->popup_frame), - GTK_SHADOW_ETCHED_IN); - gtk_container_add (GTK_CONTAINER (status_box->popup_window), - status_box->popup_frame); + gtk_window_set_resizable (GTK_WINDOW (status_box->popup_window), FALSE); + gtk_window_set_screen (GTK_WINDOW (status_box->popup_window), + gtk_widget_get_screen (GTK_WIDGET (status_box))); + status_box->popup_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (status_box->popup_frame), + GTK_SHADOW_ETCHED_IN); + gtk_container_add (GTK_CONTAINER (status_box->popup_window), + status_box->popup_frame); - gtk_widget_show (status_box->popup_frame); + gtk_widget_show (status_box->popup_frame); - status_box->scrolled_window = gtk_scrolled_window_new (NULL, NULL); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), - GTK_POLICY_NEVER, - GTK_POLICY_NEVER); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (status_box->scrolled_window), - GTK_SHADOW_NONE); + status_box->scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (status_box->scrolled_window); - - gtk_container_add (GTK_CONTAINER (status_box->popup_frame), - status_box->scrolled_window); - - status_box->tree_view = gtk_tree_view_new (); - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (status_box->tree_view)); - gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (status_box->tree_view), - FALSE); - gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (status_box->tree_view), - TRUE); - gtk_tree_view_set_model (GTK_TREE_VIEW (status_box->tree_view), - GTK_TREE_MODEL(status_box->dropdown_store)); - status_box->column = gtk_tree_view_column_new (); - gtk_tree_view_append_column (GTK_TREE_VIEW (status_box->tree_view), - status_box->column); - gtk_tree_view_column_pack_start(status_box->column, icon_rend, FALSE); - gtk_tree_view_column_pack_start(status_box->column, text_rend, TRUE); - gtk_tree_view_column_set_attributes(status_box->column, icon_rend, "pixbuf", ICON_COLUMN, NULL); - gtk_tree_view_column_set_attributes(status_box->column, text_rend, "markup", TEXT_COLUMN, NULL); - gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view); - gtk_widget_show(status_box->tree_view); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + GTK_POLICY_NEVER, + GTK_POLICY_NEVER); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (status_box->scrolled_window), + GTK_SHADOW_NONE); + + gtk_widget_show (status_box->scrolled_window); + + gtk_container_add (GTK_CONTAINER (status_box->popup_frame), + status_box->scrolled_window); + + status_box->tree_view = gtk_tree_view_new (); + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (status_box->tree_view)); + gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (status_box->tree_view), + FALSE); + gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (status_box->tree_view), + TRUE); + gtk_tree_view_set_model (GTK_TREE_VIEW (status_box->tree_view), + GTK_TREE_MODEL(status_box->dropdown_store)); + status_box->column = gtk_tree_view_column_new (); + gtk_tree_view_append_column (GTK_TREE_VIEW (status_box->tree_view), + status_box->column); + gtk_tree_view_column_pack_start(status_box->column, icon_rend, FALSE); + gtk_tree_view_column_pack_start(status_box->column, text_rend, TRUE); + gtk_tree_view_column_set_attributes(status_box->column, icon_rend, "pixbuf", ICON_COLUMN, NULL); + gtk_tree_view_column_set_attributes(status_box->column, text_rend, "markup", TEXT_COLUMN, NULL); + gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view); + gtk_widget_show(status_box->tree_view); gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(status_box->tree_view), gaim_gtk_tree_view_search_equal_func, NULL, NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-07 03:50:38
|
Revision: 17905 http://svn.sourceforge.net/gaim/?rev=17905&view=rev Author: thekingant Date: 2006-12-06 19:37:13 -0800 (Wed, 06 Dec 2006) Log Message: ----------- I think gdk pixbuf recognizes "jpeg" and not "jpg" Also, is there any reason that Gaim didn't think that gif and jpeg were valid for msn and yahoo? It seems like that would cause us to convert people's icons to pngs, with possible negative consequences Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/msn/msn.c trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-12-07 02:48:08 UTC (rev 17904) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-12-07 03:37:13 UTC (rev 17905) @@ -1844,7 +1844,7 @@ OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png,jpg,gif", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ + {"png,gif,jpeg", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ jabber_list_icon, /* list_icon */ jabber_list_emblems, /* list_emblems */ jabber_status_text, /* status_text */ Modified: trunk/libgaim/protocols/msn/msn.c =================================================================== --- trunk/libgaim/protocols/msn/msn.c 2006-12-07 02:48:08 UTC (rev 17904) +++ trunk/libgaim/protocols/msn/msn.c 2006-12-07 03:37:13 UTC (rev 17905) @@ -1955,7 +1955,7 @@ OPT_PROTO_MAIL_CHECK, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ + {"png,gif,jpeg", 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 */ Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-07 02:48:08 UTC (rev 17904) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-12-07 03:37:13 UTC (rev 17905) @@ -3821,7 +3821,7 @@ OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC, NULL, /* user_splits */ NULL, /* protocol_options */ - {"png", 96, 96, 96, 96, GAIM_ICON_SCALE_SEND}, + {"png,gif,jpeg", 96, 96, 96, 96, GAIM_ICON_SCALE_SEND}, yahoo_list_icon, yahoo_list_emblems, yahoo_status_text, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 03:48:05
|
Revision: 17906 http://svn.sourceforge.net/gaim/?rev=17906&view=rev Author: sadrul Date: 2006-12-06 19:40:27 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Fix the compile warnings. Make sure the popup has the right item selected. Fix a few issues when the statusbox was not being updated properly. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-07 03:37:13 UTC (rev 17905) +++ trunk/gtk/gtkstatusbox.c 2006-12-07 03:40:27 UTC (rev 17906) @@ -202,7 +202,7 @@ path = gtk_tree_path_new_from_indices(status_no, -1); if (status_box->active_row) gtk_tree_row_reference_free(status_box->active_row); - status_box->active_row = gtk_tree_row_reference_new(status_box->dropdown_store, path); + status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); gtk_tree_path_free(path); message = gaim_status_get_attr_string(newstatus, "message"); @@ -692,6 +692,7 @@ GaimStatusPrimitive primitive; gint index; const char *message; + GtkTreePath *path = NULL; /* this function is inappropriate for ones with accounts */ if (status_box->account) @@ -715,14 +716,8 @@ (primitive == GAIM_STATUS_INVISIBLE) || (primitive == GAIM_STATUS_OFFLINE)) && (!gaim_savedstatus_has_substatuses(saved_status))) { - GtkTreePath *path; index = get_statusbox_index(status_box, saved_status); path = gtk_tree_path_new_from_indices(index, -1); - if (status_box->active_row) - gtk_tree_row_reference_free(status_box->active_row); - status_box->active_row = gtk_tree_row_reference_new(status_box->dropdown_store, path); - gtk_tree_path_free(path); - } else { @@ -730,11 +725,6 @@ GtkGaimStatusBoxItemType type; gpointer data; - /* Unset the active item */ - if (status_box->active_row) - gtk_tree_row_reference_free(status_box->active_row); - status_box->active_row = NULL; - /* If this saved status is in the list store, then set it as the active item */ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(status_box->dropdown_store), &iter)) { @@ -761,8 +751,7 @@ || !strcmp(name, acct_status_name)) { /* Found! */ - // gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); - + path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); g_free(name); break; } @@ -772,7 +761,7 @@ (GPOINTER_TO_INT(data) == gaim_savedstatus_get_creation_time(saved_status))) { /* Found! */ - // gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); + path = gtk_tree_model_get_path(GTK_TREE_MODEL(status_box->dropdown_store), &iter); break; } } @@ -780,6 +769,15 @@ } } + if (status_box->active_row) + gtk_tree_row_reference_free(status_box->active_row); + if (path) { /* path should never be NULL */ + status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); + gaim_debug_fatal("XXXX", "%s\n", gtk_tree_path_to_string(path)); + gtk_tree_path_free(path); + } else + status_box->active_row = NULL; + message = gaim_savedstatus_get_message(saved_status); if (!gaim_savedstatus_is_transient(saved_status) || !message || !*message) { @@ -1006,13 +1004,14 @@ if (pixbuf) g_object_unref(G_OBJECT(pixbuf)); status_menu_refresh_iter(status_box); + gtk_gaim_status_box_refresh(status_box); } else { add_account_statuses(status_box, status_box->account); update_to_reflect_account_status(status_box, status_box->account, gaim_account_get_active_status(status_box->account)); } - gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), status_box->dropdown_store); + gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), GTK_TREE_MODEL(status_box->dropdown_store)); gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); } @@ -1053,8 +1052,10 @@ if (status_box->account != NULL) update_to_reflect_account_status(status_box, status_box->account, gaim_account_get_active_status(status_box->account)); - else + else { status_menu_refresh_iter(status_box); + gtk_gaim_status_box_refresh(status_box); + } return TRUE; } @@ -1253,6 +1254,7 @@ } } +static gboolean popup_grab_on_window (GdkWindow *window, guint32 activate_time, gboolean grab_keyboard) @@ -1298,6 +1300,12 @@ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button), TRUE); + if (box->active_row) { + GtkTreePath *path = gtk_tree_row_reference_get_path(box->active_row); + GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (box->tree_view)); + gtk_tree_selection_unselect_all(sel); + gtk_tree_selection_select_path(sel, path); + } } static void @@ -1552,7 +1560,7 @@ gtk_tree_view_set_hover_selection (GTK_TREE_VIEW (status_box->tree_view), TRUE); gtk_tree_view_set_model (GTK_TREE_VIEW (status_box->tree_view), - status_box->dropdown_store); + GTK_TREE_MODEL(status_box->dropdown_store)); status_box->column = gtk_tree_view_column_new (); gtk_tree_view_append_column (GTK_TREE_VIEW (status_box->tree_view), status_box->column); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-07 02:55:22
|
Revision: 17904 http://svn.sourceforge.net/gaim/?rev=17904&view=rev Author: sadrul Date: 2006-12-06 18:48:08 -0800 (Wed, 06 Dec 2006) Log Message: ----------- I was getting a scrollbar in the statusbox with only one line of message. This fixes that. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-06 23:05:51 UTC (rev 17903) +++ trunk/gtk/gtkstatusbox.c 2006-12-07 02:48:08 UTC (rev 17904) @@ -1661,7 +1661,7 @@ /* If the gtkimhtml is visible, then add some additional padding */ gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req); if (box_req.height > 1) - requisition->height += box_req.height + border_width; + requisition->height += box_req.height + border_width * 2; requisition->width = 1; } @@ -1726,7 +1726,7 @@ box_alc.height = MAX(1, ((allocation->height - req.height) - (border_width*2))); box_alc.x += border_width; box_alc.y += req.height + border_width; - gtk_widget_size_allocate((GTK_GAIM_STATUS_BOX(widget))->vbox, &box_alc); + gtk_widget_size_allocate(status_box->vbox, &box_alc); parent_alc = *allocation; parent_alc.height = MAX(1,req.height - (border_width *2)); @@ -2201,6 +2201,7 @@ wrapped_lines = 1; gtk_text_buffer_get_start_iter(buffer, &iter); + gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline); while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter)) wrapped_lines++; @@ -2210,9 +2211,6 @@ lines = MIN(lines, 4); wrapped_lines = MIN(wrapped_lines, 4); - gtk_text_buffer_get_start_iter(buffer, &iter); - gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline); - pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(status_box->imhtml)); pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(status_box->imhtml)); pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(status_box->imhtml)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-06 23:05:55
|
Revision: 17903 http://svn.sourceforge.net/gaim/?rev=17903&view=rev Author: sadrul Date: 2006-12-06 15:05:51 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Update the Changelog.API. Thanks to ari for noticing. Modified Paths: -------------- trunk/ChangeLog.API Modified: trunk/ChangeLog.API =================================================================== --- trunk/ChangeLog.API 2006-12-06 18:04:20 UTC (rev 17902) +++ trunk/ChangeLog.API 2006-12-06 23:05:51 UTC (rev 17903) @@ -341,6 +341,8 @@ * gaim_conv_send_confirm() * GaimConversationUiOps.send_confirm * gaim_gtk_roomlist_dialog_show_with_account + * gaim_gtk_tree_view_search_equal_func to be used with + gtk_tree_view_set_search_equal_func Signals - Changed: (See the Doxygen docs for details on all signals.) * Signal propagation now stops after a handler returns a non-NULL value. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-06 18:04:25
|
Revision: 17902 http://svn.sourceforge.net/gaim/?rev=17902&view=rev Author: thekingant Date: 2006-12-06 10:04:20 -0800 (Wed, 06 Dec 2006) Log Message: ----------- I tested my changes from yesterday and they caused uns crashy boom. We were trying to free some proxy_connect_data but it had already been set to NULL (because one of the two parallel connections failed immediately, and the second one succeeded). Modified Paths: -------------- trunk/libgaim/protocols/oscar/peer.c Modified: trunk/libgaim/protocols/oscar/peer.c =================================================================== --- trunk/libgaim/protocols/oscar/peer.c 2006-12-06 07:24:41 UTC (rev 17901) +++ trunk/libgaim/protocols/oscar/peer.c 2006-12-06 18:04:20 UTC (rev 17902) @@ -528,10 +528,14 @@ gaim_timeout_remove(conn->connect_timeout_timer); conn->connect_timeout_timer = 0; - if (verified) { + if (conn->client_connect_data != NULL) + { gaim_proxy_connect_cancel(conn->client_connect_data); conn->client_connect_data = NULL; - } else { + } + + if (conn->verified_connect_data != NULL) + { gaim_proxy_connect_cancel(conn->verified_connect_data); conn->verified_connect_data = NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-12-06 07:24:45
|
Revision: 17901 http://svn.sourceforge.net/gaim/?rev=17901&view=rev Author: sadrul Date: 2006-12-05 23:24:41 -0800 (Tue, 05 Dec 2006) Log Message: ----------- Rename gtkblist.c:_search_func to gtkutils.c:gaim_gtk_tree_view_search_equal_func. Use this in the buddylist, the statusbox dropdown and in the plugins dialog. This can also be used in the smiley-theme-list. Process Escape and Return key-presses in the statusbox dropdown. seanegan: I hope I didn't step on your toes O:-) Modified Paths: -------------- trunk/gtk/gtkblist.c trunk/gtk/gtkplugin.c trunk/gtk/gtkstatusbox.c trunk/gtk/gtkutils.c trunk/gtk/gtkutils.h Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-12-06 02:15:28 UTC (rev 17900) +++ trunk/gtk/gtkblist.c 2006-12-06 07:24:41 UTC (rev 17901) @@ -3622,111 +3622,6 @@ gaim_gtk_blist_sort_method_set(val); } -/* - * "This is so dead sexy." - * "Two thumbs up." - * "Best movie of the year." - * - * This is the function that handles CTRL+F searching in the buddy list. - * It finds the top-most buddy/group/chat/whatever containing the - * entered string. - * - * It's somewhat ineffecient, because we strip all the HTML from the - * "name" column of the buddy list (because the GtkTreeModel does not - * contain the screen name in a non-markedup format). But the alternative - * is to add an extra column to the GtkTreeModel. And this function is - * used rarely, so it shouldn't matter TOO much. - */ -static gboolean -_search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data) -{ - gchar *enteredstring; - gchar *tmp; - gchar *withmarkup; - gchar *nomarkup; - gchar *normalized; - gboolean result; - size_t i; - size_t len; - PangoLogAttr *log_attrs; - gchar *word; - - if (strcasecmp(key, "Global Thermonuclear War") == 0) - { - gaim_notify_info(NULL, "WOPR", - "Wouldn't you prefer a nice game of chess?", NULL); - return FALSE; - } - - gtk_tree_model_get(model, iter, column, &withmarkup, -1); - - tmp = g_utf8_normalize(key, -1, G_NORMALIZE_DEFAULT); - enteredstring = g_utf8_casefold(tmp, -1); - g_free(tmp); - - nomarkup = gaim_markup_strip_html(withmarkup); - tmp = g_utf8_normalize(nomarkup, -1, G_NORMALIZE_DEFAULT); - g_free(nomarkup); - normalized = g_utf8_casefold(tmp, -1); - g_free(tmp); - - if (gaim_str_has_prefix(normalized, enteredstring)) - { - g_free(withmarkup); - g_free(enteredstring); - g_free(normalized); - return FALSE; - } - - - /* Use Pango to separate by words. */ - len = g_utf8_strlen(normalized, -1); - log_attrs = g_new(PangoLogAttr, len + 1); - - pango_get_log_attrs(normalized, strlen(normalized), -1, NULL, log_attrs, len + 1); - - word = normalized; - result = TRUE; - for (i = 0; i < (len - 1) ; i++) - { - if (log_attrs[i].is_word_start && - gaim_str_has_prefix(word, enteredstring)) - { - result = FALSE; - break; - } - word = g_utf8_next_char(word); - } - g_free(log_attrs); - -/* The non-Pango version. */ -#if 0 - word = normalized; - result = TRUE; - while (word[0] != '\0') - { - gunichar c = g_utf8_get_char(word); - if (!g_unichar_isalnum(c)) - { - word = g_utf8_find_next_char(word, NULL); - if (gaim_str_has_prefix(word, enteredstring)) - { - result = FALSE; - break; - } - } - else - word = g_utf8_find_next_char(word, NULL); - } -#endif - - g_free(withmarkup); - g_free(enteredstring); - g_free(normalized); - - return result; -} - static void account_modified(GaimAccount *account, GaimGtkBuddyList *gtkblist) { GList *list; @@ -4173,7 +4068,7 @@ /* Enable CTRL+F searching */ gtk_tree_view_set_search_column(GTK_TREE_VIEW(gtkblist->treeview), NAME_COLUMN); - gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), _search_func, NULL, NULL); + gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview), gaim_gtk_tree_view_search_equal_func, NULL, NULL); gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sw, TRUE, TRUE, 0); gtk_container_add(GTK_CONTAINER(sw), gtkblist->treeview); Modified: trunk/gtk/gtkplugin.c =================================================================== --- trunk/gtk/gtkplugin.c 2006-12-06 02:15:28 UTC (rev 17900) +++ trunk/gtk/gtkplugin.c 2006-12-06 07:24:41 UTC (rev 17901) @@ -599,6 +599,9 @@ gtk_tree_view_column_set_sort_column_id(col, 1); g_object_unref(G_OBJECT(ls)); gtk_container_add(GTK_CONTAINER(sw), event_view); + gtk_tree_view_set_search_column(GTK_TREE_VIEW(event_view), 1); + gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(event_view), + gaim_gtk_tree_view_search_equal_func, NULL, NULL); expander = gtk_expander_new(_("<b>Plugin Details</b>")); gtk_expander_set_use_markup(GTK_EXPANDER(expander), TRUE); Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-06 02:15:28 UTC (rev 17900) +++ trunk/gtk/gtkstatusbox.c 2006-12-06 07:24:41 UTC (rev 17901) @@ -1013,6 +1013,7 @@ gaim_account_get_active_status(status_box->account)); } gtk_tree_view_set_model(GTK_TREE_VIEW(status_box->tree_view), status_box->dropdown_store); + gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); } static gboolean combo_box_scroll_event_cb(GtkWidget *w, GdkEventScroll *event, GtkIMHtml *imhtml) @@ -1397,6 +1398,18 @@ buddy_icon_set_cb(value, (GtkGaimStatusBox*) data); } +static void +treeview_activate_current_selection(GtkGaimStatusBox *status_box, GtkTreePath *path) +{ + if (status_box->active_row) + gtk_tree_row_reference_free(status_box->active_row); + + status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); + + gaim_gtk_status_box_popdown (status_box); + gtk_gaim_status_box_changed(status_box); +} + static gboolean treeview_button_release_cb(GtkWidget *widget, GdkEventButton *event, GtkGaimStatusBox *status_box) { @@ -1426,23 +1439,40 @@ event->x, event->y, &path, NULL, NULL, NULL); - - + if (!ret) return TRUE; /* clicked outside window? */ - if (status_box->active_row) - gtk_tree_row_reference_free(status_box->active_row); - - status_box->active_row = gtk_tree_row_reference_new(GTK_TREE_MODEL(status_box->dropdown_store), path); + treeview_activate_current_selection(status_box, path); gtk_tree_path_free (path); - - gaim_gtk_status_box_popdown (status_box); - gtk_gaim_status_box_changed(status_box); return TRUE; } +static gboolean +treeview_key_press_event(GtkWidget *widget, + GdkEventKey *event, GtkGaimStatusBox *box) +{ + if (box->popup_in_progress) { + if (event->keyval == GDK_Escape) { + gaim_gtk_status_box_popdown(box); + return TRUE; + } else if (event->keyval == GDK_Return) { + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(box->tree_view)); + GtkTreeIter iter; + GtkTreePath *path; + + if (gtk_tree_selection_get_selected(sel, NULL, &iter)) { + path = gtk_tree_model_get_path(GTK_TREE_MODEL(box->dropdown_store), &iter); + treeview_activate_current_selection(box, path); + gtk_tree_path_free (path); + return TRUE; + } + } + } + return FALSE; +} + static void gtk_gaim_status_box_init (GtkGaimStatusBox *status_box) { @@ -1528,10 +1558,13 @@ status_box->column); gtk_tree_view_column_pack_start(status_box->column, icon_rend, FALSE); gtk_tree_view_column_pack_start(status_box->column, text_rend, TRUE); - gtk_tree_view_column_set_attributes(GTK_CELL_LAYOUT(status_box->column), icon_rend, "pixbuf", ICON_COLUMN, NULL); - gtk_tree_view_column_set_attributes(GTK_CELL_LAYOUT(status_box->column), text_rend, "markup", TEXT_COLUMN, NULL); + gtk_tree_view_column_set_attributes(status_box->column, icon_rend, "pixbuf", ICON_COLUMN, NULL); + gtk_tree_view_column_set_attributes(status_box->column, text_rend, "markup", TEXT_COLUMN, NULL); gtk_container_add(GTK_CONTAINER(status_box->scrolled_window), status_box->tree_view); gtk_widget_show(status_box->tree_view); + gtk_tree_view_set_search_column(GTK_TREE_VIEW(status_box->tree_view), TEXT_COLUMN); + gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(status_box->tree_view), + gaim_gtk_tree_view_search_equal_func, NULL, NULL); #if GTK_CHECK_VERSION(2, 6, 0) g_object_set(text_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); @@ -1582,6 +1615,7 @@ g_signal_connect(G_OBJECT(status_box->imhtml), "scroll_event", G_CALLBACK(imhtml_scroll_event_cb), status_box->imhtml); g_signal_connect(G_OBJECT(status_box->popup_window), "button_release_event", G_CALLBACK(treeview_button_release_cb), status_box); + g_signal_connect(G_OBJECT(status_box->popup_window), "key_press_event", G_CALLBACK(treeview_key_press_event), status_box); #if GTK_CHECK_VERSION(2,6,0) gtk_tree_view_set_row_separator_func(GTK_TREE_VIEW(status_box->tree_view), dropdown_store_row_separator_func, NULL, NULL); Modified: trunk/gtk/gtkutils.c =================================================================== --- trunk/gtk/gtkutils.c 2006-12-06 02:15:28 UTC (rev 17900) +++ trunk/gtk/gtkutils.c 2006-12-06 07:24:41 UTC (rev 17901) @@ -2964,3 +2964,111 @@ return vbox; } + +/* + * "This is so dead sexy." + * "Two thumbs up." + * "Best movie of the year." + * + * This is the function that handles CTRL+F searching in the buddy list. + * It finds the top-most buddy/group/chat/whatever containing the + * entered string. + * + * It's somewhat ineffecient, because we strip all the HTML from the + * "name" column of the buddy list (because the GtkTreeModel does not + * contain the screen name in a non-markedup format). But the alternative + * is to add an extra column to the GtkTreeModel. And this function is + * used rarely, so it shouldn't matter TOO much. + */ +gboolean gaim_gtk_tree_view_search_equal_func(GtkTreeModel *model, gint column, + const gchar *key, GtkTreeIter *iter, gpointer data) +{ + gchar *enteredstring; + gchar *tmp; + gchar *withmarkup; + gchar *nomarkup; + gchar *normalized; + gboolean result; + size_t i; + size_t len; + PangoLogAttr *log_attrs; + gchar *word; + + if (strcasecmp(key, "Global Thermonuclear War") == 0) + { + gaim_notify_info(NULL, "WOPR", + "Wouldn't you prefer a nice game of chess?", NULL); + return FALSE; + } + + gtk_tree_model_get(model, iter, column, &withmarkup, -1); + if (withmarkup == NULL) /* This is probably a separator */ + return TRUE; + + tmp = g_utf8_normalize(key, -1, G_NORMALIZE_DEFAULT); + enteredstring = g_utf8_casefold(tmp, -1); + g_free(tmp); + + nomarkup = gaim_markup_strip_html(withmarkup); + tmp = g_utf8_normalize(nomarkup, -1, G_NORMALIZE_DEFAULT); + g_free(nomarkup); + normalized = g_utf8_casefold(tmp, -1); + g_free(tmp); + + if (gaim_str_has_prefix(normalized, enteredstring)) + { + g_free(withmarkup); + g_free(enteredstring); + g_free(normalized); + return FALSE; + } + + + /* Use Pango to separate by words. */ + len = g_utf8_strlen(normalized, -1); + log_attrs = g_new(PangoLogAttr, len + 1); + + pango_get_log_attrs(normalized, strlen(normalized), -1, NULL, log_attrs, len + 1); + + word = normalized; + result = TRUE; + for (i = 0; i < (len - 1) ; i++) + { + if (log_attrs[i].is_word_start && + gaim_str_has_prefix(word, enteredstring)) + { + result = FALSE; + break; + } + word = g_utf8_next_char(word); + } + g_free(log_attrs); + +/* The non-Pango version. */ +#if 0 + word = normalized; + result = TRUE; + while (word[0] != '\0') + { + gunichar c = g_utf8_get_char(word); + if (!g_unichar_isalnum(c)) + { + word = g_utf8_find_next_char(word, NULL); + if (gaim_str_has_prefix(word, enteredstring)) + { + result = FALSE; + break; + } + } + else + word = g_utf8_find_next_char(word, NULL); + } +#endif + + g_free(withmarkup); + g_free(enteredstring); + g_free(normalized); + + return result; +} + Modified: trunk/gtk/gtkutils.h =================================================================== --- trunk/gtk/gtkutils.h 2006-12-06 02:15:28 UTC (rev 17900) +++ trunk/gtk/gtkutils.h 2006-12-06 07:24:41 UTC (rev 17901) @@ -490,8 +490,6 @@ GError **error); #endif -#endif /* _GAIM_GTKUTILS_H_ */ - /** * Set or unset a custom buddyicon for a user. * @@ -523,3 +521,17 @@ void *gaim_gtk_make_mini_dialog(GaimConnection *handle, const char* stock_id, const char *primary, const char *secondary, void *user_data, ...); + +/** + * This is a callback function to be used for Ctrl+F searching in treeviews. + * Sample Use: + * gtk_tree_view_set_search_equal_func(treeview, + * gaim_gtk_tree_view_search_equal_func, + * search_data, search_data_destroy_cb); + * + */ +gboolean gaim_gtk_tree_view_search_equal_func(GtkTreeModel *model, gint column, + const gchar *key, GtkTreeIter *iter, gpointer data); + +#endif /* _GAIM_GTKUTILS_H_ */ + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-06 02:15:29
|
Revision: 17900 http://svn.sourceforge.net/gaim/?rev=17900&view=rev Author: seanegan Date: 2006-12-05 18:15:28 -0800 (Tue, 05 Dec 2006) Log Message: ----------- bugfix Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-06 01:29:59 UTC (rev 17899) +++ trunk/gtk/gtkstatusbox.c 2006-12-06 02:15:28 UTC (rev 17900) @@ -1406,7 +1406,7 @@ if (ewidget != status_box->tree_view) { if (ewidget == status_box->toggle_button && - !status_box->popup_in_progress && + status_box->popup_in_progress && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (status_box->toggle_button))) { gaim_gtk_status_box_popdown (status_box); return TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-06 01:30:10
|
Revision: 17899 http://svn.sourceforge.net/gaim/?rev=17899&view=rev Author: thekingant Date: 2006-12-05 17:29:59 -0800 (Tue, 05 Dec 2006) Log Message: ----------- Some touchups: * If one of the parallel connection attempts fails immediately (i.e. does not time out) then don't cancel the other one. * Make sure we don't continue on to step 2 of the peer connection process after we kick off the parallel gaim_proxy_connects(). It looks like this would happen most of the time, because the connect_timeout_timer would be added for the verified ip, so it would NOT be added for the client ip, and so we wouldn't hit the "return" call because it happens to be in the same block as the second gaim_timeout_add() call. * Add the connection timeout timer even if the gaim_proxy_connect() to the verified ip returns NULL for some crazy reason. I didn't actually test any of this. I should probably do that when I get home. Modified Paths: -------------- trunk/libgaim/protocols/oscar/peer.c Modified: trunk/libgaim/protocols/oscar/peer.c =================================================================== --- trunk/libgaim/protocols/oscar/peer.c 2006-12-06 00:57:19 UTC (rev 17898) +++ trunk/libgaim/protocols/oscar/peer.c 2006-12-06 01:29:59 UTC (rev 17899) @@ -513,16 +513,21 @@ conn->verified_connect_data = NULL; else conn->client_connect_data = NULL; - - gaim_timeout_remove(conn->connect_timeout_timer); - conn->connect_timeout_timer = 0; if (source < 0) { - peer_connection_trynext(conn); + if ((conn->verified_connect_data == NULL) && + (conn->client_connect_data == NULL)) + { + /* Our parallel connection attemps have both failed. */ + peer_connection_trynext(conn); + } return; } - + + gaim_timeout_remove(conn->connect_timeout_timer); + conn->connect_timeout_timer = 0; + if (verified) { gaim_proxy_connect_cancel(conn->client_connect_data); conn->client_connect_data = NULL; @@ -530,7 +535,7 @@ gaim_proxy_connect_cancel(conn->verified_connect_data); conn->verified_connect_data = NULL; } - + conn->fd = source; peer_connection_finalize_connection(conn); @@ -541,7 +546,7 @@ { peer_connection_common_established_cb(data, source, error_message, TRUE); } - + static void peer_connection_client_established_cb(gpointer data, gint source, const gchar *error_message) { @@ -688,7 +693,6 @@ * too long for a user to wait to send a file. I'm also parallelizing * requests when possible. The longest we should have to wait now is 10 * seconds. We shouldn't make it shorter than this. - * */ static gboolean peer_connection_tooktoolong(gpointer data) @@ -697,7 +701,7 @@ conn = data; - gaim_debug_info("oscar", "Peer connection timed out after 15 seconds. " + gaim_debug_info("oscar", "Peer connection timed out after 5 seconds. " "Trying next method...\n"); peer_connection_close(conn); @@ -749,12 +753,6 @@ conn->verified_connect_data = gaim_proxy_connect(NULL, account, conn->verifiedip, conn->port, peer_connection_verified_established_cb, conn); - if (conn->verified_connect_data != NULL) - { - /* Connecting... */ - conn->connect_timeout_timer = gaim_timeout_add(5000, - peer_connection_tooktoolong, conn); - } if ((conn->verifiedip == NULL) || strcmp(conn->verifiedip, conn->clientip)) @@ -762,14 +760,16 @@ conn->client_connect_data = gaim_proxy_connect(NULL, account, conn->clientip, conn->port, peer_connection_client_established_cb, conn); - if (conn->connect_timeout_timer == 0 && conn->verified_connect_data != NULL) - { - /* Connecting... */ - conn->connect_timeout_timer = gaim_timeout_add(5000, - peer_connection_tooktoolong, conn); - return; - } } + + if ((conn->verified_connect_data != NULL) || + (conn->client_connect_data != NULL)) + { + /* Connecting... */ + conn->connect_timeout_timer = gaim_timeout_add(5000, + peer_connection_tooktoolong, conn); + return; + } } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-06 00:57:34
|
Revision: 17898 http://svn.sourceforge.net/gaim/?rev=17898&view=rev Author: seanegan Date: 2006-12-05 16:57:19 -0800 (Tue, 05 Dec 2006) Log Message: ----------- force statusbox up to 30px all the time Modified Paths: -------------- trunk/gtk/gtkstatusbox.c Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-12-06 00:39:27 UTC (rev 17897) +++ trunk/gtk/gtkstatusbox.c 2006-12-06 00:57:19 UTC (rev 17898) @@ -1622,8 +1622,7 @@ gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->toggle_button, requisition); /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ - if ( gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) - requisition->height = MAX(requisition->height, 30 + (border_width*2)); + requisition->height = MAX(requisition->height, 30 + (border_width*2)); /* If the gtkimhtml is visible, then add some additional padding */ gtk_widget_size_request(GTK_GAIM_STATUS_BOX(widget)->vbox, &box_req); @@ -1685,8 +1684,7 @@ gtk_widget_size_request(status_box->toggle_button, &req); /* Make this icon the same size as other buddy icons in the list; unless it already wants to be bigger */ - if ( gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) - req.height = MAX(req.height, 30 + (border_width*2)); + req.height = MAX(req.height, 30 + (border_width*2)); box_alc = *allocation; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-12-06 00:39:28
|
Revision: 17897 http://svn.sourceforge.net/gaim/?rev=17897&view=rev Author: seanegan Date: 2006-12-05 16:39:27 -0800 (Tue, 05 Dec 2006) Log Message: ----------- In the worst case, OSCAR file transfer waited 60 seconds before proxying. I've brought it down to 10 Modified Paths: -------------- trunk/libgaim/protocols/oscar/peer.c trunk/libgaim/protocols/oscar/peer.h trunk/libgaim/protocols/oscar/peer_proxy.c Modified: trunk/libgaim/protocols/oscar/peer.c =================================================================== --- trunk/libgaim/protocols/oscar/peer.c 2006-12-05 06:23:43 UTC (rev 17896) +++ trunk/libgaim/protocols/oscar/peer.c 2006-12-06 00:39:27 UTC (rev 17897) @@ -139,12 +139,18 @@ else if (conn->type == OSCAR_CAPABILITY_SENDFILE) peer_oft_close(conn); - if (conn->connect_data != NULL) + if (conn->verified_connect_data != NULL) { - gaim_proxy_connect_cancel(conn->connect_data); - conn->connect_data = NULL; + gaim_proxy_connect_cancel(conn->verified_connect_data); + conn->verified_connect_data = NULL; } + if (conn->client_connect_data != NULL) + { + gaim_proxy_connect_cancel(conn->client_connect_data); + conn->client_connect_data = NULL; + } + if (conn->listen_data != NULL) { gaim_network_listen_cancel(conn->listen_data); @@ -497,13 +503,17 @@ * either connected or failed to connect. */ static void -peer_connection_established_cb(gpointer data, gint source, const gchar *error_message) +peer_connection_common_established_cb(gpointer data, gint source, const gchar *error_message, gboolean verified) { PeerConnection *conn; conn = data; - conn->connect_data = NULL; + if (verified) + conn->verified_connect_data = NULL; + else + conn->client_connect_data = NULL; + gaim_timeout_remove(conn->connect_timeout_timer); conn->connect_timeout_timer = 0; @@ -512,12 +522,32 @@ peer_connection_trynext(conn); return; } - + + if (verified) { + gaim_proxy_connect_cancel(conn->client_connect_data); + conn->client_connect_data = NULL; + } else { + gaim_proxy_connect_cancel(conn->verified_connect_data); + conn->verified_connect_data = NULL; + } + conn->fd = source; peer_connection_finalize_connection(conn); } +static void +peer_connection_verified_established_cb(gpointer data, gint source, const gchar *error_message) +{ + peer_connection_common_established_cb(data, source, error_message, TRUE); +} + +static void +peer_connection_client_established_cb(gpointer data, gint source, const gchar *error_message) +{ + peer_connection_common_established_cb(data, source, error_message, FALSE); +} + /** * This is the watcher callback for any listening socket that is * waiting for a peer to connect. When a peer connects we set the @@ -639,7 +669,7 @@ /** * This is a callback function used when we're connecting to a peer * using either the client IP or the verified IP and the connection - * took longer than 15 seconds to complete. We do this because + * took longer than 5 seconds to complete. We do this because * waiting for the OS to time out the connection attempt is not * practical--the default timeout on many OSes can be 3 minutes or * more, and users are impatient. @@ -653,6 +683,12 @@ * I suppose this line of thinking is discriminatory against people * with very high lag but decent throughput who are transferring * large files. But we don't care about those people. + * + * I (Sean) changed the timeout from 15 to 5 seconds, as 60 seconds is + * too long for a user to wait to send a file. I'm also parallelizing + * requests when possible. The longest we should have to wait now is 10 + * seconds. We shouldn't make it shorter than this. + * */ static gboolean peer_connection_tooktoolong(gpointer data) @@ -689,12 +725,14 @@ peer_connection_close(conn); /* - * 1. Attempt to connect to the remote user using their verifiedip. + * 1. Attempt to connect to the remote user using their verifiedip and clientip. + * We try these at the same time and use whichever succeeds first, so we don't + * have to wait for a timeout. */ - if (!(conn->flags & PEER_CONNECTION_FLAG_TRIED_VERIFIEDIP) && + if (!(conn->flags & PEER_CONNECTION_FLAG_TRIED_DIRECT) && (conn->verifiedip != NULL) && (conn->port != 0) && (!conn->use_proxy)) { - conn->flags |= PEER_CONNECTION_FLAG_TRIED_VERIFIEDIP; + conn->flags |= PEER_CONNECTION_FLAG_TRIED_DIRECT; if (conn->type == OSCAR_CAPABILITY_DIRECTIM) { @@ -708,48 +746,26 @@ g_free(tmp); } - conn->connect_data = gaim_proxy_connect(NULL, account, + conn->verified_connect_data = gaim_proxy_connect(NULL, account, conn->verifiedip, conn->port, - peer_connection_established_cb, conn); - if (conn->connect_data != NULL) + peer_connection_verified_established_cb, conn); + if (conn->verified_connect_data != NULL) { /* Connecting... */ - conn->connect_timeout_timer = gaim_timeout_add(15000, + conn->connect_timeout_timer = gaim_timeout_add(5000, peer_connection_tooktoolong, conn); - return; } - } - /* - * 2. Attempt to connect to the remote user using their clientip. - */ - if (!(conn->flags & PEER_CONNECTION_FLAG_TRIED_CLIENTIP) && - (conn->clientip != NULL) && (conn->port != 0) && (!conn->use_proxy)) - { - conn->flags |= PEER_CONNECTION_FLAG_TRIED_CLIENTIP; - if ((conn->verifiedip == NULL) || strcmp(conn->verifiedip, conn->clientip)) { - if (conn->type == OSCAR_CAPABILITY_DIRECTIM) - { - gchar *tmp; - GaimConversation *conv; - tmp = g_strdup_printf(_("Attempting to connect to %s:%hu."), - conn->clientip, conn->port); - conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, conn->sn); - gaim_conversation_write(conv, NULL, tmp, - GAIM_MESSAGE_SYSTEM, time(NULL)); - g_free(tmp); - } - - conn->connect_data = gaim_proxy_connect(NULL, account, + conn->client_connect_data = gaim_proxy_connect(NULL, account, conn->clientip, conn->port, - peer_connection_established_cb, conn); - if (conn->connect_data != NULL) + peer_connection_client_established_cb, conn); + if (conn->connect_timeout_timer == 0 && conn->verified_connect_data != NULL) { /* Connecting... */ - conn->connect_timeout_timer = gaim_timeout_add(15000, + conn->connect_timeout_timer = gaim_timeout_add(5000, peer_connection_tooktoolong, conn); return; } @@ -757,7 +773,7 @@ } /* - * 3. Attempt to have the remote user connect to us (using both + * 2. Attempt to have the remote user connect to us (using both * our verifiedip and our clientip). */ if (!(conn->flags & PEER_CONNECTION_FLAG_TRIED_INCOMING) && @@ -781,7 +797,7 @@ } /* - * 4. Attempt to have both users connect to an intermediate proxy + * 3. Attempt to have both users connect to an intermediate proxy * server. */ if (!(conn->flags & PEER_CONNECTION_FLAG_TRIED_PROXY)) @@ -807,11 +823,11 @@ g_free(tmp); } - conn->connect_data = gaim_proxy_connect(NULL, account, + conn->verified_connect_data = gaim_proxy_connect(NULL, account, (conn->proxyip != NULL) ? conn->proxyip : PEER_PROXY_SERVER, PEER_PROXY_PORT, peer_proxy_connection_established_cb, conn); - if (conn->connect_data != NULL) + if (conn->verified_connect_data != NULL) { /* Connecting... */ return; Modified: trunk/libgaim/protocols/oscar/peer.h =================================================================== --- trunk/libgaim/protocols/oscar/peer.h 2006-12-05 06:23:43 UTC (rev 17896) +++ trunk/libgaim/protocols/oscar/peer.h 2006-12-06 00:39:27 UTC (rev 17897) @@ -36,11 +36,10 @@ #define PEER_CONNECTION_FLAG_INITIATED_BY_ME 0x0001 #define PEER_CONNECTION_FLAG_APPROVED 0x0002 -#define PEER_CONNECTION_FLAG_TRIED_VERIFIEDIP 0x0004 -#define PEER_CONNECTION_FLAG_TRIED_CLIENTIP 0x0008 -#define PEER_CONNECTION_FLAG_TRIED_INCOMING 0x0010 -#define PEER_CONNECTION_FLAG_TRIED_PROXY 0x0020 -#define PEER_CONNECTION_FLAG_IS_INCOMING 0x0040 +#define PEER_CONNECTION_FLAG_TRIED_DIRECT 0x0004 +#define PEER_CONNECTION_FLAG_TRIED_INCOMING 0x0008 +#define PEER_CONNECTION_FLAG_TRIED_PROXY 0x0010 +#define PEER_CONNECTION_FLAG_IS_INCOMING 0x0020 #define PEER_TYPE_PROMPT 0x0101 /* "I am going to send you this file, is that ok?" */ #define PEER_TYPE_RESUMESOMETHING 0x0106 /* I really don't know */ @@ -157,8 +156,9 @@ /** * This is only used when the peer connection is being established. */ - GaimProxyConnectData *connect_data; - + GaimProxyConnectData *client_connect_data; + GaimProxyConnectData *verified_connect_data; + /** * This is only used when the peer connection is being established. */ Modified: trunk/libgaim/protocols/oscar/peer_proxy.c =================================================================== --- trunk/libgaim/protocols/oscar/peer_proxy.c 2006-12-05 06:23:43 UTC (rev 17896) +++ trunk/libgaim/protocols/oscar/peer_proxy.c 2006-12-06 00:39:27 UTC (rev 17897) @@ -328,7 +328,7 @@ conn = data; - conn->connect_data = NULL; + conn->verified_connect_data = NULL; if (source < 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-05 06:23:47
|
Revision: 17896 http://svn.sourceforge.net/gaim/?rev=17896&view=rev Author: thekingant Date: 2006-12-04 22:23:43 -0800 (Mon, 04 Dec 2006) Log Message: ----------- Lower the away-message fetching timeout from 10 seconds to half a second. The rate limiting stuff will hopefully kick in if needed. Let me know if you have problems. Like rate-related error messages or GUI components not redrawing. Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_locate.c trunk/libgaim/protocols/oscar/flap_connection.c Modified: trunk/libgaim/protocols/oscar/family_locate.c =================================================================== --- trunk/libgaim/protocols/oscar/family_locate.c 2006-12-04 21:56:32 UTC (rev 17895) +++ trunk/libgaim/protocols/oscar/family_locate.c 2006-12-05 06:23:43 UTC (rev 17896) @@ -393,7 +393,7 @@ * requesting away messages and info too quickly. */ if (od->getinfotimer == 0) - od->getinfotimer = gaim_timeout_add(10000, + od->getinfotimer = gaim_timeout_add(500, gaim_reqinfo_timeout_cb, od); } Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 21:56:32 UTC (rev 17895) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-05 06:23:43 UTC (rev 17896) @@ -97,11 +97,11 @@ * were to send a SNAC in this rateclass at the given time. */ static guint32 -rateclass_get_new_current(FlapConnection *conn, struct rateclass *rateclass, struct timeval now) +rateclass_get_new_current(FlapConnection *conn, struct rateclass *rateclass, struct timeval *now) { unsigned long timediff; /* In milliseconds */ - timediff = (now.tv_sec - rateclass->last.tv_sec) * 1000 + (now.tv_usec - rateclass->last.tv_usec) / 1000; + timediff = (now->tv_sec - rateclass->last.tv_sec) * 1000 + (now->tv_usec - rateclass->last.tv_usec) / 1000; /* This formula is taken from the joscar API docs. Preesh. */ return MIN(((rateclass->current * (rateclass->windowsize - 1)) + timediff) / rateclass->windowsize, rateclass->max); @@ -127,7 +127,7 @@ { guint32 new_current; - new_current = rateclass_get_new_current(conn, rateclass, now); + new_current = rateclass_get_new_current(conn, rateclass, &now); if (new_current < rateclass->alert) /* Not ready to send this SNAC yet--keep waiting. */ @@ -183,7 +183,7 @@ guint32 new_current; gettimeofday(&now, NULL); - new_current = rateclass_get_new_current(conn, rateclass, now); + new_current = rateclass_get_new_current(conn, rateclass, &now); if (new_current < rateclass->alert) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-04 21:56:48
|
Revision: 17895 http://svn.sourceforge.net/gaim/?rev=17895&view=rev Author: datallah Date: 2006-12-04 13:56:32 -0800 (Mon, 04 Dec 2006) Log Message: ----------- Patch #1606353 from charkins to fix bug #1604257 (unseen convs in hidden window being incorrectly marked as seen). Modified Paths: -------------- trunk/gtk/gtkconv.c Modified: trunk/gtk/gtkconv.c =================================================================== --- trunk/gtk/gtkconv.c 2006-12-04 12:52:18 UTC (rev 17894) +++ trunk/gtk/gtkconv.c 2006-12-04 21:56:32 UTC (rev 17895) @@ -7526,7 +7526,10 @@ g_return_if_fail(conv != NULL); - gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); + /* clear unseen flag if conversation is not hidden */ + if(!gaim_gtkconv_is_hidden(gtkconv)) { + gtkconv_set_unseen(gtkconv, GAIM_UNSEEN_NONE); + } /* Update the menubar */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-04 12:52:31
|
Revision: 17894 http://svn.sourceforge.net/gaim/?rev=17894&view=rev Author: faceprint Date: 2006-12-04 04:52:18 -0800 (Mon, 04 Dec 2006) Log Message: ----------- hopefully fix the jabber crash people are seeing, and plug a small memory leak Modified Paths: -------------- trunk/libgaim/protocols/jabber/auth.c Modified: trunk/libgaim/protocols/jabber/auth.c =================================================================== --- trunk/libgaim/protocols/jabber/auth.c 2006-12-04 11:36:31 UTC (rev 17893) +++ trunk/libgaim/protocols/jabber/auth.c 2006-12-04 12:52:18 UTC (rev 17894) @@ -716,6 +716,7 @@ js->sasl_state = sasl_client_step(js->sasl, (char*)dec_in, declen, NULL, &c_out, &clen); + g_free(enc_in); g_free(dec_in); if (js->sasl_state != SASL_CONTINUE && js->sasl_state != SASL_OK) { gaim_debug_error("jabber", "Error is %d : %s\n",js->sasl_state,sasl_errdetail(js->sasl)); @@ -753,9 +754,20 @@ * should try one more round against it */ if (js->sasl_state != SASL_OK) { + char *enc_in = xmlnode_get_data(packet); + unsigned char *dec_in = NULL; const char *c_out; unsigned int clen; - js->sasl_state = sasl_client_step(js->sasl, NULL, 0, NULL, &c_out, &clen); + gsize declen = 0; + + if(enc_in != NULL) + dec_in = gaim_base64_decode(enc_in, &declen); + + js->sasl_state = sasl_client_step(js->sasl, (char*)dec_in, declen, NULL, &c_out, &clen); + + g_free(enc_in); + g_free(dec_in); + if (js->sasl_state != SASL_OK) { /* This should never happen! */ gaim_connection_error(js->gc, _("Invalid response from server.")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-04 11:36:46
|
Revision: 17893 http://svn.sourceforge.net/gaim/?rev=17893&view=rev Author: thekingant Date: 2006-12-04 03:36:31 -0800 (Mon, 04 Dec 2006) Log Message: ----------- Minor documentation changes Modified Paths: -------------- trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oft.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 11:14:11 UTC (rev 17892) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 11:36:31 UTC (rev 17893) @@ -817,7 +817,17 @@ break; } - /* TODO: Verify the sequence number sent by the server. */ + /* Verify the sequence number sent by the server. */ +#if 0 + /* TODO: Need to initialize conn->seqnum_in somewhere before we can use this. */ + if (aimutil_get16(&header[1]) != conn->seqnum_in++) + { + /* Received an out-of-order FLAP! */ + flap_connection_schedule_destroy(conn, + OSCAR_DISCONNECT_INVALID_DATA, NULL); + break; + } +#endif /* Initialize a new temporary FlapFrame for incoming data */ conn->buffer_incoming.channel = aimutil_get8(&header[1]); @@ -958,7 +968,7 @@ void flap_connection_send(FlapConnection *conn, FlapFrame *frame) { - frame->seqnum = ++(conn->seqnum); + frame->seqnum = ++(conn->seqnum_out); sendframe_flap(conn, frame); flap_frame_destroy(frame); } Modified: trunk/libgaim/protocols/oscar/oft.c =================================================================== --- trunk/libgaim/protocols/oscar/oft.c 2006-12-04 11:14:11 UTC (rev 17892) +++ trunk/libgaim/protocols/oscar/oft.c 2006-12-04 11:36:31 UTC (rev 17893) @@ -550,7 +550,7 @@ /* End GaimXfer callbacks for use when sending and receiving */ /*******************************************************************/ -#if 0 +#ifdef TODOFT /* * This little area in oscar.c is the nexus of file transfer code, * so I wrote a little explanation of what happens. I am such a Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-04 11:14:11 UTC (rev 17892) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-04 11:36:31 UTC (rev 17893) @@ -389,7 +389,8 @@ guint16 type; guint16 subtype; - guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ + guint16 seqnum_out; /**< The sequence number of most recently sent packet. */ + guint16 seqnum_in; /**< The sequence number of most recently received packet. */ GSList *groups; GSList *rateclasses; /* Contains nodes of struct rateclass. */ @@ -502,6 +503,7 @@ gboolean in_transaction; } ssi; + /** Contains pointers to handler functions for each family/subtype. */ GHashTable *handlerlist; /** A linked list containing FlapConnections. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-04 11:14:12
|
Revision: 17892 http://svn.sourceforge.net/gaim/?rev=17892&view=rev Author: thekingant Date: 2006-12-04 03:14:11 -0800 (Mon, 04 Dec 2006) Log Message: ----------- Use GHashTable and GQueue instead of GSList in a few places in oscar. The speed improvements probably won't be noticeable. 4 files changed, 48 insertions(+), 106 deletions(-) Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_oservice.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.h trunk/libgaim/protocols/oscar/oscar_data.c Modified: trunk/libgaim/protocols/oscar/family_oservice.c =================================================================== --- trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-04 07:47:50 UTC (rev 17891) +++ trunk/libgaim/protocols/oscar/family_oservice.c 2006-12-04 11:14:11 UTC (rev 17892) @@ -278,18 +278,6 @@ return NULL; } -static void -rateclass_addpair(struct rateclass *rateclass, guint16 group, guint16 type) -{ - struct snacpair *snacpair; - - snacpair = g_new(struct snacpair, 1); - snacpair->group = group; - snacpair->subtype = type; - - rateclass->members = g_slist_prepend(rateclass->members, snacpair); -} - /* Subtype 0x0007 - Rate Parameters */ static int rateresp(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) @@ -326,6 +314,7 @@ if (mod->version >= 3) byte_stream_getrawbuf(bs, rateclass->unknown, sizeof(rateclass->unknown)); + rateclass->members = g_hash_table_new(g_direct_hash, g_direct_equal); rateclass->last.tv_sec = 0; rateclass->last.tv_usec = 0; conn->rateclasses = g_slist_prepend(conn->rateclasses, rateclass); @@ -354,9 +343,10 @@ subtype = byte_stream_get16(bs); if (rateclass != NULL) - rateclass_addpair(rateclass, group, subtype); + g_hash_table_insert(rateclass->members, + GUINT_TO_POINTER((group << 16) + subtype), + GUINT_TO_POINTER(TRUE)); } - rateclass->members = g_slist_reverse(rateclass->members); } /* Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 07:47:50 UTC (rev 17891) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 11:14:11 UTC (rev 17892) @@ -75,22 +75,18 @@ static struct rateclass * flap_connection_get_rateclass(FlapConnection *conn, guint16 family, guint16 subtype) { - GSList *tmp1, *tmp2; + GSList *tmp1; + gconstpointer key; + key = GUINT_TO_POINTER((family << 16) + subtype); + for (tmp1 = conn->rateclasses; tmp1 != NULL; tmp1 = tmp1->next) { struct rateclass *rateclass; rateclass = tmp1->data; - for (tmp2 = rateclass->members; tmp2 != NULL; tmp2 = tmp2->next) - { - struct snacpair *snacpair; - snacpair = tmp2->data; - if ((snacpair->group == family) && (snacpair->subtype == subtype)) - { - return rateclass; - } - } + if (g_hash_table_lookup(rateclass->members, key)) + return rateclass; } return NULL; @@ -119,12 +115,12 @@ conn = data; gettimeofday(&now, NULL); - while (conn->queued_snacs != NULL) + while (!g_queue_is_empty(conn->queued_snacs)) { QueuedSnac *queued_snac; struct rateclass *rateclass; - queued_snac = conn->queued_snacs->data; + queued_snac = g_queue_peek_head(conn->queued_snacs); rateclass = flap_connection_get_rateclass(conn, queued_snac->family, queued_snac->subtype); if (rateclass != NULL) @@ -144,10 +140,10 @@ flap_connection_send(conn, queued_snac->frame); g_free(queued_snac); - conn->queued_snacs = g_slist_delete_link(conn->queued_snacs, conn->queued_snacs); + g_queue_pop_head(conn->queued_snacs); } - conn->outgoing_timeout = 0; + conn->queued_timeout = 0; return FALSE; } @@ -179,7 +175,7 @@ byte_stream_putbs(&frame->data, data, length); } - if (conn->outgoing_timeout != 0) + if (conn->queued_timeout != 0) enqueue = TRUE; else if ((rateclass = flap_connection_get_rateclass(conn, family, subtype)) != NULL) { @@ -210,10 +206,10 @@ queued_snac->family = family; queued_snac->subtype = subtype; queued_snac->frame = frame; - conn->queued_snacs = g_slist_append(conn->queued_snacs, queued_snac); + g_queue_push_tail(conn->queued_snacs, queued_snac); - if (conn->outgoing_timeout == 0) - conn->outgoing_timeout = gaim_timeout_add(500, flap_connection_send_queued, conn); + if (conn->queued_timeout == 0) + conn->queued_timeout = gaim_timeout_add(500, flap_connection_send_queued, conn); return; } @@ -272,6 +268,7 @@ conn->fd = -1; conn->subtype = -1; conn->type = type; + conn->queued_snacs = g_queue_new(); od->oscar_connections = g_slist_prepend(od->oscar_connections, conn); @@ -335,13 +332,8 @@ static void flap_connection_destroy_rateclass(struct rateclass *rateclass) { - while (rateclass->members != NULL) - { - g_free(rateclass->members->data); - rateclass->members = g_slist_delete_link(rateclass->members, rateclass->members); - } - - free(rateclass); + g_hash_table_destroy(rateclass->members); + g_free(rateclass); } /** @@ -352,8 +344,8 @@ static void flap_frame_destroy(FlapFrame *frame) { - free(frame->data.data); - free(frame); + g_free(frame->data.data); + g_free(frame); } static gboolean @@ -423,16 +415,16 @@ conn->rateclasses = g_slist_delete_link(conn->rateclasses, conn->rateclasses); } - while (conn->queued_snacs != NULL) + while (!g_queue_is_empty(conn->queued_snacs)) { QueuedSnac *queued_snac; - queued_snac = conn->queued_snacs->data; + queued_snac = g_queue_pop_head(conn->queued_snacs); flap_frame_destroy(queued_snac->frame); g_free(queued_snac); - conn->queued_snacs = g_slist_delete_link(conn->queued_snacs, conn->queued_snacs); } - if (conn->outgoing_timeout > 0) - gaim_timeout_remove(conn->outgoing_timeout); + g_queue_free(conn->queued_snacs); + if (conn->queued_timeout > 0) + gaim_timeout_remove(conn->queued_timeout); g_free(conn); Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-04 07:47:50 UTC (rev 17891) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-04 11:14:11 UTC (rev 17892) @@ -392,11 +392,9 @@ guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ GSList *groups; GSList *rateclasses; /* Contains nodes of struct rateclass. */ - /* TODO: Maybe use a GHashTable for rateclasses */ - GSList *queued_snacs; /**< Contains QueuedSnacs. */ - guint outgoing_timeout; - /* TODO: Maybe use a GQueue for outgoing_snacs */ + GQueue *queued_snacs; /**< Contains QueuedSnacs. */ + guint queued_timeout; void *internal; /* internal conn-specific libfaim data */ }; @@ -504,8 +502,7 @@ gboolean in_transaction; } ssi; - /* TODO: Implement this as a HashTable for HUGE speed improvement! */ - GSList *handlerlist; + GHashTable *handlerlist; /** A linked list containing FlapConnections. */ GSList *oscar_connections; @@ -578,8 +575,8 @@ void aim_cleansnacs(OscarData *, int maxage); -int oscar_data_addhandler(OscarData *od, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags); -void aim_clearhandlers(OscarData *od); +void oscar_data_addhandler(OscarData *od, guint16 family, guint16 subtype, aim_rxcallback_t newhandler, guint16 flags); +aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 subtype); /* flap_connection.c */ FlapConnection *flap_connection_new(OscarData *, int type); @@ -1542,9 +1539,6 @@ int byte_stream_putbs(ByteStream *bs, ByteStream *srcbs, int len); int byte_stream_putcaps(ByteStream *bs, guint32 caps); -/* rxhandlers.c */ -aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 type); - /* * Generic SNAC structure. Rarely if ever used. */ @@ -1571,11 +1565,6 @@ guint16 instance; }; -struct snacpair { - guint16 group; - guint16 subtype; -}; - struct rateclass { guint16 classid; guint32 windowsize; @@ -1586,8 +1575,7 @@ guint32 current; guint32 max; guint8 unknown[5]; /* only present in versions >= 3 */ - GSList *members; /* Contains node of struct snacpair */ - /* TODO: Maybe use a GHashTable for members */ + GHashTable *members; /* Key is family and subtype, value is TRUE. */ struct timeval last; /**< The time when we last sent a SNAC of this rate class. */ }; Modified: trunk/libgaim/protocols/oscar/oscar_data.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar_data.c 2006-12-04 07:47:50 UTC (rev 17891) +++ trunk/libgaim/protocols/oscar/oscar_data.c 2006-12-04 11:14:11 UTC (rev 17892) @@ -25,18 +25,11 @@ struct _SnacHandler { guint16 family; - guint16 type; + guint16 subtype; aim_rxcallback_t handler; guint16 flags; }; -static void -oscar_free_buddyinfo(void *data) -{ - struct buddyinfo *bi = data; - g_free(bi); -} - /** * Allocates a new OscarData and initializes it with default values. */ @@ -49,7 +42,8 @@ aim_initsnachash(od); od->snacid_next = 0x00000001; - od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo); + od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + od->handlerlist = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free); /* * Register all the modules for this session... @@ -115,61 +109,39 @@ peer_connection_destroy(od->peer_connections->data, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); - if (od->handlerlist != NULL) - aim_clearhandlers(od); - aim__shutdownmodules(od); g_hash_table_destroy(od->buddyinfo); + g_hash_table_destroy(od->handlerlist); g_free(od); } -int -oscar_data_addhandler(OscarData *od, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags) +void +oscar_data_addhandler(OscarData *od, guint16 family, guint16 subtype, aim_rxcallback_t newhandler, guint16 flags) { SnacHandler *snac_handler; - gaim_debug_misc("oscar", "Adding handler for %04x/%04x\n", family, type); + gaim_debug_misc("oscar", "Adding handler for %04x/%04x\n", family, subtype); snac_handler = g_new0(SnacHandler, 1); snac_handler->family = family; - snac_handler->type = type; + snac_handler->subtype = subtype; snac_handler->flags = flags; snac_handler->handler = newhandler; - od->handlerlist = g_slist_prepend(od->handlerlist, snac_handler); - - return 0; + g_hash_table_insert(od->handlerlist, + GUINT_TO_POINTER((family << 16) + subtype), + snac_handler); } -void -aim_clearhandlers(OscarData *od) -{ - SnacHandler *snac_handler; - - while (od->handlerlist != NULL) - { - snac_handler = od->handlerlist->data; - od->handlerlist = g_slist_remove(od->handlerlist, snac_handler); - g_free(snac_handler); - } - od->handlerlist = NULL; -} - aim_rxcallback_t -aim_callhandler(OscarData *od, guint16 family, guint16 type) +aim_callhandler(OscarData *od, guint16 family, guint16 subtype) { - GSList *cur; SnacHandler *snac_handler; - for (cur = od->handlerlist; cur != NULL; cur = cur->next) - { - snac_handler = cur->data; - if ((snac_handler->family == family) && (snac_handler->type == type)) - return snac_handler->handler; - } + snac_handler = g_hash_table_lookup(od->handlerlist, GUINT_TO_POINTER((family << 16) + subtype)); - return NULL; + return snac_handler ? snac_handler->handler : NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-04 07:47:58
|
Revision: 17891 http://svn.sourceforge.net/gaim/?rev=17891&view=rev Author: thekingant Date: 2006-12-03 23:47:50 -0800 (Sun, 03 Dec 2006) Log Message: ----------- Outgoing message throttling. If we're sending messages too quickly, and Gaim thinks that sending another message will make AIM give us a warning, then delay sending the message a little bit. Currently only activated for IMs. Let me know if you see any problems. Modified Paths: -------------- trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 04:52:46 UTC (rev 17890) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-12-04 07:47:50 UTC (rev 17891) @@ -72,8 +72,8 @@ flap_connection_send(conn, frame); } -static void -update_rate_class(FlapConnection *conn, guint16 family, guint16 subtype) +static struct rateclass * +flap_connection_get_rateclass(FlapConnection *conn, guint16 family, guint16 subtype) { GSList *tmp1, *tmp2; @@ -88,44 +88,85 @@ snacpair = tmp2->data; if ((snacpair->group == family) && (snacpair->subtype == subtype)) { - /* - * We've found the rateclass for this SNAC family - * and subtype! Update our "current" average by - * calculating a rolling average. This is pretty - * shoddy. We should really keep track of the times - * when the last windowsize messages that were sent - * and just calculate the REAL average. - */ - struct timeval now; - struct timezone tz; - unsigned long timediff; /* In milliseconds */ + return rateclass; + } + } + } - gettimeofday(&now, &tz); - timediff = MIN((now.tv_sec - rateclass->last.tv_sec) * 1000 + (now.tv_usec - rateclass->last.tv_usec) / 1000, rateclass->max); + return NULL; +} - /* This formula is taken from the joscar API docs. */ - rateclass->current = MIN(((rateclass->current * (rateclass->windowsize - 1)) + timediff) / rateclass->windowsize, rateclass->max); - rateclass->last.tv_sec = now.tv_sec; - rateclass->last.tv_usec = now.tv_usec; +/* + * Attempt to calculate what our new current average would be if we + * were to send a SNAC in this rateclass at the given time. + */ +static guint32 +rateclass_get_new_current(FlapConnection *conn, struct rateclass *rateclass, struct timeval now) +{ + unsigned long timediff; /* In milliseconds */ - return; - } + timediff = (now.tv_sec - rateclass->last.tv_sec) * 1000 + (now.tv_usec - rateclass->last.tv_usec) / 1000; + + /* This formula is taken from the joscar API docs. Preesh. */ + return MIN(((rateclass->current * (rateclass->windowsize - 1)) + timediff) / rateclass->windowsize, rateclass->max); +} + +static gboolean flap_connection_send_queued(gpointer data) +{ + FlapConnection *conn; + struct timeval now; + + conn = data; + gettimeofday(&now, NULL); + + while (conn->queued_snacs != NULL) + { + QueuedSnac *queued_snac; + struct rateclass *rateclass; + + queued_snac = conn->queued_snacs->data; + + rateclass = flap_connection_get_rateclass(conn, queued_snac->family, queued_snac->subtype); + if (rateclass != NULL) + { + guint32 new_current; + + new_current = rateclass_get_new_current(conn, rateclass, now); + + if (new_current < rateclass->alert) + /* Not ready to send this SNAC yet--keep waiting. */ + return TRUE; + + rateclass->current = new_current; + rateclass->last.tv_sec = now.tv_sec; + rateclass->last.tv_usec = now.tv_usec; } + + flap_connection_send(conn, queued_snac->frame); + g_free(queued_snac); + conn->queued_snacs = g_slist_delete_link(conn->queued_snacs, conn->queued_snacs); } + + conn->outgoing_timeout = 0; + return FALSE; } - /** * This sends a channel 2 FLAP containing a SNAC. The SNAC family and * subtype are looked up in the rate info for this connection, and if * sending this SNAC will induce rate limiting then we delay sending * of the SNAC by putting it into an outgoing holding queue. + * + * @param data The optional bytestream that makes up the data portion + * of this SNAC. For empty SNACs this should be NULL. */ void flap_connection_send_snac(OscarData *od, FlapConnection *conn, guint16 family, guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data) { FlapFrame *frame; guint32 length; + gboolean enqueue = FALSE; + struct rateclass *rateclass; length = data != NULL ? data->offset : 0; @@ -138,9 +179,45 @@ byte_stream_putbs(&frame->data, data, length); } - /* TODO: Outgoing message throttling */ - update_rate_class(conn, family, subtype); + if (conn->outgoing_timeout != 0) + enqueue = TRUE; + else if ((rateclass = flap_connection_get_rateclass(conn, family, subtype)) != NULL) + { + struct timeval now; + guint32 new_current; + gettimeofday(&now, NULL); + new_current = rateclass_get_new_current(conn, rateclass, now); + + if (new_current < rateclass->alert) + { + enqueue = TRUE; + } + else + { + rateclass->current = new_current; + rateclass->last.tv_sec = now.tv_sec; + rateclass->last.tv_usec = now.tv_usec; + } + } + + if (enqueue) + { + /* We've been sending too fast, so delay this message */ + QueuedSnac *queued_snac; + + queued_snac = g_new(QueuedSnac, 1); + queued_snac->family = family; + queued_snac->subtype = subtype; + queued_snac->frame = frame; + conn->queued_snacs = g_slist_append(conn->queued_snacs, queued_snac); + + if (conn->outgoing_timeout == 0) + conn->outgoing_timeout = gaim_timeout_add(500, flap_connection_send_queued, conn); + + return; + } + flap_connection_send(conn, frame); } @@ -267,6 +344,18 @@ free(rateclass); } +/** + * Free a FlapFrame + * + * @param frame The frame to free. + */ +static void +flap_frame_destroy(FlapFrame *frame) +{ + free(frame->data.data); + free(frame); +} + static gboolean flap_connection_destroy_cb(gpointer data) { @@ -334,6 +423,17 @@ conn->rateclasses = g_slist_delete_link(conn->rateclasses, conn->rateclasses); } + while (conn->queued_snacs != NULL) + { + QueuedSnac *queued_snac; + queued_snac = conn->queued_snacs->data; + flap_frame_destroy(queued_snac->frame); + g_free(queued_snac); + conn->queued_snacs = g_slist_delete_link(conn->queued_snacs, conn->queued_snacs); + } + if (conn->outgoing_timeout > 0) + gaim_timeout_remove(conn->outgoing_timeout); + g_free(conn); return FALSE; @@ -529,22 +629,7 @@ return frame; } -/** - * Free a FlapFrame - * - * @param frame The frame to free. - * @return -1 on error; 0 on success. - */ static void -flap_frame_destroy(FlapFrame *frame) -{ - free(frame->data.data); - free(frame); - - return; -} - -static void parse_snac(OscarData *od, FlapConnection *conn, FlapFrame *frame) { aim_module_t *cur; Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-04 04:52:46 UTC (rev 17890) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-04 07:47:50 UTC (rev 17891) @@ -56,11 +56,12 @@ typedef struct _ByteStream ByteStream; typedef struct _ClientInfo ClientInfo; +typedef struct _FlapConnection FlapConnection; typedef struct _FlapFrame FlapFrame; +typedef struct _IcbmArgsCh2 IcbmArgsCh2; typedef struct _IcbmCookie IcbmCookie; -typedef struct _FlapConnection FlapConnection; typedef struct _OscarData OscarData; -typedef struct _IcbmArgsCh2 IcbmArgsCh2; +typedef struct _QueuedSnac QueuedSnac; typedef guint32 aim_snacid_t; @@ -351,6 +352,13 @@ guint32 offset; }; +struct _QueuedSnac +{ + guint16 family; + guint16 subtype; + FlapFrame *frame; +}; + struct _FlapFrame { guint8 channel; @@ -383,9 +391,13 @@ guint16 subtype; guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ GSList *groups; - GSList *rateclasses; /* Contains nodes of struct rateclass */ + GSList *rateclasses; /* Contains nodes of struct rateclass. */ /* TODO: Maybe use a GHashTable for rateclasses */ + GSList *queued_snacs; /**< Contains QueuedSnacs. */ + guint outgoing_timeout; + /* TODO: Maybe use a GQueue for outgoing_snacs */ + void *internal; /* internal conn-specific libfaim data */ }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-04 04:52:49
|
Revision: 17890 http://svn.sourceforge.net/gaim/?rev=17890&view=rev Author: datallah Date: 2006-12-03 20:52:46 -0800 (Sun, 03 Dec 2006) Log Message: ----------- Fix up some of the example perl plugins. They still could use some work, but these will at least load now. Modified Paths: -------------- trunk/libgaim/plugins/perl/scripts/account.pl trunk/libgaim/plugins/perl/scripts/buddy_list.pl Added Paths: ----------- trunk/gtk/plugins/perl/scripts/ Modified: trunk/libgaim/plugins/perl/scripts/account.pl =================================================================== --- trunk/libgaim/plugins/perl/scripts/account.pl 2006-12-04 03:49:34 UTC (rev 17889) +++ trunk/libgaim/plugins/perl/scripts/account.pl 2006-12-04 04:52:46 UTC (rev 17890) @@ -3,50 +3,47 @@ use Gaim; # All the information Gaim gets about our nifty plugin -%PLUGIN_INFO = ( - perl_api_version => 2, - name => " Perl: $MODULE_NAME", - version => "0.1", - summary => "Test plugin for the Perl interpreter.", +%PLUGIN_INFO = ( + perl_api_version => 2, + name => "Perl: $MODULE_NAME", + version => "0.1", + summary => "Test plugin for the Perl interpreter.", description => "Implements a set of test proccedures to ensure all " . - "functions that work in the C API still work in the " . + "functions that work in the C API still work in the " . "Perl plugin interface. As XSUBs are added, this " . "*should* be updated to test the changes. " . "Furthermore, this will function as the tutorial perl " . "plugin.", - author => "John H. Kelm <johnhkelm\@gmail.com>", - url => "http://sourceforge.net/users/johnhkelm/", - - load => "plugin_load", - unload => "plugin_unload" -); + author => "John H. Kelm <johnhkelm\@gmail.com>", + url => "http://sourceforge.net/users/johnhkelm/", + load => "plugin_load", + unload => "plugin_unload" +); + # These names must already exist - my $GROUP = "UIUC Buddies"; my $USERNAME = "johnhkelm2"; - + # We will create these on load then destroy them on unload - my $TEST_GROUP = "perlTestGroup"; my $TEST_NAME = "perlTestName"; - my $TEST_ALIAS = "perlTestAlias"; my $PROTOCOL_ID = "prpl-oscar"; -sub plugin_init { - return %PLUGIN_INFO; -} +sub plugin_init { + return %PLUGIN_INFO; +} # This is the sub defined in %PLUGIN_INFO to be called when the plugin is loaded # Note: The plugin has a reference to itself on top of the argument stack. -sub plugin_load { - my $plugin = shift; +sub plugin_load { + my $plugin = shift; print "#" x 80 . "\n\n"; - Gaim::debug_info("plugin_load()", "Testing $MODULE_NAME Started."); + Gaim::Debug::info($MODULE_NAME, "plugin_load() - Testing $MODULE_NAME Started."); print "\n\n"; - + ################################# # # # Gaim::Account::Option # @@ -56,7 +53,7 @@ print "Testing: Gaim::Account::Option::new()...\n"; $acc_opt = Gaim::Account::Option->new(1, "TEXT", "pref_name"); $acc_opt2 = Gaim::Account::Option->bool_new("TeXt", "MYprefName", 1); - + ################################# # # # Gaim::Account # @@ -75,7 +72,7 @@ print "Testing: Gaim::Accounts::find()..."; $account = Gaim::Accounts::find($TEST_NAME, $PROTOCOL_ID); if ($account) { print "ok.\n"; } else { print "fail.\n"; } - + print "Testing: Gaim::Account::get_username()... "; $user_name = $account->get_username(); if ($user_name) { @@ -100,26 +97,26 @@ $account = Gaim::Accounts::find($USERNAME, $PROTOCOL_ID); print "Testing: Gaim::Accounts::connect()...pending...\n"; - + $account->set_status("available", TRUE); $account->connect(); print "\n\n"; - Gaim::debug_info("plugin_load()", "Testing $MODULE_NAME Completed."); + Gaim::Debug::info($MODULE_NAME, "plugin_load() - Testing $MODULE_NAME Completed.\n"); print "\n\n" . "#" x 80 . "\n\n"; -} +} -sub plugin_unload { - my $plugin = shift; +sub plugin_unload { + my $plugin = shift; print "#" x 80 . "\n\n"; - Gaim::debug_info("plugin_unload()", "Testing $MODULE_NAME Started."); + Gaim::Debug::info($MODULE_NAME, "plugin_unload() - Testing $MODULE_NAME Started.\n"); print "\n\n"; ######### TEST CODE HERE ########## print "\n\n"; - Gaim::debug_info("plugin_unload()", "Testing $MODULE_NAME Completed."); + Gaim::Debug::info($MODULE_NAME, "plugin_unload() - Testing $MODULE_NAME Completed.\n"); print "\n\n" . "#" x 80 . "\n\n"; } Modified: trunk/libgaim/plugins/perl/scripts/buddy_list.pl =================================================================== --- trunk/libgaim/plugins/perl/scripts/buddy_list.pl 2006-12-04 03:49:34 UTC (rev 17889) +++ trunk/libgaim/plugins/perl/scripts/buddy_list.pl 2006-12-04 04:52:46 UTC (rev 17890) @@ -3,24 +3,23 @@ use Gaim; # All the information Gaim gets about our nifty plugin -%PLUGIN_INFO = ( - perl_api_version => 2, - name => " Perl: $MODULE_NAME", - version => "0.1", - summary => "Test plugin for the Perl interpreter.", - description => "Implements a set of test proccedures to ensure all functions that work in the C API still work in the Perl plugin interface. As XSUBs are added, this *should* be updated to test the changes. Furthermore, this will function as the tutorial perl plugin.", - author => "John H. Kelm <johnhkelm\@gmail.com>", - url => "http://sourceforge.net/users/johnhkelm/", - - load => "plugin_load", - unload => "plugin_unload" -); +%PLUGIN_INFO = ( + perl_api_version => 2, + name => "Perl: $MODULE_NAME", + version => "0.1", + summary => "Test plugin for the Perl interpreter.", + description => "Implements a set of test proccedures to ensure all functions that work in the C API still work in the Perl plugin interface. As XSUBs are added, this *should* be updated to test the changes. Furthermore, this will function as the tutorial perl plugin.", + author => "John H. Kelm <johnhkelm\@gmail.com>", + url => "http://sourceforge.net/users/johnhkelm/", + load => "plugin_load", + unload => "plugin_unload" +); + # These names must already exist - my $GROUP = "UIUC Buddies"; my $USERNAME = "johnhkelm2"; - + # We will create these on load then destroy them on unload my $TEST_GROUP = "UConn Buddies"; my $TEST_NAME = "johnhkelm"; @@ -28,67 +27,74 @@ my $PROTOCOL_ID = "prpl-oscar"; -sub plugin_init { - return %PLUGIN_INFO; -} +sub plugin_init { + return %PLUGIN_INFO; +} # This is the sub defined in %PLUGIN_INFO to be called when the plugin is loaded # Note: The plugin has a reference to itself on top of the argument stack. -sub plugin_load { - my $plugin = shift; - print "#" x 80 . "\n\n"; +sub plugin_load { + my $plugin = shift; - print "PERL: Finding account.\n"; + # This is how we get an account to use in the following tests. You should replace the username + # with an existing user $account = Gaim::Accounts::find($USERNAME, $PROTOCOL_ID); - - ######### TEST CODE HERE ########## - - print "Testing: Gaim::Find::buddy()..."; + + # Testing a find function: Note Gaim::Find not Gaim::Buddy:find! + # Furthermore, this should work the same for chats and groups + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::Find::buddy()..."); $buddy = Gaim::Find::buddy($account, $TEST_NAME); - if ($buddy) { print "ok.\n"; } else { print "fail.\n"; } - - print "Testing: Gaim::BuddyList::get_handle()..."; + Gaim::Debug::info("", ($buddy ? "ok." : "fail.") . "\n"); + + # If you should need the handle for some reason, here is how you do it + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::BuddyList::get_handle()..."); $handle = Gaim::BuddyList::get_handle(); - if ($handle) { print "ok.\n"; } else { print "fail.\n"; } - - print "Testing: Gaim::BuddyList::get_blist()..."; - $blist = Gaim::BuddyList::get_blist(); - if ($blist) { print "ok.\n"; } else { print "fail.\n"; } - - print "Testing: Gaim::Buddy::new..."; - $buddy = Gaim::Buddy::new($account, $TEST_NAME . "TEST", $TEST_ALIAS); - if ($buddy) { print "ok.\n"; } else { print "fail.\n"; } + Gaim::Debug::info("", ($handle ? "ok." : "fail.") . "\n"); - print "Testing: Gaim::Find::group..."; + # This gets the Gaim::BuddyList and references it by $blist + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::get_blist()..."); + $blist = Gaim::get_blist(); + Gaim::Debug::info("", ($blist ? "ok." : "fail.") . "\n"); + + # This is how you would add a buddy named $TEST_NAME" with the alias $TEST_ALIAS + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::BuddyList::Buddy::new..."); + $buddy = Gaim::BuddyList::Buddy::new($account, $TEST_NAME, $TEST_ALIAS); + Gaim::Debug::info("", ($buddy ? "ok." : "fail.") . "\n"); + + # Here we add the new buddy '$buddy' to the group $TEST_GROUP + # so first we must find the group + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::Find::group..."); $group = Gaim::Find::group($TEST_GROUP); - if ($group) { print "ok.\n"; } else { print "fail.\n"; } - - print "Testing: Gaim::BuddyList::add_buddy..."; + Gaim::Debug::info("", ($group ? "ok." : "fail.") . "\n"); + + # To add the buddy we need to have the buddy, contact, group and node for insertion. + # For this example we can let contact be undef and set the insertion node as the group + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::BuddyList::add_buddy...\n"); Gaim::BuddyList::add_buddy($buddy, undef, $group, $group); - if ($buddy) { print "ok.\n"; } else { print "fail.\n"; } - - print "Testing: Gaim::Find::buddies...\n"; - @buddy_array = Gaim::Find::buddies($account, $USERNAME); - if (@buddy_array) { - print "Buddies in list (" . @buddy_array . "): \n"; - foreach $bud (@buddy_array) { - print Gaim::Buddy::get_name($bud) . "\n"; + + # The example that follows gives an indication of how an API call that returns a list is handled. + # In this case the buddies of the account found earlier are retrieved and put in an array '@buddy_array' + # Further down an accessor method is used, 'get_name()' -- see source for details on the full set of methods + Gaim::Debug::info($MODULE_NAME, "Testing: Gaim::Find::buddies...\n"); + @buddy_array = Gaim::Find::buddies($account, undef); + if (@buddy_array) { + Gaim::Debug::info($MODULE_NAME, "Buddies in list (" . @buddy_array . "): \n"); + foreach $bud (@buddy_array) { + Gaim::Debug::info($MODULE_NAME, Gaim::BuddyList::Buddy::get_name($bud) . "\n"); } } +} - print "#" x 80 . "\n\n"; -} +sub plugin_unload { + my $plugin = shift; -sub plugin_unload { - my $plugin = shift; - print "#" x 80 . "\n\n"; ######### TEST CODE HERE ########## print "Testing: Gaim::Find::buddy()..."; $buddy = Gaim::Find::buddy($account, $TEST_NAME . TEST); - if ($buddy) { + if ($buddy) { print "ok.\n"; print "Testing: Gaim::BuddyList::remove_buddy()..."; Gaim::BuddyList::remove_buddy($buddy); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-04 03:49:35
|
Revision: 17889 http://svn.sourceforge.net/gaim/?rev=17889&view=rev Author: datallah Date: 2006-12-03 19:49:34 -0800 (Sun, 03 Dec 2006) Log Message: ----------- Fix some leakage in the perl loader bindings by using a special typedef to handle functions that return g_malloc()-ed values. Thanks to the Gtk-Perl folks for any easy way to do this. Fix gaim_gtk_sound_get_event_label() to correctly indicate that the retval is a constant. Modified Paths: -------------- trunk/gtk/gtksound.c trunk/gtk/gtksound.h trunk/gtk/plugins/perl/common/GtkIMHtml.xs trunk/gtk/plugins/perl/common/GtkSound.xs trunk/gtk/plugins/perl/common/GtkStatusBox.xs trunk/gtk/plugins/perl/common/GtkUtils.xs trunk/libgaim/plugins/perl/common/Log.xs trunk/libgaim/plugins/perl/common/Util.xs trunk/libgaim/plugins/perl/common/XMLNode.xs trunk/libgaim/plugins/perl/common/module.h trunk/libgaim/plugins/perl/common/typemap Modified: trunk/gtk/gtksound.c =================================================================== --- trunk/gtk/gtksound.c 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/gtk/gtksound.c 2006-12-04 03:49:34 UTC (rev 17889) @@ -242,7 +242,7 @@ return sounds[event].pref; } -char * +const char * gaim_gtk_sound_get_event_label(GaimSoundEventID event) { if(event >= GAIM_NUM_SOUNDS) Modified: trunk/gtk/gtksound.h =================================================================== --- trunk/gtk/gtksound.h 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/gtk/gtksound.h 2006-12-04 03:49:34 UTC (rev 17889) @@ -46,7 +46,7 @@ * @param event The event. * @return The label. */ -char *gaim_gtk_sound_get_event_label(GaimSoundEventID event); +const char *gaim_gtk_sound_get_event_label(GaimSoundEventID event); /** * Gets GTK+ sound UI ops. Modified: trunk/gtk/plugins/perl/common/GtkIMHtml.xs =================================================================== --- trunk/gtk/plugins/perl/common/GtkIMHtml.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/gtk/plugins/perl/common/GtkIMHtml.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -60,7 +60,7 @@ /* This can't work at the moment since I don't have a typemap for Gtk::Widget. * I thought about using the one from libgtk2-perl but wasn't sure how to go * about doing that. -char * +gchar_own * gtk_imhtml_get_markup_range(imhtml, start, end) Gaim::GtkUI::IMHtml imhtml Gtk::TextIter start @@ -70,7 +70,7 @@ /* This can't work at the moment since I don't have a typemap for Gtk::Widget. * I thought about using the one from libgtk2-perl but wasn't sure how to go * about doing that. -char * +gchar_own * gtk_imhtml_get_text(imhtml, start, end) Gaim::GtkUI::IMHtml imhtml Gtk::TextIter start @@ -215,19 +215,19 @@ gtk_imhtml_get_format_functions(imhtml) Gaim::GtkUI::IMHtml imhtml -char * +gchar_own * gtk_imhtml_get_current_fontface(imhtml) Gaim::GtkUI::IMHtml imhtml -char * +gchar_own * gtk_imhtml_get_current_forecolor(imhtml) Gaim::GtkUI::IMHtml imhtml -char * +gchar_own * gtk_imhtml_get_current_backcolor(imhtml) Gaim::GtkUI::IMHtml imhtml -char * +gchar_own * gtk_imhtml_get_current_background(imhtml) Gaim::GtkUI::IMHtml imhtml @@ -303,7 +303,7 @@ gtk_imhtml_font_grow(imhtml) Gaim::GtkUI::IMHtml imhtml -char * +gchar_own * gtk_imhtml_get_markup(imhtml) Gaim::GtkUI::IMHtml imhtml Modified: trunk/gtk/plugins/perl/common/GtkSound.xs =================================================================== --- trunk/gtk/plugins/perl/common/GtkSound.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/gtk/plugins/perl/common/GtkSound.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -7,7 +7,7 @@ gaim_gtk_sound_get_event_option(event) Gaim::SoundEventID event -char * +const char * gaim_gtk_sound_get_event_label(event) Gaim::SoundEventID event Modified: trunk/gtk/plugins/perl/common/GtkStatusBox.xs =================================================================== --- trunk/gtk/plugins/perl/common/GtkStatusBox.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/gtk/plugins/perl/common/GtkStatusBox.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -45,6 +45,6 @@ gtk_gaim_status_box_get_buddy_icon(status_box) Gaim::GtkUI::StatusBox status_box -char * +gchar_own * gtk_gaim_status_box_get_message(status_box) Gaim::GtkUI::StatusBox status_box Modified: trunk/gtk/plugins/perl/common/GtkUtils.xs =================================================================== --- trunk/gtk/plugins/perl/common/GtkUtils.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/gtk/plugins/perl/common/GtkUtils.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -10,7 +10,7 @@ void gaim_gtk_load_accels() -char * +gchar_own * gaim_gtk_convert_buddy_icon(plugin, path) Gaim::Plugin plugin const char * path Modified: trunk/libgaim/plugins/perl/common/Log.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Log.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/libgaim/plugins/perl/common/Log.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -21,7 +21,7 @@ gaim_log_free(log) Gaim::Log log -char * +gchar_own * gaim_log_get_log_dir(type, name, account) Gaim::LogType type const char *name @@ -83,7 +83,7 @@ XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::ListEntry"))); } -char * +gchar_own * gaim_log_read(log, flags) Gaim::Log log Gaim::Log::ReadFlags flags Modified: trunk/libgaim/plugins/perl/common/Util.xs =================================================================== --- trunk/libgaim/plugins/perl/common/Util.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/libgaim/plugins/perl/common/Util.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -74,7 +74,7 @@ gaim_escape_filename(str) const char *str -char * +gchar_own * gaim_fd_get_ip(fd) int fd @@ -104,7 +104,7 @@ const char **end GData **attributes -char * +gchar_own * gaim_markup_get_tag_name(tag) const char *tag @@ -114,17 +114,17 @@ char **dest_xhtml char **dest_plain -char * +gchar_own * gaim_markup_linkify(str) const char *str -char * +gchar_own * gaim_markup_slice(str, x, y) const char *str guint x guint y -char * +gchar_own * gaim_markup_strip_html(str) const char *str @@ -147,11 +147,11 @@ gaim_program_is_valid(program) const char *program -char * +gchar_own * gaim_str_add_cr(str) const char *str -char * +gchar_own * gaim_str_binary_to_ascii(binary, len) const unsigned char *binary guint len @@ -166,11 +166,11 @@ const char *s const char *x -char * +gchar_own * gaim_str_seconds_to_string(sec) guint sec -char * +gchar_own * gaim_str_size_to_units(size) size_t size @@ -187,7 +187,7 @@ long *tz_off const char **rest -gchar * +gchar_own * gaim_strcasereplace(string, delimiter, replacement) const char *string const char *delimiter @@ -198,17 +198,17 @@ const char *haystack const char *needle -gchar * +gchar_own * gaim_strdup_withhtml(src) const gchar *src -gchar * +gchar_own * gaim_strreplace(string, delimiter, replacement) const char *string const char *delimiter const char *replacement -char * +gchar_own * gaim_text_strip_mnemonic(in) const char *in @@ -229,7 +229,7 @@ gaim_unescape_filename(str) const char *str -char * +gchar_own * gaim_unescape_html(html) const char *html Modified: trunk/libgaim/plugins/perl/common/XMLNode.xs =================================================================== --- trunk/libgaim/plugins/perl/common/XMLNode.xs 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/libgaim/plugins/perl/common/XMLNode.xs 2006-12-04 03:49:34 UTC (rev 17889) @@ -36,7 +36,7 @@ const char *name const char *xmlns -char * +gchar_own * xmlnode_get_data(node) Gaim::XMLNode node @@ -77,12 +77,12 @@ const char *attr const char *value -char * +gchar_own * xmlnode_to_formatted_str(node, len) Gaim::XMLNode node int *len -char * +gchar_own * xmlnode_to_str(node, len) Gaim::XMLNode node int *len Modified: trunk/libgaim/plugins/perl/common/module.h =================================================================== --- trunk/libgaim/plugins/perl/common/module.h 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/libgaim/plugins/perl/common/module.h 2006-12-04 03:49:34 UTC (rev 17889) @@ -271,3 +271,6 @@ /* other */ typedef void * Gaim__Handle; + +typedef gchar gchar_own; + Modified: trunk/libgaim/plugins/perl/common/typemap =================================================================== --- trunk/libgaim/plugins/perl/common/typemap 2006-12-04 03:44:42 UTC (rev 17888) +++ trunk/libgaim/plugins/perl/common/typemap 2006-12-04 03:49:34 UTC (rev 17889) @@ -16,6 +16,7 @@ char ** T_PTR gchar T_IV gchar * T_PV +gchar_own * T_GCHAR_OWN guchar T_IV guchar * T_PTR guchar ** T_PTR @@ -195,3 +196,12 @@ T_GaimObj $arg = gaim_perl_bless_object($var, \"$type\"); + +T_GCHAR_OWN + /* used when we can directly own the returned string. */ + /* we have to copy in the case when perl's malloc != gtk's malloc, + * so best copy all the time. */ + sv_setpv ((SV*)$arg, $var); + SvUTF8_on ($arg); + g_free ($var); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-04 03:44:43
|
Revision: 17888 http://svn.sourceforge.net/gaim/?rev=17888&view=rev Author: faceprint Date: 2006-12-03 19:44:42 -0800 (Sun, 03 Dec 2006) Log Message: ----------- this is hackish, but works. Fixes 1549152. Modified Paths: -------------- trunk/gtk/gtkaccount.c Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-12-04 02:12:53 UTC (rev 17887) +++ trunk/gtk/gtkaccount.c 2006-12-04 03:44:42 UTC (rev 17888) @@ -136,6 +136,9 @@ GtkWidget *proxy_user_entry; GtkWidget *proxy_pass_entry; + /* Are we registering? */ + gboolean registering; + } AccountPrefsDialog; typedef struct @@ -1335,7 +1338,7 @@ gaim_signal_emit(gaim_gtk_account_get_handle(), "account-modified", account); /* If this is a new account, then sign on! */ - if (new) { + if (new && !dialog->registering) { const GaimSavedStatus *saved_status; saved_status = gaim_savedstatus_get_current(); @@ -1351,8 +1354,12 @@ static void register_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) { - GaimAccount *account = ok_account_prefs_cb(NULL, dialog); + GaimAccount *account; + dialog->registering = TRUE; + + account = ok_account_prefs_cb(NULL, dialog); + gaim_account_register(account); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-04 02:12:55
|
Revision: 17887 http://svn.sourceforge.net/gaim/?rev=17887&view=rev Author: faceprint Date: 2006-12-03 18:12:53 -0800 (Sun, 03 Dec 2006) Log Message: ----------- fix 1589407 Modified Paths: -------------- trunk/libgaim/account.c Modified: trunk/libgaim/account.c =================================================================== --- trunk/libgaim/account.c 2006-12-04 01:53:12 UTC (rev 17886) +++ trunk/libgaim/account.c 2006-12-04 02:12:53 UTC (rev 17887) @@ -1192,6 +1192,10 @@ account->username = g_strdup(username); schedule_accounts_save(); + + /* if the name changes, we should re-write the buddy list + * to disk with the new name */ + gaim_blist_schedule_save(); } void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-04 01:53:13
|
Revision: 17886 http://svn.sourceforge.net/gaim/?rev=17886&view=rev Author: faceprint Date: 2006-12-03 17:53:12 -0800 (Sun, 03 Dec 2006) Log Message: ----------- close 1588351 and adhere to rfc3921bis Modified Paths: -------------- trunk/libgaim/protocols/jabber/roster.c Modified: trunk/libgaim/protocols/jabber/roster.c =================================================================== --- trunk/libgaim/protocols/jabber/roster.c 2006-12-04 01:52:05 UTC (rev 17885) +++ trunk/libgaim/protocols/jabber/roster.c 2006-12-04 01:53:12 UTC (rev 17886) @@ -262,8 +262,7 @@ xmlnode_set_attrib(item, "jid", name); - if(b->alias) - xmlnode_set_attrib(item, "name", b->alias); + xmlnode_set_attrib(item, "name", b->alias ? b->alias : ""); for(l = groups; l; l = l->next) { group = xmlnode_new_child(item, "group"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-12-04 01:52:12
|
Revision: 17885 http://svn.sourceforge.net/gaim/?rev=17885&view=rev Author: datallah Date: 2006-12-03 17:52:05 -0800 (Sun, 03 Dec 2006) Log Message: ----------- Fix wingaim file receiving. It turns out that _access() on win32 is really horrible and will fail on directories when checking any other mode than F_OK. Modified Paths: -------------- trunk/libgaim/ft.c trunk/libgaim/internal.h trunk/libgaim/win32/libc_interface.h Modified: trunk/libgaim/ft.c =================================================================== --- trunk/libgaim/ft.c 2006-12-03 21:49:17 UTC (rev 17884) +++ trunk/libgaim/ft.c 2006-12-04 01:52:05 UTC (rev 17885) @@ -219,9 +219,14 @@ if (g_stat(filename, &st) != 0) { /* File not found. */ if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) { +#ifndef _WIN32 + int mode = W_OK; +#else + int mode = F_OK; +#endif dir = g_path_get_dirname(filename); - if (g_access(dir, W_OK) == 0) { + if (g_access(dir, mode) == 0) { gaim_xfer_request_accepted(xfer, filename); } else { gaim_xfer_ref(xfer); Modified: trunk/libgaim/internal.h =================================================================== --- trunk/libgaim/internal.h 2006-12-03 21:49:17 UTC (rev 17884) +++ trunk/libgaim/internal.h 2006-12-04 01:52:05 UTC (rev 17885) @@ -142,7 +142,7 @@ # define g_open open #endif -#if !GLIB_CHECK_VERSION(2,8,0) +#if !GLIB_CHECK_VERSION(2,8,0) && !defined _WIN32 # define g_access access #endif Modified: trunk/libgaim/win32/libc_interface.h =================================================================== --- trunk/libgaim/win32/libc_interface.h 2006-12-03 21:49:17 UTC (rev 17884) +++ trunk/libgaim/win32/libc_interface.h 2006-12-04 01:52:05 UTC (rev 17885) @@ -123,7 +123,6 @@ #if !GLIB_CHECK_VERSION(2,8,0) int wgaim_g_access(const gchar *filename, int mode); -#undef g_access #define g_access( filename, mode) \ wgaim_g_access( filename, mode ) #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-03 21:49:26
|
Revision: 17884 http://svn.sourceforge.net/gaim/?rev=17884&view=rev Author: thekingant Date: 2006-12-03 13:49:17 -0800 (Sun, 03 Dec 2006) Log Message: ----------- This wasn't being used. Neat. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.h Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-12-02 23:01:02 UTC (rev 17883) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-12-03 21:49:17 UTC (rev 17884) @@ -382,7 +382,6 @@ guint16 type; guint16 subtype; guint16 seqnum; /**< The sequence number of most recent outgoing packet. */ - guint32 status; GSList *groups; GSList *rateclasses; /* Contains nodes of struct rateclass */ /* TODO: Maybe use a GHashTable for rateclasses */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |