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: <sea...@us...> - 2006-09-02 01:25:49
|
Revision: 17122 http://svn.sourceforge.net/gaim/?rev=17122&view=rev Author: seanegan Date: 2006-09-01 18:25:43 -0700 (Fri, 01 Sep 2006) Log Message: ----------- this is it for me for today Modified Paths: -------------- trunk/gtk/gtkblist.c trunk/libgaim/protocols/jabber/parser.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-09-01 22:46:39 UTC (rev 17121) +++ trunk/gtk/gtkblist.c 2006-09-02 01:25:43 UTC (rev 17122) @@ -3940,7 +3940,7 @@ /****************************** GtkTreeView **********************************/ sw = gtk_scrolled_window_new(NULL,NULL); gtk_widget_show(sw); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_NONE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS, Modified: trunk/libgaim/protocols/jabber/parser.c =================================================================== --- trunk/libgaim/protocols/jabber/parser.c 2006-09-01 22:46:39 UTC (rev 17121) +++ trunk/libgaim/protocols/jabber/parser.c 2006-09-02 01:25:43 UTC (rev 17122) @@ -283,7 +283,6 @@ /* libxml inconsistently starts parsing on creating the parser, so so a ParseChunk * right afterwards to force it. */ js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL); - xmlParseChunk(js->context, NULL, 0, 0); } else if (xmlParseChunk(js->context, buf, len, 0) < 0) { gaim_connection_error(js->gc, _("XML Parse error")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-09-01 22:46:43
|
Revision: 17121 http://svn.sourceforge.net/gaim/?rev=17121&view=rev Author: seanegan Date: 2006-09-01 15:46:39 -0700 (Fri, 01 Sep 2006) Log Message: ----------- We should do the same for OSCAR icons Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-09-01 22:45:42 UTC (rev 17120) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-09-01 22:46:39 UTC (rev 17121) @@ -6427,7 +6427,7 @@ OPT_PROTO_MAIL_CHECK | OPT_PROTO_IM_IMAGE, NULL, /* user_splits */ NULL, /* protocol_options */ - {"jpeg,gif,bmp,ico", 48, 48, 50, 50, + {"gif,jpg,bmp,ico", 48, 48, 50, 50, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ oscar_list_icon, /* list_icon */ oscar_list_emblems, /* list_emblems */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-09-01 22:45:46
|
Revision: 17120 http://svn.sourceforge.net/gaim/?rev=17120&view=rev Author: seanegan Date: 2006-09-01 15:45:42 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Also, let's scale to PNG to preserve transparency. Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-01 22:15:34 UTC (rev 17119) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-01 22:45:42 UTC (rev 17120) @@ -1831,7 +1831,7 @@ OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME, NULL, /* user_splits */ NULL, /* protocol_options */ - {"jpeg,gif,png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ + {"png,jpg,gif", 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 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-09-01 22:15:38
|
Revision: 17119 http://svn.sourceforge.net/gaim/?rev=17119&view=rev Author: seanegan Date: 2006-09-01 15:15:34 -0700 (Fri, 01 Sep 2006) Log Message: ----------- JEP 153 says icons SHOULD be no larger than 96x96, so let's enforce that on the client Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-09-01 20:19:08 UTC (rev 17118) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-09-01 22:15:34 UTC (rev 17119) @@ -1831,7 +1831,7 @@ OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME, NULL, /* user_splits */ NULL, /* protocol_options */ - {"jpeg,gif,png", 0, 0, 96, 96, GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ + {"jpeg,gif,png", 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 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-09-01 20:19:18
|
Revision: 17117 http://svn.sourceforge.net/gaim/?rev=17117&view=rev Author: seanegan Date: 2006-09-01 13:13:47 -0700 (Fri, 01 Sep 2006) Log Message: ----------- I really like this. Some changes to the Buddy List: - Everything is one column now. So things like the group name ellipsizing for buddy icons that aren't there won't happen anymore. - Expander Icon set to an invisible column: the correct way to get rid of the unsightly large blist expander margins - Group nodes have a background color to more easily tell them apart, now that the margins are gone. This could be extended to buddies. I'm thinking of making a notify mode that colors buddies in the list when you have a message from them. I'm doing this on expanded contacts, but I don't think I like it. - Expanders are now temporarily pixbufs; this will change to something better later Modified Paths: -------------- trunk/gtk/gaimstock.c trunk/gtk/gaimstock.h trunk/gtk/gtkblist.c trunk/gtk/gtkblist.h trunk/gtk/pixmaps/Makefile.am Modified: trunk/gtk/gaimstock.c =================================================================== --- trunk/gtk/gaimstock.c 2006-09-01 18:34:53 UTC (rev 17116) +++ trunk/gtk/gaimstock.c 2006-09-01 20:13:47 UTC (rev 17117) @@ -129,7 +129,9 @@ { GAIM_STOCK_STATUS_CONNECT1, "gaim", "status-connect1.png" }, { GAIM_STOCK_STATUS_CONNECT2, "gaim", "status-connect2.png" }, { GAIM_STOCK_STATUS_CONNECT3, "gaim", "status-connect3.png" }, - { GAIM_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP } + { GAIM_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP }, + { GAIM_STOCK_EXPANDER_EXPANDED,"gaim", "expander-expanded.png" }, + { GAIM_STOCK_EXPANDER_COLLAPSED,"gaim", "expander-collapsed.png" }, }; static const GtkStockItem stock_items[] = Modified: trunk/gtk/gaimstock.h =================================================================== --- trunk/gtk/gaimstock.h 2006-09-01 18:34:53 UTC (rev 17116) +++ trunk/gtk/gaimstock.h 2006-09-01 20:13:47 UTC (rev 17117) @@ -98,6 +98,8 @@ #define GAIM_STOCK_TYPING "gaim-typing" #define GAIM_STOCK_UPLOAD "gaim-upload" #define GAIM_STOCK_VOICE_CHAT "gaim-voice-chat" +#define GAIM_STOCK_EXPANDER_EXPANDED "gaim-stock-expander-expanded" +#define GAIM_STOCK_EXPANDER_COLLAPSED "gaim-stock-expander-collapsed" /*@}*/ /** Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-09-01 18:34:53 UTC (rev 17116) +++ trunk/gtk/gtkblist.c 2006-09-01 20:13:47 UTC (rev 17117) @@ -3936,6 +3936,7 @@ accountmenu = gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts")); + /****************************** GtkTreeView **********************************/ sw = gtk_scrolled_window_new(NULL,NULL); gtk_widget_show(sw); @@ -3943,8 +3944,10 @@ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtkblist->treemodel = gtk_tree_store_new(BLIST_COLUMNS, - GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN, - G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER); + GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN, + G_TYPE_POINTER, GDK_TYPE_COLOR, GDK_TYPE_PIXBUF, GDK_TYPE_PIXBUF, + G_TYPE_BOOLEAN); gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); @@ -3976,40 +3979,71 @@ g_signal_connect(G_OBJECT(gtkblist->treeview), "leave-notify-event", G_CALLBACK(gaim_gtk_blist_leave_cb), NULL); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(gtkblist->treeview), FALSE); + + column = gtk_tree_view_column_new(); + gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column); + gtk_tree_view_column_set_visible(column, FALSE); + gtk_tree_view_set_expander_column(GTK_TREE_VIEW(gtkblist->treeview), column); gtkblist->text_column = column = gtk_tree_view_column_new (); + rend = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "pixbuf", GROUP_EXPANDER_COLUMN, + "cell-background-gdk", BGCOLOR_COLUMN, + NULL); rend = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(column, rend, FALSE); gtk_tree_view_column_set_attributes(column, rend, - "pixbuf", STATUS_ICON_COLUMN, - "visible", STATUS_ICON_VISIBLE_COLUMN, - NULL); + "pixbuf", CONTACT_EXPANDER_COLUMN, + "visible", CONTACT_EXPANDER_VISIBLE_COLUMN, + "cell-background-gdk", BGCOLOR_COLUMN, + NULL); + + rend = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "pixbuf", STATUS_ICON_COLUMN, + "visible", STATUS_ICON_VISIBLE_COLUMN, + "cell-background-gdk", BGCOLOR_COLUMN, + NULL); g_object_set(rend, "xalign", 0.0, "ypad", 0, NULL); gtkblist->text_rend = rend = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start (column, rend, TRUE); gtk_tree_view_column_set_attributes(column, rend, + "cell-background-gdk", BGCOLOR_COLUMN, "markup", NAME_COLUMN, NULL); g_signal_connect(G_OBJECT(rend), "edited", G_CALLBACK(gtk_blist_renderer_edited_cb), NULL); g_object_set(rend, "ypad", 0, "yalign", 0.5, NULL); #if GTK_CHECK_VERSION(2,6,0) - gtk_tree_view_column_set_expand (column, TRUE); g_object_set(rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); #endif gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), column); rend = gtk_cell_renderer_text_new(); - gtkblist->idle_column = gtk_tree_view_column_new_with_attributes("Idle", rend, "markup", IDLE_COLUMN, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), gtkblist->idle_column); g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); - + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, + "markup", IDLE_COLUMN, + "visible", IDLE_VISIBLE_COLUMN, + "cell-background-gdk", BGCOLOR_COLUMN, + NULL); + rend = gtk_cell_renderer_pixbuf_new(); - gtkblist->buddy_icon_column = gtk_tree_view_column_new_with_attributes("Buddy Icon", rend, "pixbuf", BUDDY_ICON_COLUMN, NULL); g_object_set(rend, "xalign", 1.0, "ypad", 0, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(gtkblist->treeview), gtkblist->buddy_icon_column); + gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_set_attributes(column, rend, "pixbuf", BUDDY_ICON_COLUMN, + "cell-background-gdk", BGCOLOR_COLUMN, + "visible", BUDDY_ICON_VISIBLE_COLUMN, + NULL); + + gtkblist->expander_expanded = gtk_widget_render_icon(gtkblist->treeview, GAIM_STOCK_EXPANDER_EXPANDED, -1, NULL); + gtkblist->expander_collapsed = gtk_widget_render_icon(gtkblist->treeview, GAIM_STOCK_EXPANDER_COLLAPSED, -1, NULL); + g_signal_connect(G_OBJECT(gtkblist->treeview), "row-activated", G_CALLBACK(gtk_blist_row_activated_cb), NULL); g_signal_connect(G_OBJECT(gtkblist->treeview), "row-expanded", G_CALLBACK(gtk_blist_row_expanded_cb), NULL); g_signal_connect(G_OBJECT(gtkblist->treeview), "row-collapsed", G_CALLBACK(gtk_blist_row_collapsed_cb), NULL); @@ -4332,6 +4366,13 @@ int count; gboolean show = FALSE; GaimBlistNode* gnode; + GdkColor bgcolor; + GdkColor textcolor; + + if (gtkblist) { + bgcolor = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; + textcolor = gtkblist->treeview->style->text[GTK_STATE_ACTIVE]; + } g_return_if_fail(node != NULL); @@ -4360,22 +4401,34 @@ if (show) { char *mark, *esc; GtkTreeIter iter; + GtkTreePath *path; + gboolean expanded; if(!insert_node(list, gnode, &iter)) return; + path = gtk_tree_model_get_path(gtkblist->treemodel, &iter); + expanded = gtk_tree_view_row_expanded(gtkblist->treeview, path); + gtk_tree_path_free(path); + esc = g_markup_escape_text(group->name, -1); - mark = g_strdup_printf("<span weight='bold'>%s</span> (%d/%d)", - esc, gaim_blist_get_group_online_count(group), - gaim_blist_get_group_size(group, FALSE)); + mark = g_strdup_printf("<span color='#%02x%02x%02x'><span weight='bold'>%s</span> (%d/%d)</span>", + textcolor.red>>8, textcolor.green>>8, textcolor.blue>>8, + esc, gaim_blist_get_group_online_count(group), + gaim_blist_get_group_size(group, FALSE)); g_free(esc); - + gtk_tree_store_set(gtkblist->treemodel, &iter, - STATUS_ICON_COLUMN, NULL, - STATUS_ICON_VISIBLE_COLUMN, FALSE, - NAME_COLUMN, mark, - NODE_COLUMN, gnode, - -1); + STATUS_ICON_VISIBLE_COLUMN, FALSE, + STATUS_ICON_COLUMN, NULL, + NAME_COLUMN, mark, + NODE_COLUMN, gnode, + BGCOLOR_COLUMN, &bgcolor, + GROUP_EXPANDER_COLUMN, expanded ? gtkblist->expander_expanded : gtkblist->expander_collapsed, + CONTACT_EXPANDER_VISIBLE_COLUMN, FALSE, + BUDDY_ICON_VISIBLE_COLUMN, FALSE, + IDLE_VISIBLE_COLUMN, FALSE, + -1); g_free(mark); } else { gaim_gtk_blist_hide_node(list, gnode, TRUE); @@ -4385,16 +4438,17 @@ static void buddy_node(GaimBuddy *buddy, GtkTreeIter *iter, GaimBlistNode *node) { GaimPresence *presence; + GdkColor expandcolor; GdkPixbuf *status, *avatar; char *mark; char *idle = NULL; + gboolean expanded = ((struct _gaim_gtk_blist_node*)(node->parent->ui_data))->contact_expanded; gboolean selected = (gtkblist->selected_node == node); - + gboolean biglist = gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"); presence = gaim_buddy_get_presence(buddy); status = gaim_gtk_blist_get_status_icon((GaimBlistNode*)buddy, - (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons") - ? GAIM_STATUS_ICON_LARGE : GAIM_STATUS_ICON_SMALL)); + biglist ? GAIM_STATUS_ICON_LARGE : GAIM_STATUS_ICON_SMALL); avatar = gaim_gtk_blist_get_buddy_icon((GaimBlistNode *)buddy, TRUE, TRUE); mark = gaim_gtk_blist_get_name_markup(buddy, selected); @@ -4426,12 +4480,26 @@ } } + if (expanded) { + GdkColor fore = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; + GdkColor back = gtkblist->treeview->style->base[GTK_STATE_NORMAL]; + expandcolor.red = (fore.red + back.red) / 2; + expandcolor.green = (fore.green + back.green) / 2; + expandcolor.blue = (fore.blue + back.blue) / 2; + } + + gtk_tree_store_set(gtkblist->treemodel, iter, - STATUS_ICON_COLUMN, status, - STATUS_ICON_VISIBLE_COLUMN, TRUE, - NAME_COLUMN, mark, - IDLE_COLUMN, idle, - BUDDY_ICON_COLUMN, avatar, + STATUS_ICON_COLUMN, status, + STATUS_ICON_VISIBLE_COLUMN, TRUE, + NAME_COLUMN, mark, + IDLE_COLUMN, idle, + IDLE_VISIBLE_COLUMN, !biglist && idle, + BUDDY_ICON_COLUMN, avatar, + BUDDY_ICON_VISIBLE_COLUMN, biglist, + BGCOLOR_COLUMN, expanded ? &expandcolor : NULL, + CONTACT_EXPANDER_COLUMN, NULL, + CONTACT_EXPANDER_VISIBLE_COLUMN, expanded, -1); g_free(mark); @@ -4450,6 +4518,13 @@ GaimContact *contact; GaimBuddy *buddy; struct _gaim_gtk_blist_node *gtknode; + GdkColor bgcolor; + GdkColor textcolor; + + if (gtkblist) { + bgcolor = gtkblist->treeview->style->base[GTK_STATE_ACTIVE]; + textcolor = gtkblist->treeview->style->text[GTK_STATE_ACTIVE]; + } if (GAIM_BLIST_NODE_IS_BUDDY(node)) cnode = node->parent; @@ -4479,21 +4554,29 @@ if(gtknode->contact_expanded) { GdkPixbuf *status; char *mark; + char *white; status = gaim_gtk_blist_get_status_icon(cnode, (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons") ? GAIM_STATUS_ICON_LARGE : GAIM_STATUS_ICON_SMALL)); mark = g_markup_escape_text(gaim_contact_get_alias(contact), -1); - + white = g_strdup_printf("<span color='#%02x%02x%02x'>%s</span>", + textcolor.red>>8, textcolor.green>>8, textcolor.blue>>8, + mark); + g_free(mark); gtk_tree_store_set(gtkblist->treemodel, &iter, - STATUS_ICON_COLUMN, status, - STATUS_ICON_VISIBLE_COLUMN, TRUE, - NAME_COLUMN, mark, - IDLE_COLUMN, NULL, - BUDDY_ICON_COLUMN, NULL, + STATUS_ICON_COLUMN, status, + STATUS_ICON_VISIBLE_COLUMN, TRUE, + NAME_COLUMN, white, + IDLE_COLUMN, NULL, + IDLE_VISIBLE_COLUMN, FALSE, + BGCOLOR_COLUMN, &bgcolor, + BUDDY_ICON_COLUMN, NULL, + CONTACT_EXPANDER_COLUMN, gtkblist->expander_expanded, + CONTACT_EXPANDER_VISIBLE_COLUMN, TRUE, -1); - g_free(mark); + g_free(white); if(status) g_object_unref(status); } else { Modified: trunk/gtk/gtkblist.h =================================================================== --- trunk/gtk/gtkblist.h 2006-09-01 18:34:53 UTC (rev 17116) +++ trunk/gtk/gtkblist.h 2006-09-01 20:13:47 UTC (rev 17117) @@ -32,8 +32,14 @@ STATUS_ICON_VISIBLE_COLUMN, NAME_COLUMN, IDLE_COLUMN, + IDLE_VISIBLE_COLUMN, BUDDY_ICON_COLUMN, + BUDDY_ICON_VISIBLE_COLUMN, NODE_COLUMN, + BGCOLOR_COLUMN, + GROUP_EXPANDER_COLUMN, + CONTACT_EXPANDER_COLUMN, + CONTACT_EXPANDER_VISIBLE_COLUMN, BLIST_COLUMNS }; @@ -93,7 +99,8 @@ GtkWidget *statusbox; /**< The status selector dropdown */ GdkPixbuf *east, *south; /**< Drop shadow stuff */ GdkWindow *east_shadow, *south_shadow; /**< Drop shadow stuff */ - + GdkPixbuf *expander_collapsed; /**< A collapsed expander */ + GdkPixbuf *expander_expanded; /**< An expanded expander */ }; #define GAIM_GTK_BLIST(list) ((GaimGtkBuddyList *)(list)->ui_data) Modified: trunk/gtk/pixmaps/Makefile.am =================================================================== --- trunk/gtk/pixmaps/Makefile.am 2006-09-01 18:34:53 UTC (rev 17116) +++ trunk/gtk/pixmaps/Makefile.am 2006-09-01 20:13:47 UTC (rev 17117) @@ -8,6 +8,8 @@ change-fgcolor-small.png \ connect.png \ edit.png \ + expander-expanded.png \ + expander-collapsed.png \ gaim.png \ gaim.svg \ gaim_auth.png \ @@ -82,7 +84,7 @@ gaimiconpix_DATA = away.png connect.png msgpend.png offline.png online.png msgunread.png stock_connect_16.png stock_disconnect_16.png gaimdistpixdir = $(datadir)/pixmaps/gaim -gaimdistpix_DATA = logo.png tb_drag_arrow_down.xpm tb_drag_arrow_left.xpm tb_drag_arrow_right.xpm tb_drag_arrow_up.xpm typed.png typing.png status-online.png status-offline.png status-away.png status-invisible.png status-typing0.png status-typing1.png status-typing2.png status-typing3.png status-connect0.png status-connect1.png status-connect2.png status-connect3.png phone.png +gaimdistpix_DATA = logo.png tb_drag_arrow_down.xpm tb_drag_arrow_left.xpm tb_drag_arrow_right.xpm tb_drag_arrow_up.xpm typed.png typing.png status-online.png status-offline.png status-away.png status-invisible.png status-typing0.png status-typing1.png status-typing2.png status-typing3.png status-connect0.png status-connect1.png status-connect2.png status-connect3.png phone.png expander-expanded.png expander-collapsed.png distpixmapdir = $(datadir)/pixmaps distpixmap_DATA = gaim.png gaim.svg This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-09-01 20:19:18
|
Revision: 17118 http://svn.sourceforge.net/gaim/?rev=17118&view=rev Author: seanegan Date: 2006-09-01 13:19:08 -0700 (Fri, 01 Sep 2006) Log Message: ----------- deryni: seanegan: Did you miss adding some icons: Added Paths: ----------- trunk/gtk/pixmaps/expander-collapsed.png trunk/gtk/pixmaps/expander-expanded.png Added: trunk/gtk/pixmaps/expander-collapsed.png =================================================================== (Binary files differ) Property changes on: trunk/gtk/pixmaps/expander-collapsed.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/gtk/pixmaps/expander-expanded.png =================================================================== (Binary files differ) Property changes on: trunk/gtk/pixmaps/expander-expanded.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 18:34:57
|
Revision: 17116 http://svn.sourceforge.net/gaim/?rev=17116&view=rev Author: sadrul Date: 2006-09-01 11:34:53 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Show the account name and prpl in conversation-window titles. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-09-01 18:29:50 UTC (rev 17115) +++ trunk/console/gntconv.c 2006-09-01 18:34:53 UTC (rev 17116) @@ -201,6 +201,7 @@ char *title; GaimConversationType type; GaimConversation *cc; + GaimAccount *account; if (ggc) return; @@ -220,8 +221,10 @@ return; } + account = gaim_conversation_get_account(conv); type = gaim_conversation_get_type(conv); - title = g_strdup_printf(_("%s"), gaim_conversation_get_title(conv)); + title = g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), + gaim_account_get_username(account), gaim_account_get_protocol_name(account)); ggc->window = gnt_box_new(FALSE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); @@ -633,11 +636,17 @@ void gg_conversation_set_active(GaimConversation *conv) { GGConv *ggconv = conv->ui_data; + GaimAccount *account; + char *title; g_return_if_fail(ggconv); g_return_if_fail(g_list_find(ggconv->list, conv)); ggconv->active_conv = conv; - gnt_screen_rename_widget(ggconv->window, gaim_conversation_get_title(conv)); + account = gaim_conversation_get_account(conv); + title = g_strdup_printf(_("%s (%s -- %s)"), gaim_conversation_get_title(conv), + gaim_account_get_username(account), gaim_account_get_protocol_name(account)); + gnt_screen_rename_widget(ggconv->window, title); + g_free(title); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 18:29:56
|
Revision: 17115 http://svn.sourceforge.net/gaim/?rev=17115&view=rev Author: sadrul Date: 2006-09-01 11:29:50 -0700 (Fri, 01 Sep 2006) Log Message: ----------- This should fix the problem. I am not sure why this is necessary though. Modified Paths: -------------- trunk/console/gntblist.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-09-01 18:18:04 UTC (rev 17114) +++ trunk/console/gntblist.c 2006-09-01 18:29:50 UTC (rev 17115) @@ -72,6 +72,30 @@ static const char * get_display_name(GaimBlistNode *node); static void savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old); +static gboolean +is_contact_online(GaimContact *contact) +{ + GaimBlistNode *node; + for (node = ((GaimBlistNode*)contact)->child; node; node = node->next) { + if (GAIM_BUDDY_IS_ONLINE((GaimBuddy*)node)) + return TRUE; + } + return FALSE; +} + +static gboolean +is_group_online(GaimGroup *group) +{ + GaimBlistNode *node; + for (node = ((GaimBlistNode*)group)->child; node; node = node->next) { + if (GAIM_BLIST_NODE_IS_CHAT(node)) + return TRUE; + else if (is_contact_online((GaimContact*)node)) + return TRUE; + } + return FALSE; +} + static void new_node(GaimBlistNode *node) { @@ -111,11 +135,12 @@ if (GAIM_BLIST_NODE_IS_BUDDY(node)) { GaimContact *contact = (GaimContact*)node->parent; - if (contact->online < 1) + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) || + contact->currentsize < 1) node_remove(list, (GaimBlistNode*)contact); } else if (GAIM_BLIST_NODE_IS_CONTACT(node)) { GaimGroup *group = (GaimGroup*)node->parent; - if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && group->online < 1) || + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || group->currentsize < 1) node_remove(list, node->parent); } @@ -149,6 +174,16 @@ node_update(list, node->parent); } else if (GAIM_BLIST_NODE_IS_CHAT(node)) { add_chat((GaimChat *)node, list->ui_data); + } else if (GAIM_BLIST_NODE_IS_CONTACT(node)) { + GaimContact *contact = (GaimContact*)node; + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) || + contact->currentsize < 1) + node_remove(gaim_get_blist(), node); + } else if (GAIM_BLIST_NODE_IS_GROUP(node)) { + GaimGroup *group = (GaimGroup*)node; + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) || + group->currentsize < 1) + node_remove(list, node); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-09-01 18:18:16
|
Revision: 17114 http://svn.sourceforge.net/gaim/?rev=17114&view=rev Author: eblanton Date: 2006-09-01 11:18:04 -0700 (Fri, 01 Sep 2006) Log Message: ----------- This really happened Modified Paths: -------------- trunk/doc/gaims_funniest_home_convos.txt Modified: trunk/doc/gaims_funniest_home_convos.txt =================================================================== --- trunk/doc/gaims_funniest_home_convos.txt 2006-09-01 12:06:51 UTC (rev 17113) +++ trunk/doc/gaims_funniest_home_convos.txt 2006-09-01 18:18:04 UTC (rev 17114) @@ -373,3 +373,14 @@ 19:49 <someusr> OH! 19:49 <someusr> haha 19:49 <someusr> thanks! + +14:12 <colorshape> Is it possible for me to see my friends webcam via + msn in gaim? +14:12 <Paco-Paco> no +14:13 <colorshape> not voice either then i guess? +14:13 <Paco-Paco> correct +14:13 <colorshape> ok, then not much to do. +14:13 <Err> there's always seppuku +14:14 <Paco-Paco> so true +14:14 <colorshape> ok, is that another client? +14:14 <Err> something like that This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 12:07:04
|
Revision: 17113 http://svn.sourceforge.net/gaim/?rev=17113&view=rev Author: sadrul Date: 2006-09-01 05:06:51 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Pressing Alt+a will bring up a list of available 'actions', which you can use show the buddylist/accounts/debug etc. windows. Pressing ctrl+o in the buddylist will toggle showing online/offline users. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntui.c trunk/console/libgnt/gnt.h trunk/console/libgnt/gntmain.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-09-01 11:03:18 UTC (rev 17112) +++ trunk/console/gntblist.c 2006-09-01 12:06:51 UTC (rev 17113) @@ -1130,6 +1130,13 @@ ret = TRUE; } } + else if (strcmp(text, GNT_KEY_CTRL_O) == 0) + { + gaim_prefs_set_bool(PREF_ROOT "/showoffline", + !gaim_prefs_get_bool(PREF_ROOT "/showoffline")); + ret = TRUE; + stop = TRUE; + } if (stop) g_signal_stop_emission_by_name(G_OBJECT(widget), "key_pressed"); Modified: trunk/console/gntui.c =================================================================== --- trunk/console/gntui.c 2006-09-01 11:03:18 UTC (rev 17112) +++ trunk/console/gntui.c 2006-09-01 12:06:51 UTC (rev 17113) @@ -4,10 +4,15 @@ #include "gntblist.h" #include "gntconn.h" #include "gntconv.h" +#include "gntdebug.h" #include "gntnotify.h" #include "gntplugin.h" +#include "gntprefs.h" #include "gntrequest.h" +#include "gntstatus.h" +#include "internal.h" + #include <prefs.h> void init_gnt_ui() @@ -41,7 +46,12 @@ gg_request_init(); gaim_request_set_ui_ops(gg_request_get_ui_ops()); - gg_plugins_show_all(); + gnt_register_action(_("Accounts"), gg_accounts_show_all); + gnt_register_action(_("Buddy List"), gg_blist_show); + gnt_register_action(_("Debug Window"), gg_debug_window_show); + gnt_register_action(_("Plugins"), gg_plugins_show_all); + gnt_register_action(_("Preferences"), gg_prefs_show_all); + gnt_register_action(_("Statuses"), gg_savedstatus_show_all); #ifdef STANDALONE Modified: trunk/console/libgnt/gnt.h =================================================================== --- trunk/console/libgnt/gnt.h 2006-09-01 11:03:18 UTC (rev 17112) +++ trunk/console/libgnt/gnt.h 2006-09-01 12:06:51 UTC (rev 17113) @@ -27,5 +27,7 @@ void gnt_widget_set_urgent(GntWidget *widget); +void gnt_register_action(const char *label, void (*callback)()); + void gnt_quit(); Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-09-01 11:03:18 UTC (rev 17112) +++ trunk/console/libgnt/gntmain.c 2006-09-01 12:06:51 UTC (rev 17113) @@ -46,11 +46,12 @@ static gboolean mouse_enabled; static GMainLoop *loop; + static struct { GntWidget *window; GntWidget *tree; -} window_list; +} _list, *window_list, *action_list; typedef struct { @@ -77,6 +78,8 @@ static gboolean refresh_screen(); static const GList *list_all_windows(); +static void show_actions_list(); + static GntWM wm = { NULL, /* new_window */ @@ -174,9 +177,9 @@ gnt_widget_draw(widget); top_panel(node->panel); - if (window_list.window) + if (_list.window) { - GntNode *nd = g_hash_table_lookup(nodes, window_list.window); + GntNode *nd = g_hash_table_lookup(nodes, _list.window); top_panel(nd->panel); } update_screen(NULL); @@ -188,7 +191,7 @@ { GntTextFormatFlags flag = 0; - if (window_list.window == NULL) + if (window_list == NULL) return; if (wid == ordered->data) @@ -196,7 +199,7 @@ else if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT)) flag |= GNT_TEXT_FLAG_BOLD; - gnt_tree_set_row_flags(GNT_TREE(window_list.tree), wid, flag); + gnt_tree_set_row_flags(GNT_TREE(window_list->tree), wid, flag); } static void @@ -327,21 +330,35 @@ } static void +setup__list() +{ + GntWidget *tree, *win; + win = _list.window = gnt_box_new(FALSE, FALSE); + gnt_box_set_toplevel(GNT_BOX(win), TRUE); + gnt_box_set_pad(GNT_BOX(win), 0); + + tree = _list.tree = gnt_tree_new(); + gnt_box_add_widget(GNT_BOX(win), tree); +} + +static void show_window_list() { GntWidget *tree, *win; GList *iter; - if (window_list.window) + if (window_list) return; + + setup__list(); - win = window_list.window = gnt_box_new(FALSE, FALSE); - gnt_box_set_toplevel(GNT_BOX(win), TRUE); + window_list = &_list; + + win = window_list->window; + tree = window_list->tree; + gnt_box_set_title(GNT_BOX(win), "Window List"); - gnt_box_set_pad(GNT_BOX(win), 0); - tree = window_list.tree = gnt_tree_new(); - for (iter = focus_list; iter; iter = iter->next) { GntBox *box = GNT_BOX(iter->data); @@ -352,7 +369,7 @@ } gnt_tree_set_selected(GNT_TREE(tree), ordered->data); - gnt_box_add_widget(GNT_BOX(win), tree); + g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), NULL); gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3); gnt_widget_set_size(tree, 0, getmaxy(stdscr) / 2); @@ -361,8 +378,6 @@ lock_focus_list = 1; gnt_widget_show(win); lock_focus_list = 0; - - g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), NULL); } static void @@ -720,6 +735,11 @@ mode = GNT_KP_MODE_WINDOW_LIST; show_window_list(); } + else if (strcmp(buffer + 1, "a") == 0) + { + mode = GNT_KP_MODE_WINDOW_LIST; + show_actions_list(); + } else if (strcmp(buffer + 1, "r") == 0 && focus_list) { /* Resize window */ @@ -810,18 +830,20 @@ mode = GNT_KP_MODE_NORMAL; } } - else if (mode == GNT_KP_MODE_WINDOW_LIST && window_list.window) + else if (mode == GNT_KP_MODE_WINDOW_LIST && _list.window) { - gnt_widget_key_pressed(window_list.window, buffer); + gnt_widget_key_pressed(_list.window, buffer); if (buffer[0] == '\r' || (buffer[0] == 27 && buffer[1] == 0)) { mode = GNT_KP_MODE_NORMAL; lock_focus_list = 1; - gnt_widget_destroy(window_list.window); - window_list.window = NULL; - window_list.tree = NULL; + gnt_widget_destroy(_list.window); + _list.window = NULL; + _list.tree = NULL; lock_focus_list = 0; + window_list = NULL; + action_list = NULL; } } else if (mode == GNT_KP_MODE_RESIZE) @@ -1054,13 +1076,13 @@ refresh_node(widget, node, NULL); - if (window_list.window) + if (window_list) { - if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget + if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list->window != widget && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) { - gnt_tree_add_row_last(GNT_TREE(window_list.tree), widget, - gnt_tree_create_row(GNT_TREE(window_list.tree), GNT_BOX(widget)->title), + gnt_tree_add_row_last(GNT_TREE(window_list->tree), widget, + gnt_tree_create_row(GNT_TREE(window_list->tree), GNT_BOX(widget)->title), NULL); update_window_in_list(widget); } @@ -1081,9 +1103,9 @@ g_hash_table_remove(nodes, widget); - if (window_list.window) + if (window_list) { - gnt_tree_remove(GNT_TREE(window_list.tree), widget); + gnt_tree_remove(GNT_TREE(window_list->tree), widget); } update_screen(NULL); @@ -1100,7 +1122,7 @@ node = g_hash_table_lookup(nodes, widget); if (node && !node->panel) { - if (wm.new_window) + if (wm.new_window && node->me != _list.window) node->panel = wm.new_window(node->me); else node->panel = new_panel(node->me->window); @@ -1111,9 +1133,9 @@ } } - if (window_list.window) + if (_list.window) { - GntNode *nd = g_hash_table_lookup(nodes, window_list.window); + GntNode *nd = g_hash_table_lookup(nodes, _list.window); top_panel(nd->panel); } @@ -1131,7 +1153,7 @@ while (widget->parent) widget = widget->parent; - if (widget == window_list.window) + if (widget == _list.window) return TRUE; if (ordered && ordered->data == widget) @@ -1226,3 +1248,74 @@ draw_taskbar(FALSE); } +/** + * An application can register actions which will show up in a 'start-menu' like popup + */ +typedef struct _GnAction +{ + const char *label; + void (*callback)(); +} GntAction; + +static GList *actions; + +void gnt_register_action(const char *label, void (*callback)()) +{ + GntAction *action = g_new0(GntAction, 1); + action->label = g_strdup(label); + action->callback = callback; + + actions = g_list_append(actions, action); +} + +static void +action_list_activate(GntTree *tree, gpointer null) +{ + GntAction *action = gnt_tree_get_selection_data(tree); + action->callback(); +} + +static int +compare_action(gconstpointer p1, gconstpointer p2) +{ + const GntAction *a1 = p1; + const GntAction *a2 = p2; + + return g_utf8_collate(a1->label, a2->label); +} + +static void +show_actions_list() +{ + GntWidget *tree, *win; + GList *iter; + int h; + + if (action_list) + return; + + setup__list(); + action_list = &_list; + win = action_list->window; + tree = action_list->tree; + + gnt_box_set_title(GNT_BOX(win), "Available Actions"); + GNT_WIDGET_SET_FLAGS(tree, GNT_WIDGET_NO_BORDER); + /* XXX: Do we really want this? */ + gnt_tree_set_compare_func(GNT_TREE(tree), compare_action); + + for (iter = actions; iter; iter = iter->next) { + GntAction *action = iter->data; + gnt_tree_add_row_last(GNT_TREE(tree), action, + gnt_tree_create_row(GNT_TREE(tree), action->label), NULL); + } + g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(action_list_activate), NULL); + gnt_widget_set_size(tree, 0, g_list_length(actions)); + gnt_widget_get_size(win, NULL, &h); + gnt_widget_set_position(win, 0, getmaxy(stdscr) - 1 - h); + + lock_focus_list = 1; + gnt_widget_show(win); + lock_focus_list = 0; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-09-01 11:03:41
|
Revision: 17112 http://svn.sourceforge.net/gaim/?rev=17112&view=rev Author: markhuetsch Date: 2006-09-01 04:03:18 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Fixed chat support. Modified Paths: -------------- trunk/libgaim/protocols/qq/Makefile.am trunk/libgaim/protocols/qq/Makefile.mingw trunk/libgaim/protocols/qq/buddy_list.c trunk/libgaim/protocols/qq/group.c trunk/libgaim/protocols/qq/group.h trunk/libgaim/protocols/qq/group_conv.c trunk/libgaim/protocols/qq/group_find.c trunk/libgaim/protocols/qq/group_find.h trunk/libgaim/protocols/qq/group_free.c trunk/libgaim/protocols/qq/group_free.h trunk/libgaim/protocols/qq/group_im.c trunk/libgaim/protocols/qq/group_info.c trunk/libgaim/protocols/qq/group_info.h trunk/libgaim/protocols/qq/group_join.c trunk/libgaim/protocols/qq/group_join.h trunk/libgaim/protocols/qq/group_network.c trunk/libgaim/protocols/qq/group_opt.c trunk/libgaim/protocols/qq/group_search.c trunk/libgaim/protocols/qq/login_logout.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/qq.h trunk/libgaim/protocols/qq/utils.c trunk/libgaim/protocols/qq/utils.h Added Paths: ----------- trunk/libgaim/protocols/qq/group_internal.c trunk/libgaim/protocols/qq/group_internal.h Removed Paths: ------------- trunk/libgaim/protocols/qq/group_hash.c trunk/libgaim/protocols/qq/group_hash.h Modified: trunk/libgaim/protocols/qq/Makefile.am =================================================================== --- trunk/libgaim/protocols/qq/Makefile.am 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/Makefile.am 2006-09-01 11:03:18 UTC (rev 17112) @@ -22,15 +22,15 @@ crypt.c \ crypt.h \ group.c \ + group.h \ group_conv.c \ group_conv.h \ group_find.c \ group_find.h \ group_free.c \ group_free.h \ - group.h \ - group_hash.c \ - group_hash.h \ + group_internal.c \ + group_internal.h \ group_im.c \ group_im.h \ group_info.c \ Modified: trunk/libgaim/protocols/qq/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/qq/Makefile.mingw 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/Makefile.mingw 2006-09-01 11:03:18 UTC (rev 17112) @@ -54,7 +54,7 @@ group_conv.c \ group_find.c \ group_free.c \ - group_hash.c \ + group_internal.c \ group_im.c \ group_info.c \ group_join.c \ Modified: trunk/libgaim/protocols/qq/buddy_list.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_list.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/buddy_list.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -37,7 +37,7 @@ #include "qq.h" #include "group.h" #include "group_find.h" -#include "group_hash.h" +#include "group_internal.h" #include "group_info.h" #include "qq_proxy.h" @@ -222,7 +222,7 @@ } else { gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "Got an online buddy %d, but not in my buddy list", fe->s->uid); + "Got an online buddy %d, but not in my buddy list\n", fe->s->uid); } g_free(fe->s->ip); @@ -231,11 +231,11 @@ if(cursor > (data + len)) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "qq_process_get_buddies_online_reply: Dangerous error! maybe protocol changed, notify developers!"); + "qq_process_get_buddies_online_reply: Dangerous error! maybe protocol changed, notify developers!\n"); } if (position != QQ_FRIENDS_ONLINE_POSITION_END) { - gaim_debug(GAIM_DEBUG_INFO, "QQ", "Has more online buddies, position from %d", position); + gaim_debug(GAIM_DEBUG_INFO, "QQ", "Has more online buddies, position from %d\n", position); qq_send_packet_get_buddies_online(gc, position); } @@ -352,10 +352,6 @@ guint32 unknown, position; guint32 uid; guint8 type, groupid; - - qq_buddy *q_bud; - gchar *name; - GaimBuddy *b; qq_group *group; g_return_if_fail(gc != NULL && gc->proto_data != NULL); @@ -384,41 +380,28 @@ read_packet_dw(data, &cursor, len, &uid); /* 04: type 0x1:buddy 0x4:Qun */ read_packet_b(data, &cursor, len, &type); - /* 05: groupid*4 */ + /* 05: groupid*4 */ /* seems to always be 0 */ read_packet_b(data, &cursor, len, &groupid); - groupid >>= 2; /* these 2 bits might not be 0, faint! */ + /* + gaim_debug(GAIM_DEBUG_INFO, "QQ", "groupid: %i\n", groupid); + groupid >>= 2; + */ if (uid == 0 || (type != 0x1 && type != 0x4)) { - gaim_debug(GAIM_DEBUG_WARNING, "QQ", + gaim_debug(GAIM_DEBUG_INFO, "QQ", "Buddy entry, uid=%d, type=%d", uid, type); continue; } if(0x1 == type) { /* a buddy */ - name = uid_to_gaim_name(uid); - b = gaim_find_buddy(gc->account, name); - g_free(name); - - if (b == NULL) { - b = qq_add_buddy_by_recv_packet(gc, uid, TRUE, TRUE); - q_bud = b->proto_data; - } - else { - q_bud = NULL; - b->proto_data = q_bud; /* wrong !!!! */ - } - qd->buddies = g_list_append(qd->buddies, q_bud); - qq_update_buddy_contact(gc, q_bud); + /* don't do anything but count - buddies are handled by + * qq_send_packet_get_buddies_list */ ++i; } else { /* a group */ - group = qq_group_find_by_internal_group_id(gc, uid); + group = qq_group_find_by_id(gc, uid, QQ_INTERNAL_ID); if(group == NULL) { - /*XXX not working - group = qq_group_create_by_id(gc, uid, 0); + qq_set_pending_id(&qd->adding_groups_from_server, uid, TRUE); + group = g_newa(qq_group, 1); + group->internal_group_id = uid; qq_send_cmd_group_get_group_info(gc, group); - */ - gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "Get a Qun with internal group %d\n", uid); - gaim_notify_info(gc, _("QQ Qun Operation"), - _("Find one Qun in the server list, but i don't know its external id, please re-rejoin it manually"), NULL); } else { group->my_status = QQ_GROUP_MEMBER_STATUS_IS_MEMBER; qq_group_refresh(gc, group); Modified: trunk/libgaim/protocols/qq/group.c =================================================================== --- trunk/libgaim/protocols/qq/group.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -26,7 +26,7 @@ #include "prpl.h" #include "request.h" -#include "group_hash.h" +#include "group_internal.h" #include "group_info.h" #include "group_search.h" #include "utils.h" @@ -43,6 +43,15 @@ qq_send_cmd_group_search_group(gc, external_group_id); } +static void _qq_group_search_cancel_callback(GaimConnection *gc, const gchar *input) +{ + qq_data *qd; + g_return_if_fail(gc != NULL && gc->proto_data != NULL); + + qd = (qq_data *) gc->proto_data; + gaim_roomlist_set_in_progress(qd->roomlist, FALSE); +} + /* This is needed for GaimChat node to be valid */ GList *qq_chat_info(GaimConnection *gc) { @@ -55,18 +64,20 @@ pce->label = _("ID: "); pce->identifier = QQ_GROUP_KEY_EXTERNAL_ID; m = g_list_append(m, pce); + + return m; +} - pce = g_new0(struct proto_chat_entry, 1); - pce->label = _("Admin: "); - pce->identifier = QQ_GROUP_KEY_CREATOR_UID; - m = g_list_append(m, pce); +GHashTable *qq_chat_info_defaults(GaimConnection *gc, const gchar *chat_name) +{ + GHashTable *defaults; - pce = g_new0(struct proto_chat_entry, 1); - pce->label = _("Status: "); - pce->identifier = QQ_GROUP_KEY_MEMBER_STATUS_DESC; - m = g_list_append(m, pce); + defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); - return m; + if (chat_name != NULL) + g_hash_table_insert(defaults, QQ_GROUP_KEY_EXTERNAL_ID, g_strdup(chat_name)); + + return defaults; } /* get a list of qq groups */ @@ -107,9 +118,11 @@ gaim_request_input(gc, _("QQ Qun"), _("Please input external group ID"), - _("You can only search for permanent QQ group\nInput 0 or leave it blank to search for demo groups"), - NULL, FALSE, FALSE, NULL, _("Search"), - G_CALLBACK(_qq_group_search_callback), _("Cancel"), NULL, gc); + _("You can only search for permanent QQ groups\n"), + NULL, FALSE, FALSE, NULL, + _("Search"), G_CALLBACK(_qq_group_search_callback), + _("Cancel"), G_CALLBACK(_qq_group_search_cancel_callback), + gc); return qd->roomlist; } Modified: trunk/libgaim/protocols/qq/group.h =================================================================== --- trunk/libgaim/protocols/qq/group.h 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group.h 2006-09-01 11:03:18 UTC (rev 17112) @@ -39,7 +39,7 @@ } qq_group_member_status; typedef struct _qq_group { - /* all these will be saved when exit GAIM */ + /* all these will be saved when we exit Gaim */ qq_group_member_status my_status; /* my status for this group */ gchar *my_status_desc; /* my status description */ guint32 internal_group_id; @@ -50,12 +50,13 @@ guint8 auth_type; gchar *group_name_utf8; gchar *group_desc_utf8; - /* all these will loaded from network only */ + /* all these will be loaded from the network */ gchar *notice_utf8; /* group notice by admin */ - GList *members; /* those evert appear in the group */ + GList *members; } qq_group; GList *qq_chat_info(GaimConnection *gc); +GHashTable *qq_chat_info_defaults(GaimConnection *gc, const gchar *chat_name); void qq_group_init(GaimConnection *gc); Modified: trunk/libgaim/protocols/qq/group_conv.c =================================================================== --- trunk/libgaim/protocols/qq/group_conv.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_conv.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -37,7 +37,8 @@ g_return_if_fail(gc != NULL && gc->proto_data != NULL && group != NULL); qd = (qq_data *) gc->proto_data; - conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, group->group_name_utf8, gaim_connection_get_account(gc)); + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, + group->group_name_utf8, gaim_connection_get_account(gc)); if (conv == NULL) /* show only one window per group */ serv_got_joined_chat(gc, qd->channel++, group->group_name_utf8); } @@ -54,17 +55,19 @@ names = NULL; flags = NULL; - conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, group->group_name_utf8, gaim_connection_get_account(gc)); + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, + group->group_name_utf8, gaim_connection_get_account(gc)); if (conv != NULL && group->members != NULL) { list = group->members; while (list != NULL) { member = (qq_buddy *) list->data; /* always put it even offline */ names = g_list_append(names, - (member->nickname != - NULL) ? - g_strdup(member->nickname) : uid_to_gaim_name(member->uid)); - + /* we need unique identifiers for everyone in the chat or else we'll + * run into problems with functions like get_cb_real_name from qq.c */ + (member->nickname != NULL && *(member->nickname) != '\0') ? + g_strdup_printf("%s (qq-%u)", member->nickname, member->uid) : + g_strdup_printf("(qq-%u)", member->uid)); flag = 0; /* TYPING to put online above OP and FOUNDER */ if (is_online(member->status)) flag |= (GAIM_CBFLAGS_TYPING | GAIM_CBFLAGS_VOICE); Modified: trunk/libgaim/protocols/qq/group_find.c =================================================================== --- trunk/libgaim/protocols/qq/group_find.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_find.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -29,38 +29,6 @@ #include "qq.h" #include "utils.h" -/* find a chat member's valid gaim_name of its nickname and chat room channel */ -gchar *qq_group_find_member_by_channel_and_nickname(GaimConnection *gc, gint channel, const gchar *who) -{ - qq_group *group; - qq_buddy *member; - GList *list; - - g_return_val_if_fail(gc != NULL && who != NULL, NULL); - - /* TODO checkbox for this in UI */ - /* if it starts with QQ_NAME_PREFIX, we think it is valid name already - * otherwise we think it is nickname and try to find the matching gaim_name */ - /* - if (gaim_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0) - return (gchar *) who; - */ - - group = qq_group_find_by_channel(gc, channel); - g_return_val_if_fail(group != NULL, NULL); - - list = group->members; - member = NULL; - while (list != NULL) { - member = (qq_buddy *) list->data; - if (member->nickname != NULL && !g_ascii_strcasecmp(member->nickname, who)) - break; - list = list->next; - } - - return (member == NULL) ? NULL : uid_to_gaim_name(member->uid); -} - /* find the internal_group_id by the reply packet sequence * return TRUE if we have a record of it, return FALSE if not */ gboolean qq_group_find_internal_group_id_by_seq(GaimConnection *gc, guint16 seq, guint32 *internal_group_id) @@ -69,7 +37,10 @@ qq_data *qd; group_packet *p; - g_return_val_if_fail(gc != NULL && gc->proto_data != NULL && internal_group_id != NULL, FALSE); + g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, FALSE); + + if (internal_group_id == NULL) + return FALSE; qd = (qq_data *) gc->proto_data; list = qd->group_packets; @@ -87,7 +58,7 @@ return FALSE; } -/* find a qq_buddy by uid, called by qq_im.c */ +/* find a qq_buddy by uid, called by im.c */ qq_buddy *qq_group_find_member_by_uid(qq_group *group, guint32 uid) { GList *list; @@ -138,7 +109,7 @@ buddy = gaim_find_buddy(gaim_connection_get_account(gc), uid_to_gaim_name(member_uid)); if (buddy != NULL) { q_bud = (qq_buddy *) buddy->proto_data; - if (q_bud != NULL) + if (q_bud != NULL && q_bud->nickname != NULL) member->nickname = g_strdup(q_bud->nickname); else if (buddy->alias != NULL) member->nickname = g_strdup(buddy->alias); @@ -175,23 +146,24 @@ return group; } -/* find a qq_group by internal_group_id */ -qq_group *qq_group_find_by_internal_group_id(GaimConnection *gc, guint32 internal_group_id) +/* find a qq_group by its id, flag is QQ_INTERNAL_ID or QQ_EXTERNAL_ID */ +qq_group *qq_group_find_by_id(GaimConnection *gc, guint32 id, gboolean flag) { GList *list; qq_group *group; qq_data *qd; - g_return_val_if_fail(gc != NULL && gc->proto_data != NULL && internal_group_id > 0, NULL); - + g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, NULL); qd = (qq_data *) gc->proto_data; - if (qd->groups == NULL) + + if (qd->groups == NULL || id <= 0) return NULL; list = qd->groups; while (list != NULL) { group = (qq_group *) list->data; - if (group->internal_group_id == internal_group_id) + if (flag == QQ_INTERNAL_ID ? + (group->internal_group_id == id) : (group->external_group_id == id)) return group; list = list->next; } Modified: trunk/libgaim/protocols/qq/group_find.h =================================================================== --- trunk/libgaim/protocols/qq/group_find.h 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_find.h 2006-09-01 11:03:18 UTC (rev 17112) @@ -27,12 +27,14 @@ #include "connection.h" #include "group.h" -gchar *qq_group_find_member_by_channel_and_nickname(GaimConnection *gc, gint channel, const gchar *who); +#define QQ_INTERNAL_ID 0 +#define QQ_EXTERNAL_ID 1 + qq_buddy *qq_group_find_member_by_uid(qq_group *group, guint32 uid); void qq_group_remove_member_by_uid(qq_group *group, guint32 uid); qq_buddy *qq_group_find_or_add_member(GaimConnection *gc, qq_group *group, guint32 member_uid); gboolean qq_group_find_internal_group_id_by_seq(GaimConnection *gc, guint16 seq, guint32 *internal_group_id); qq_group *qq_group_find_by_channel(GaimConnection *gc, gint channel); -qq_group *qq_group_find_by_internal_group_id(GaimConnection *gc, guint32 internal_group_id); +qq_group *qq_group_find_by_id(GaimConnection *gc, guint32 id, gboolean flag); #endif Modified: trunk/libgaim/protocols/qq/group_free.c =================================================================== --- trunk/libgaim/protocols/qq/group_free.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_free.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -23,12 +23,11 @@ #include "debug.h" #include "buddy_status.h" -#include "group.h" #include "group_free.h" #include "group_network.h" /* gracefully free all members in a group */ -static void _qq_group_free_member(qq_group *group) +static void qq_group_free_member(qq_group *group) { gint i; GList *list; @@ -48,10 +47,10 @@ } /* gracefully free the memory for one qq_group */ -static void _qq_group_free(qq_group *group) +void qq_group_free(qq_group *group) { g_return_if_fail(group != NULL); - _qq_group_free_member(group); + qq_group_free_member(group); g_free(group->group_name_utf8); g_free(group->group_desc_utf8); g_free(group); @@ -73,25 +72,6 @@ gaim_debug(GAIM_DEBUG_INFO, "QQ", "%d group packets are freed!\n", i); } -void qq_group_remove_by_internal_group_id(qq_data *qd, guint32 internal_group_id) -{ - qq_group *group; - GList *list; - g_return_if_fail(qd != NULL); - - list = qd->groups; - while (list != NULL) { - group = (qq_group *) qd->groups->data; - if (internal_group_id == group->internal_group_id) { - qd->groups = g_list_remove(qd->groups, group); - _qq_group_free(group); - break; - } else { - list = list->next; - } - } -} - void qq_group_free_all(qq_data *qd) { qq_group *group; @@ -103,7 +83,7 @@ i++; group = (qq_group *) qd->groups->data; qd->groups = g_list_remove(qd->groups, group); - _qq_group_free(group); + qq_group_free(group); } gaim_debug(GAIM_DEBUG_INFO, "QQ", "%d groups are freed\n", i); Modified: trunk/libgaim/protocols/qq/group_free.h =================================================================== --- trunk/libgaim/protocols/qq/group_free.h 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_free.h 2006-09-01 11:03:18 UTC (rev 17112) @@ -25,11 +25,11 @@ #include <glib.h> #include "qq.h" +#include "group.h" void qq_group_packets_free(qq_data *qd); +void qq_group_free(qq_group *group); void qq_group_free_all(qq_data *qd); -void qq_group_remove_by_internal_group_id(qq_data *qd, guint32 internal_group_id); - #endif Deleted: trunk/libgaim/protocols/qq/group_hash.c =================================================================== --- trunk/libgaim/protocols/qq/group_hash.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_hash.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -1,195 +0,0 @@ -/** -* The QQ2003C protocol plugin - * - * for gaim - * - * Copyright (C) 2004 Puzzlebird - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "blist.h" -#include "debug.h" - -#include "buddy_opt.h" -#include "group_hash.h" -#include "group_misc.h" -#include "utils.h" - -static gchar *_qq_group_set_my_status_desc(qq_group *group) -{ - const char *status_desc; - g_return_val_if_fail(group != NULL, g_strdup("")); - - switch (group->my_status) { - case QQ_GROUP_MEMBER_STATUS_NOT_MEMBER: - status_desc = _("I am not member"); - break; - case QQ_GROUP_MEMBER_STATUS_IS_MEMBER: - status_desc = _("I am a member"); - break; - case QQ_GROUP_MEMBER_STATUS_APPLYING: - status_desc = _("I am applying to join"); - break; - case QQ_GROUP_MEMBER_STATUS_IS_ADMIN: - status_desc = _("I am the admin"); - break; - default: - status_desc = _("Unknown status"); - } - - return g_strdup(status_desc); -} - -static void _qq_group_add_to_blist(GaimConnection *gc, qq_group *group) -{ - GHashTable *components; - GaimGroup *g; - GaimChat *chat; - components = qq_group_to_hashtable(group); - chat = gaim_chat_new(gaim_connection_get_account(gc), group->group_name_utf8, components); - g = qq_get_gaim_group(GAIM_GROUP_QQ_QUN); - gaim_blist_add_chat(chat, g, NULL); - gaim_debug(GAIM_DEBUG_INFO, "QQ", "You have add group \"%s\" to blist locally\n", group->group_name_utf8); -} - -/* create a dummy qq_group, which includes only internal_id and external_id - * all other attributes should be set to empty. - * and we need to send a get_group_info to QQ server to update it right away */ -qq_group *qq_group_create_by_id(GaimConnection *gc, guint32 internal_id, guint32 external_id) -{ - qq_group *group; - qq_data *qd; - - g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, NULL); - g_return_val_if_fail(internal_id > 0, NULL); - qd = (qq_data *) gc->proto_data; - - group = g_new0(qq_group, 1); - group->my_status = QQ_GROUP_MEMBER_STATUS_NOT_MEMBER; - group->my_status_desc = _qq_group_set_my_status_desc(group); - group->internal_group_id = internal_id; - group->external_group_id = external_id; - group->group_type = 0x01; /* assume permanent Qun */ - group->creator_uid = 10000; /* assume by QQ admin */ - group->group_category = 0x01; - group->auth_type = 0x02; /* assume need auth */ - group->group_name_utf8 = g_strdup(""); - group->group_desc_utf8 = g_strdup(""); - group->notice_utf8 = g_strdup(""); - group->members = NULL; - - qd->groups = g_list_append(qd->groups, group); - _qq_group_add_to_blist(gc, group); - - return group; -} - -/* convert a qq_group to hash-table, which could be component of GaimChat */ -GHashTable *qq_group_to_hashtable(qq_group *group) -{ - GHashTable *components; - components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_MEMBER_STATUS), g_strdup_printf("%d", group->my_status)); - group->my_status_desc = _qq_group_set_my_status_desc(group); - - g_hash_table_insert(components, - g_strdup(QQ_GROUP_KEY_INTERNAL_ID), g_strdup_printf("%d", group->internal_group_id)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_EXTERNAL_ID), - g_strdup_printf("%d", group->external_group_id)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_GROUP_TYPE), g_strdup_printf("%d", group->group_type)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_CREATOR_UID), g_strdup_printf("%d", group->creator_uid)); - g_hash_table_insert(components, - g_strdup(QQ_GROUP_KEY_GROUP_CATEGORY), g_strdup_printf("%d", group->group_category)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_AUTH_TYPE), g_strdup_printf("%d", group->auth_type)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_MEMBER_STATUS_DESC), g_strdup(group->my_status_desc)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_GROUP_NAME_UTF8), g_strdup(group->group_name_utf8)); - g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_GROUP_DESC_UTF8), g_strdup(group->group_desc_utf8)); - return components; -} - -/* create a qq_group from hashtable */ -qq_group *qq_group_from_hashtable(GaimConnection *gc, GHashTable *data) -{ - qq_data *qd; - qq_group *group; - - g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, NULL); - g_return_val_if_fail(data != NULL, NULL); - qd = (qq_data *) gc->proto_data; - - group = g_new0(qq_group, 1); - group->my_status = - qq_string_to_dec_value - (NULL == - g_hash_table_lookup(data, - QQ_GROUP_KEY_MEMBER_STATUS) ? - g_strdup_printf("%d", - QQ_GROUP_MEMBER_STATUS_NOT_MEMBER) : - g_hash_table_lookup(data, QQ_GROUP_KEY_MEMBER_STATUS)); - group->internal_group_id = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_INTERNAL_ID)); - group->external_group_id = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_EXTERNAL_ID)); - group->group_type = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_TYPE)); - group->creator_uid = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_CREATOR_UID)); - group->group_category = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_CATEGORY)); - group->auth_type = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_AUTH_TYPE)); - group->group_name_utf8 = g_strdup(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_NAME_UTF8)); - group->group_desc_utf8 = g_strdup(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_DESC_UTF8)); - group->my_status_desc = _qq_group_set_my_status_desc(group); - - qd->groups = g_list_append(qd->groups, group); - - return group; -} - -/* refresh group local subscription */ -void qq_group_refresh(GaimConnection *gc, qq_group *group) -{ - GaimChat *chat; - g_return_if_fail(gc != NULL && group != NULL); - - chat = gaim_blist_find_chat(gaim_connection_get_account(gc), g_strdup_printf("%d", group->external_group_id)); - if (chat == NULL && group->my_status != QQ_GROUP_MEMBER_STATUS_NOT_MEMBER) { - _qq_group_add_to_blist(gc, group); - } else if (chat != NULL) { /* we have a local record, update its info */ - /* if there is group_name_utf8, we update the group name */ - if (group->group_name_utf8 != NULL && strlen(group->group_name_utf8) > 0) - gaim_blist_alias_chat(chat, group->group_name_utf8); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_MEMBER_STATUS), g_strdup_printf("%d", group->my_status)); - group->my_status_desc = _qq_group_set_my_status_desc(group); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_MEMBER_STATUS_DESC), g_strdup(group->my_status_desc)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_INTERNAL_ID), - g_strdup_printf("%d", group->internal_group_id)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_EXTERNAL_ID), - g_strdup_printf("%d", group->external_group_id)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_GROUP_TYPE), g_strdup_printf("%d", group->group_type)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_CREATOR_UID), g_strdup_printf("%d", group->creator_uid)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_GROUP_CATEGORY), - g_strdup_printf("%d", group->group_category)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_AUTH_TYPE), g_strdup_printf("%d", group->auth_type)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_GROUP_NAME_UTF8), g_strdup(group->group_name_utf8)); - g_hash_table_replace(chat->components, - g_strdup(QQ_GROUP_KEY_GROUP_DESC_UTF8), g_strdup(group->group_desc_utf8)); - } -} Deleted: trunk/libgaim/protocols/qq/group_hash.h =================================================================== --- trunk/libgaim/protocols/qq/group_hash.h 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_hash.h 2006-09-01 11:03:18 UTC (rev 17112) @@ -1,46 +0,0 @@ -/** -* The QQ2003C protocol plugin - * - * for gaim - * - * Copyright (C) 2004 Puzzlebird - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef _QQ_GROUP_HASH_H_ -#define _QQ_GROUP_HASH_H_ - -#include <glib.h> -#include "group.h" - -#define QQ_GROUP_KEY_MEMBER_STATUS "my_status_code" -#define QQ_GROUP_KEY_MEMBER_STATUS_DESC "my_status_desc" -#define QQ_GROUP_KEY_INTERNAL_ID "internal_group_id" -#define QQ_GROUP_KEY_EXTERNAL_ID "external_group_id" -#define QQ_GROUP_KEY_GROUP_TYPE "group_type" -#define QQ_GROUP_KEY_CREATOR_UID "creator_uid" -#define QQ_GROUP_KEY_GROUP_CATEGORY "group_category" -#define QQ_GROUP_KEY_AUTH_TYPE "auth_type" -#define QQ_GROUP_KEY_GROUP_NAME_UTF8 "group_name_utf8" -#define QQ_GROUP_KEY_GROUP_DESC_UTF8 "group_desc_utf8" - -qq_group *qq_group_create_by_id(GaimConnection *gc, guint32 internal_id, guint32 external_id); -GHashTable *qq_group_to_hashtable(qq_group *group); - -qq_group *qq_group_from_hashtable(GaimConnection *gc, GHashTable *data); -void qq_group_refresh(GaimConnection *gc, qq_group *group); - -#endif Modified: trunk/libgaim/protocols/qq/group_im.c =================================================================== --- trunk/libgaim/protocols/qq/group_im.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_im.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -29,7 +29,7 @@ #include "char_conv.h" #include "group_find.h" -#include "group_hash.h" +#include "group_internal.h" #include "group_info.h" #include "group_im.h" #include "group_network.h" @@ -171,7 +171,7 @@ gaim_notify_warning(gc, _("QQ Qun Operation"), msg, reason); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group != NULL) { group->my_status = QQ_GROUP_MEMBER_STATUS_NOT_MEMBER; qq_group_refresh(gc, group); @@ -211,7 +211,7 @@ gaim_notify_warning(gc, _("QQ Qun Operation"), msg, NULL); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group != NULL) { group->my_status = QQ_GROUP_MEMBER_STATUS_IS_MEMBER; qq_group_refresh(gc, group); @@ -246,7 +246,7 @@ msg = g_strdup_printf(_("You [%d] has exit group \"%d\""), uid, external_group_id); gaim_notify_info(gc, _("QQ Qun Operation"), msg, NULL); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group != NULL) { group->my_status = QQ_GROUP_MEMBER_STATUS_NOT_MEMBER; qq_group_refresh(gc, group); @@ -278,14 +278,14 @@ g_return_if_fail(external_group_id > 0 && uid > 0); msg = g_strdup_printf(_("You [%d] has been added by group \"%d\""), uid, external_group_id); - gaim_notify_info(gc, _("QQ Qun Operation"), msg, _("OpenQ has added this group to your buddy list")); + gaim_notify_info(gc, _("QQ Qun Operation"), msg, _("This group has been added to your buddy list")); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group != NULL) { group->my_status = QQ_GROUP_MEMBER_STATUS_IS_MEMBER; qq_group_refresh(gc, group); } else { /* no such group, try to create a dummy first, and then update */ - group = qq_group_create_by_id(gc, internal_group_id, external_group_id); + group = qq_group_create_internal_record(gc, internal_group_id, external_group_id, NULL); group->my_status = QQ_GROUP_MEMBER_STATUS_IS_MEMBER; qq_group_refresh(gc, group); qq_send_cmd_group_get_group_info(gc, group); @@ -379,7 +379,7 @@ else msg_utf8_encoded = qq_to_utf8(msg_with_gaim_smiley, QQ_CHARSET_DEFAULT); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); g_return_if_fail(group != NULL); conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, group->group_name_utf8, gaim_connection_get_account(gc)); Modified: trunk/libgaim/protocols/qq/group_info.c =================================================================== --- trunk/libgaim/protocols/qq/group_info.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_info.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -26,7 +26,7 @@ #include "buddy_status.h" #include "char_conv.h" #include "group_find.h" -#include "group_hash.h" +#include "group_internal.h" #include "group_info.h" #include "buddy_status.h" #include "group_network.h" @@ -42,7 +42,7 @@ (time(NULL) - member->last_refresh) > QQ_GROUP_CHAT_REFRESH_NICKNAME_INTERNAL; } -/* this is done when we receive the reply to get_online_member sub_cmd +/* this is done when we receive the reply to get_online_members sub_cmd * all member are set offline, and then only those in reply packets are online */ static void _qq_group_set_members_all_offline(qq_group *group) { @@ -82,7 +82,7 @@ } /* send packet to get online group member, called by keep_alive */ -void qq_send_cmd_group_get_online_member(GaimConnection *gc, qq_group *group) +void qq_send_cmd_group_get_online_members(GaimConnection *gc, qq_group *group) { guint8 *raw_data, *cursor; gint bytes, data_len; @@ -111,8 +111,8 @@ qq_send_group_cmd(gc, group, raw_data, data_len); } -/* send packet to get group member info */ -void qq_send_cmd_group_get_member_info(GaimConnection *gc, qq_group *group) +/* send packet to get info for each group member */ +void qq_send_cmd_group_get_members_info(GaimConnection *gc, qq_group *group) { guint8 *raw_data, *cursor; gint bytes, data_len, i; @@ -160,9 +160,10 @@ qq_buddy *member; qq_data *qd; GaimConversation *gaim_conv; - guint8 orgnization, role; - guint16 unknown; - guint32 member_uid, internal_group_id; + guint8 organization, role; + guint16 unknown, max_members; + guint32 member_uid, internal_group_id, external_group_id; + GSList *pending_id; gint pascal_len, i; guint32 unknown4; guint8 unknown1; @@ -173,11 +174,18 @@ read_packet_dw(data, cursor, len, &(internal_group_id)); g_return_if_fail(internal_group_id > 0); + read_packet_dw(data, cursor, len, &(external_group_id)); + g_return_if_fail(internal_group_id > 0); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + pending_id = qq_get_pending_id(qd->adding_groups_from_server, internal_group_id); + if (pending_id != NULL) { + qq_set_pending_id(&qd->adding_groups_from_server, internal_group_id, FALSE); + qq_group_create_internal_record(gc, internal_group_id, external_group_id, NULL); + } + + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); g_return_if_fail(group != NULL); - read_packet_dw(data, cursor, len, &(group->external_group_id)); read_packet_b(data, cursor, len, &(group->group_type)); read_packet_dw(data, cursor, len, &unknown4); /* unknown 4 bytes */ read_packet_dw(data, cursor, len, &(group->creator_uid)); @@ -185,7 +193,7 @@ read_packet_dw(data, cursor, len, &unknown4); /* oldCategory */ read_packet_w(data, cursor, len, &unknown); read_packet_dw(data, cursor, len, &(group->group_category)); - read_packet_w(data, cursor, len, &(unknown)); /* 0x0000 */ + read_packet_w(data, cursor, len, &max_members); read_packet_b(data, cursor, len, &unknown1); read_packet_dw(data, cursor, len, &(unknown4)); /* versionID */ @@ -202,17 +210,18 @@ while (*cursor < data + len) { read_packet_dw(data, cursor, len, &member_uid); i++; - read_packet_b(data, cursor, len, &orgnization); + read_packet_b(data, cursor, len, &organization); read_packet_b(data, cursor, len, &role); - if(orgnization != 0 || role != 0) { - gaim_debug(GAIM_DEBUG_INFO, "QQ", "group member %d: orgnizatio=%d, role=%d\n", member_uid, orgnization, role); + if(organization != 0 || role != 0) { + gaim_debug(GAIM_DEBUG_INFO, "QQ", "group member %d: organization=%d, role=%d\n", member_uid, organization, role); } member = qq_group_find_or_add_member(gc, group, member_uid); - member->role = role; + if (member != NULL) + member->role = role; } if(*cursor > (data + len)) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "group_cmd_get_group_info: Dangerous error! maybe protocal changed, notify me!"); + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "group_cmd_get_group_info: Dangerous error! maybe protocol changed, notify me!"); } gaim_debug(GAIM_DEBUG_INFO, "QQ", "group \"%s\" has %d members\n", group->group_name_utf8, i); @@ -233,7 +242,7 @@ } } -void qq_process_group_cmd_get_online_member(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) +void qq_process_group_cmd_get_online_members(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) { guint32 internal_group_id, member_uid; guint8 unknown; @@ -254,7 +263,7 @@ bytes += read_packet_b(data, cursor, len, &unknown); /* 0x3c ?? */ g_return_if_fail(internal_group_id > 0); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group == NULL) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "We have no group info for internal id [%d]\n", internal_group_id); @@ -272,14 +281,14 @@ } if(*cursor > (data + len)) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "group_cmd_get_online_member: Dangerous error! maybe protocol changed, notify developers!"); + "group_cmd_get_online_members: Dangerous error! maybe protocol changed, notify developers!"); } gaim_debug(GAIM_DEBUG_INFO, "QQ", "Group \"%s\" has %d online members\n", group->group_name_utf8, i); } -/* process the reply to get_member_info packet */ -void qq_process_group_cmd_get_member_info(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) +/* process the reply to get_members_info packet */ +void qq_process_group_cmd_get_members_info(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc) { guint32 internal_group_id, member_uid; guint16 unknown; @@ -292,10 +301,13 @@ read_packet_dw(data, cursor, len, &internal_group_id); g_return_if_fail(internal_group_id > 0); - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); g_return_if_fail(group != NULL); i = 0; + /* TODO: Something is off. I get an entry with strange values + * (including a nick of "") buried in here. I need to find more + * groups to join before I can figure this out */ /* now starts the member info, as get buddy list reply */ while (*cursor < data + len) { read_packet_dw(data, cursor, len, &member_uid); @@ -317,7 +329,7 @@ } if(*cursor > (data + len)) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "group_cmd_get_member_info: Dangerous error! maybe protocol changed, notify developers!"); + "group_cmd_get_members_info: Dangerous error! maybe protocol changed, notify developers!"); } gaim_debug(GAIM_DEBUG_INFO, "QQ", "Group \"%s\" obtained %d member info\n", group->group_name_utf8, i); } Modified: trunk/libgaim/protocols/qq/group_info.h =================================================================== --- trunk/libgaim/protocols/qq/group_info.h 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_info.h 2006-09-01 11:03:18 UTC (rev 17112) @@ -28,10 +28,10 @@ #include "group.h" void qq_send_cmd_group_get_group_info(GaimConnection *gc, qq_group *group); -void qq_send_cmd_group_get_online_member(GaimConnection *gc, qq_group *group); -void qq_send_cmd_group_get_member_info(GaimConnection *gc, qq_group *group); +void qq_send_cmd_group_get_online_members(GaimConnection *gc, qq_group *group); +void qq_send_cmd_group_get_members_info(GaimConnection *gc, qq_group *group); void qq_process_group_cmd_get_group_info(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc); -void qq_process_group_cmd_get_online_member(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc); -void qq_process_group_cmd_get_member_info(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc); +void qq_process_group_cmd_get_online_members(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc); +void qq_process_group_cmd_get_members_info(guint8 *data, guint8 **cursor, gint len, GaimConnection *gc); #endif Added: trunk/libgaim/protocols/qq/group_internal.c =================================================================== --- trunk/libgaim/protocols/qq/group_internal.c (rev 0) +++ trunk/libgaim/protocols/qq/group_internal.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -0,0 +1,238 @@ +/** +* The QQ2003C protocol plugin + * + * for gaim + * + * Copyright (C) 2004 Puzzlebird + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "blist.h" +#include "debug.h" + +#include "buddy_opt.h" +#include "group_free.h" +#include "group_internal.h" +#include "group_misc.h" +#include "utils.h" + +static gchar *_qq_group_set_my_status_desc(qq_group *group) +{ + const char *status_desc; + g_return_val_if_fail(group != NULL, g_strdup("")); + + switch (group->my_status) { + case QQ_GROUP_MEMBER_STATUS_NOT_MEMBER: + status_desc = _("I am not member"); + break; + case QQ_GROUP_MEMBER_STATUS_IS_MEMBER: + status_desc = _("I am a member"); + break; + case QQ_GROUP_MEMBER_STATUS_APPLYING: + status_desc = _("I am applying to join"); + break; + case QQ_GROUP_MEMBER_STATUS_IS_ADMIN: + status_desc = _("I am the admin"); + break; + default: + status_desc = _("Unknown status"); + } + + return g_strdup(status_desc); +} + +static void _qq_group_add_to_blist(GaimConnection *gc, qq_group *group) +{ + GHashTable *components; + GaimGroup *g; + GaimChat *chat; + components = qq_group_to_hashtable(group); + chat = gaim_chat_new(gaim_connection_get_account(gc), group->group_name_utf8, components); + g = qq_get_gaim_group(GAIM_GROUP_QQ_QUN); + gaim_blist_add_chat(chat, g, NULL); + gaim_debug(GAIM_DEBUG_INFO, "QQ", "You have added group \"%s\" to blist locally\n", group->group_name_utf8); +} + +/* Create a dummy qq_group, which includes only internal_id, external_id, + * and potentially group_name_utf8, in case we need to call group_conv_show_window + * right after creation. All other attributes are set to empty. + * We need to send a get_group_info to the QQ server to update it right away */ +qq_group *qq_group_create_internal_record(GaimConnection *gc, + guint32 internal_id, guint32 external_id, gchar *group_name_utf8) +{ + qq_group *group; + qq_data *qd; + + g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, NULL); + g_return_val_if_fail(internal_id > 0, NULL); + qd = (qq_data *) gc->proto_data; + + group = g_new0(qq_group, 1); + group->my_status = QQ_GROUP_MEMBER_STATUS_NOT_MEMBER; + group->my_status_desc = _qq_group_set_my_status_desc(group); + group->internal_group_id = internal_id; + group->external_group_id = external_id; + group->group_type = 0x01; /* assume permanent Qun */ + group->creator_uid = 10000; /* assume by QQ admin */ + group->group_category = 0x01; + group->auth_type = 0x02; /* assume need auth */ + group->group_name_utf8 = g_strdup(group_name_utf8 == NULL ? "" : group_name_utf8); + group->group_desc_utf8 = g_strdup(""); + group->notice_utf8 = g_strdup(""); + group->members = NULL; + + qd->groups = g_list_append(qd->groups, group); + _qq_group_add_to_blist(gc, group); + + return group; +} + +void qq_group_delete_internal_record(qq_data *qd, guint32 internal_group_id) +{ + qq_group *group; + GList *list; + g_return_if_fail(qd != NULL); + + list = qd->groups; + while (list != NULL) { + group = (qq_group *) qd->groups->data; + if (internal_group_id == group->internal_group_id) { + qd->groups = g_list_remove(qd->groups, group); + qq_group_free(group); + break; + } else { + list = list->next; + } + } +} + +/* convert a qq_group to hash-table, which could be component of GaimChat */ +GHashTable *qq_group_to_hashtable(qq_group *group) +{ + GHashTable *components; + components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_MEMBER_STATUS), g_strdup_printf("%d", group->my_status)); + group->my_status_desc = _qq_group_set_my_status_desc(group); + + g_hash_table_insert(components, + g_strdup(QQ_GROUP_KEY_INTERNAL_ID), g_strdup_printf("%d", group->internal_group_id)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_EXTERNAL_ID), + g_strdup_printf("%d", group->external_group_id)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_GROUP_TYPE), g_strdup_printf("%d", group->group_type)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_CREATOR_UID), g_strdup_printf("%d", group->creator_uid)); + g_hash_table_insert(components, + g_strdup(QQ_GROUP_KEY_GROUP_CATEGORY), g_strdup_printf("%d", group->group_category)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_AUTH_TYPE), g_strdup_printf("%d", group->auth_type)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_MEMBER_STATUS_DESC), g_strdup(group->my_status_desc)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_GROUP_NAME_UTF8), g_strdup(group->group_name_utf8)); + g_hash_table_insert(components, g_strdup(QQ_GROUP_KEY_GROUP_DESC_UTF8), g_strdup(group->group_desc_utf8)); + return components; +} + +/* create a qq_group from hashtable */ +qq_group *qq_group_from_hashtable(GaimConnection *gc, GHashTable *data) +{ + qq_data *qd; + qq_group *group; + + g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, NULL); + g_return_val_if_fail(data != NULL, NULL); + qd = (qq_data *) gc->proto_data; + + group = g_new0(qq_group, 1); + group->my_status = + qq_string_to_dec_value + (NULL == + g_hash_table_lookup(data, + QQ_GROUP_KEY_MEMBER_STATUS) ? + g_strdup_printf("%d", + QQ_GROUP_MEMBER_STATUS_NOT_MEMBER) : + g_hash_table_lookup(data, QQ_GROUP_KEY_MEMBER_STATUS)); + group->internal_group_id = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_INTERNAL_ID)); + group->external_group_id = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_EXTERNAL_ID)); + group->group_type = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_TYPE)); + group->creator_uid = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_CREATOR_UID)); + group->group_category = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_CATEGORY)); + group->auth_type = qq_string_to_dec_value(g_hash_table_lookup(data, QQ_GROUP_KEY_AUTH_TYPE)); + group->group_name_utf8 = g_strdup(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_NAME_UTF8)); + group->group_desc_utf8 = g_strdup(g_hash_table_lookup(data, QQ_GROUP_KEY_GROUP_DESC_UTF8)); + group->my_status_desc = _qq_group_set_my_status_desc(group); + + qd->groups = g_list_append(qd->groups, group); + + return group; +} + +/* refresh group local subscription */ +void qq_group_refresh(GaimConnection *gc, qq_group *group) +{ + GaimChat *chat; + gchar *external_group_id; + g_return_if_fail(gc != NULL && group != NULL); + + external_group_id = g_strdup_printf("%d", group->external_group_id); + chat = gaim_blist_find_chat(gaim_connection_get_account(gc), external_group_id); + g_free(external_group_id); + if (chat == NULL && group->my_status != QQ_GROUP_MEMBER_STATUS_NOT_MEMBER) { + _qq_group_add_to_blist(gc, group); + } else if (chat != NULL) { /* we have a local record, update its info */ + /* if there is group_name_utf8, we update the group name */ + if (group->group_name_utf8 != NULL && strlen(group->group_name_utf8) > 0) + gaim_blist_alias_chat(chat, group->group_name_utf8); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_MEMBER_STATUS), g_strdup_printf("%d", group->my_status)); + group->my_status_desc = _qq_group_set_my_status_desc(group); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_MEMBER_STATUS_DESC), g_strdup(group->my_status_desc)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_INTERNAL_ID), + g_strdup_printf("%d", group->internal_group_id)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_EXTERNAL_ID), + g_strdup_printf("%d", group->external_group_id)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_GROUP_TYPE), g_strdup_printf("%d", group->group_type)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_CREATOR_UID), g_strdup_printf("%d", group->creator_uid)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_GROUP_CATEGORY), + g_strdup_printf("%d", group->group_category)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_AUTH_TYPE), g_strdup_printf("%d", group->auth_type)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_GROUP_NAME_UTF8), g_strdup(group->group_name_utf8)); + g_hash_table_replace(chat->components, + g_strdup(QQ_GROUP_KEY_GROUP_DESC_UTF8), g_strdup(group->group_desc_utf8)); + } +} + +/* NOTE: If we knew how to convert between an external and internal group id, as the official + * client seems to, the following would be unnecessary. That would be ideal. */ + +/* Use list to specify if id's alternate id is pending discovery. */ +void qq_set_pending_id(GSList **list, guint32 id, gboolean pending) +{ + if (pending) + *list = g_slist_prepend(*list, GINT_TO_POINTER(id)); + else + *list = g_slist_remove(*list, GINT_TO_POINTER(id)); +} + +/* Return the location of id in list, or NULL if not found */ +GSList *qq_get_pending_id(GSList *list, guint32 id) +{ + return g_slist_find(list, GINT_TO_POINTER(id)); +} Property changes on: trunk/libgaim/protocols/qq/group_internal.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/libgaim/protocols/qq/group_internal.h =================================================================== --- trunk/libgaim/protocols/qq/group_internal.h (rev 0) +++ trunk/libgaim/protocols/qq/group_internal.h 2006-09-01 11:03:18 UTC (rev 17112) @@ -0,0 +1,52 @@ +/** +* The QQ2003C protocol plugin + * + * for gaim + * + * Copyright (C) 2004 Puzzlebird + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _QQ_GROUP_HASH_H_ +#define _QQ_GROUP_HASH_H_ + +#include <glib.h> +#include "group.h" + +#define QQ_GROUP_KEY_MEMBER_STATUS "my_status_code" +#define QQ_GROUP_KEY_MEMBER_STATUS_DESC "my_status_desc" +#define QQ_GROUP_KEY_INTERNAL_ID "internal_group_id" +#define QQ_GROUP_KEY_EXTERNAL_ID "external_group_id" +#define QQ_GROUP_KEY_GROUP_TYPE "group_type" +#define QQ_GROUP_KEY_CREATOR_UID "creator_uid" +#define QQ_GROUP_KEY_GROUP_CATEGORY "group_category" +#define QQ_GROUP_KEY_AUTH_TYPE "auth_type" +#define QQ_GROUP_KEY_GROUP_NAME_UTF8 "group_name_utf8" +#define QQ_GROUP_KEY_GROUP_DESC_UTF8 "group_desc_utf8" + +qq_group *qq_group_create_internal_record(GaimConnection *gc, + guint32 internal_id, guint32 external_id, gchar *group_name_utf8); +void qq_group_delete_internal_record(qq_data *qd, guint32 internal_group_id); + +GHashTable *qq_group_to_hashtable(qq_group *group); +qq_group *qq_group_from_hashtable(GaimConnection *gc, GHashTable *data); + +void qq_group_refresh(GaimConnection *gc, qq_group *group); + +void qq_set_pending_id(GSList **list, guint32 id, gboolean pending); +GSList *qq_get_pending_id(GSList *list, guint32 id); + +#endif Property changes on: trunk/libgaim/protocols/qq/group_internal.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/libgaim/protocols/qq/group_join.c =================================================================== --- trunk/libgaim/protocols/qq/group_join.c 2006-09-01 10:05:30 UTC (rev 17111) +++ trunk/libgaim/protocols/qq/group_join.c 2006-09-01 11:03:18 UTC (rev 17112) @@ -30,11 +30,12 @@ #include "group_conv.h" #include "group_find.h" #include "group_free.h" -#include "group_hash.h" +#include "group_internal.h" #include "group_info.h" #include "group_join.h" #include "group_opt.h" #include "group_network.h" +#include "group_search.h" enum { QQ_GROUP_JOIN_OK = 0x01, @@ -51,24 +52,37 @@ gc = g->gc; internal_group_id = g->uid; - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); g_return_if_fail(group != NULL); qq_send_cmd_group_exit_group(gc, group); } /* send packet to join a group without auth */ -static void _qq_send_cmd_group_join_group(GaimConnection *gc, qq_group *group) +void qq_send_cmd_group_join_group(GaimConnection *gc, qq_group *group) { guint8 *raw_data, *cursor; gint bytes, data_len; g_return_if_fail(gc != NULL && group != NULL); + if (group->my_status == QQ_GROUP_MEMBER_STATUS_NOT_MEMBER) { group->my_status = QQ_GROUP_MEMBER_STATUS_APPLYING; qq_group_refresh(gc, group); } + switch (group->auth_type) { + case QQ_GROUP_AUTH_TYPE_NO_AUTH: + case QQ_GROUP_AUTH_TYPE_NEED_AUTH: + break; + case QQ_GROUP_AUTH_TYPE_NO_ADD: + gaim_notify_warning(gc, NULL, _("This group does not allow others to join"), NULL); + return; + default: + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Unknown group auth type: %d\n", group->auth_type); + break; + } + data_len = 5; raw_data = g_newa(guint8, data_len); cursor = raw_data; @@ -94,7 +108,7 @@ gc = g->gc; internal_group_id = g->uid; - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group == NULL) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Can not find qq_group by internal_id: %d\n", internal_group_id); return; @@ -163,15 +177,7 @@ qq_send_group_cmd(gc, group, raw_data, data_len); } -/* send packet to exit one group - * In fact, this will never be used for GAIM - * when we remove a GaimChat node, there is no user controlable callback - * so we only remove the GaimChat node, - * but we never use this cmd to update the server side - * anyway, it is function, as when we remove the GaimChat node, - * user has no way to start up the chat conversation window - * therefore even we are still in it, - * the group IM will not show up to bother us. (Limited by GAIM) */ +/* send a packet to exit a group */ void qq_send_cmd_group_exit_group(GaimConnection *gc, qq_group *group) { guint8 *raw_data, *cursor; @@ -212,16 +218,16 @@ bytes += read_packet_dw(data, cursor, len, &internal_group_id); if (bytes == expected_bytes) { - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); if (group != NULL) { chat = gaim_blist_find_chat (gaim_connection_get_account(gc), g_strdup_printf("%d", group->external_group_id)); if (chat != NULL) gaim_blist_remove_chat(chat); - qq_group_remove_by_internal_group_id(qd, internal_group_id); + qq_group_delete_internal_record(qd, internal_group_id); } - gaim_notify_info(gc, _("QQ Qun Operation"), _("You have successfully exit group"), NULL); + gaim_notify_info(gc, _("QQ Qun Operation"), _("You have successfully exited the group"), NULL); } else { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Invalid exit group reply, expect %d bytes, read %d bytes\n", expected_bytes, bytes); @@ -246,7 +252,8 @@ if (bytes == expected_bytes) gaim_notify_info - (gc, _("QQ Group Auth"), _("You authorization operation has been accepted by QQ server"), NULL); + (gc, _("QQ Group Auth"), + _("Your authorization operation has been accepted by the QQ server"), NULL); else gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Invalid join group reply, expect %d bytes, read %d bytes\n", expected_bytes, bytes); @@ -272,7 +279,7 @@ "Invalid join group reply, expect %d bytes, read %d bytes\n", expected_bytes, bytes); return; } else { /* join group OK */ - group = qq_group_find_by_internal_group_id(gc, internal_group_id); + group = qq_group_find_by_id(gc, internal_group_id, QQ_INTERNAL_ID); /* need to check if group is NULL or not. */ g_return_if_fail(group != NULL); switch (reply) { @@ -280,7 +287,7 @@ gaim_debug(GAIM_DEBUG_INFO, "QQ", "Succeed joining group \"%s\"\n", group->group_name_utf8); group->my_status = QQ_GROUP_MEMBER_STATUS_IS_MEMBER; qq_group_refresh(gc, group); - /* this must be show before getting online member */ + /* this must be shown before getting online members */ qq_group_conv_show_window(gc, group); qq_send_cmd_group_get_group_info(gc, group); break; @@ -300,38 +307,33 @@ } } -/* Apply to join one group without auth */ +/* Attempt to join a group without auth */ void qq_group_join(GaimConnection *gc, GHashTable *data) { - gchar *internal_group_id_ptr; - guint32 internal_group_id; + qq_data *qd; + gchar *external_group_id_ptr; + guint32 external_group_id; qq_group *group; - g_return_if_fail(gc != NULL && data != NULL); + g_return_if_fail(gc != NULL && gc->proto_data != NULL && data != NULL); + qd = (qq_data *) gc->proto_data; - internal_group_id_ptr = g_hash_table_lookup(data, "internal_group_id"); - internal_group_id = strtol(internal_group_id_ptr, NULL, 10); + external_group_id_ptr = g_hash_table_lookup(data, QQ_GROUP_KEY_EXTERNAL_ID); + g_return_if_fail(external_group_id_ptr != NULL); + errno = 0; + external_group_id = strtol(external_group_id_ptr, NULL, 10); + if (errno != 0) { + gaim_notify_error(gc, _("Error"), + _("You inputted a group id outside the acceptable range"), NULL); + return; + } - g_return_if_fail(internal_group_id > 0); - - /* for those we have subscribed, they should have been put into - * qd->groups in qq_group_init subroutine */ - group = qq_group_find_by_internal_group_id(gc, internal_group_id); - if (group == NULL) - group = qq_group_from_hashtable(gc, data); - - g_return_if_fail(group != NULL); - - switch (group->auth_type) { - case QQ_GROUP_AUTH_TYPE_NO_AUTH: - case QQ_GROUP_AUTH_TYPE_NEED_AUTH: - _qq_send_cmd_group_join_group(gc, group); - break; - case QQ_GROUP_AUTH_TYPE_NO_ADD: - gaim_notify_warning(gc, NULL, _("This group does not allow others to join"), NULL); - break; - default: - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Unknown group auth type: %d\n", group->auth_type); + group = qq_group_find_by_id(gc, external_group_id, QQ_EXTERNAL_ID); + if (group) { + qq_send_cmd_group_join_group(gc, group); + } else { + qq_set_pending_id(&qd->joining_groups, external_group_id, TRUE); + qq_send_cmd_group_search_group(gc, external_group_id); } } Modified: trunk/libgaim/protocols/qq/group_join.h =================================================================== --- trunk/libgaim/protocols/qq/group_join.h 2... [truncated message content] |
From: <the...@us...> - 2006-09-01 10:05:36
|
Revision: 17111 http://svn.sourceforge.net/gaim/?rev=17111&view=rev Author: thekingant Date: 2006-09-01 03:05:30 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Fix two crashes that evands noticed in the Adium crash reporter. Basically what was happening is that our url fetching code saw a redirect, and then it did a second request for the redirected page. But whoever called gaim_util_fetch_url() in the first place still had a reference to the (now freed) url fetch data. The solution is to reuse the url fetch data structure for the redirect request. The Adium crash reporter is ill, yo. Modified Paths: -------------- trunk/libgaim/util.c Modified: trunk/libgaim/util.c =================================================================== --- trunk/libgaim/util.c 2006-09-01 08:52:23 UTC (rev 17110) +++ trunk/libgaim/util.c 2006-09-01 10:05:30 UTC (rev 17111) @@ -3078,7 +3078,8 @@ gaim_util_fetch_url_cancel(gfud); } -/* TODO: This totally destroys cancelability. */ +static void url_fetch_connect_cb(gpointer url_data, gint source, const gchar *error_message); + static gboolean parse_redirect(const char *data, size_t data_len, gint sock, GaimUtilFetchUrlData *gfud) @@ -3123,15 +3124,34 @@ gaim_debug_info("util", "Redirecting to %s\n", new_url); - /* Try again, with this new location. */ - gaim_util_fetch_url_request(new_url, full, gfud->user_agent, - gfud->http11, NULL, gfud->include_headers, - gfud->callback, gfud->user_data); + /* + * Try again, with this new location. This code is somewhat + * ugly, but we need to reuse the gfud because whoever called + * us is holding a reference to it. + */ + g_free(gfud->url); + gfud->url = new_url; + gfud->full = full; + g_free(gfud->request); + gfud->request = NULL; - /* Free the old connection */ - g_free(new_url); - gaim_util_fetch_url_cancel(gfud); + g_free(gfud->website.user); + g_free(gfud->website.passwd); + g_free(gfud->website.address); + g_free(gfud->website.page); + gaim_url_parse(new_url, &gfud->website.address, &gfud->website.port, + &gfud->website.page, &gfud->website.user, &gfud->website.passwd); + gfud->connect_data = gaim_proxy_connect(NULL, + gfud->website.address, gfud->website.port, + url_fetch_connect_cb, gfud); + + if (gfud->connect_data == NULL) + { + gaim_util_fetch_url_error(gfud, _("Unable to connect to %s"), + gfud->website.address); + } + return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-01 08:53:56
|
Revision: 17110 http://svn.sourceforge.net/gaim/?rev=17110&view=rev Author: thekingant Date: 2006-09-01 01:52:23 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Make peer disconnection error messages a little better for oscar ft and direct connect Modified Paths: -------------- trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/odc.c trunk/libgaim/protocols/oscar/oft.c trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/oscar/oscar_data.c trunk/libgaim/protocols/oscar/peer.c trunk/libgaim/protocols/oscar/peer.h Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-09-01 08:52:23 UTC (rev 17110) @@ -316,6 +316,7 @@ gaim_debug_info("oscar", "Scheduling destruction of FLAP " "connection of type 0x%04hx\n", conn->type); conn->disconnect_reason = reason; + g_free(conn->error_message); conn->error_message = g_strdup(error_message); conn->destroy_timeout = gaim_timeout_add(0, flap_connection_destroy_cb, conn); } Modified: trunk/libgaim/protocols/oscar/odc.c =================================================================== --- trunk/libgaim/protocols/oscar/odc.c 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/odc.c 2006-09-01 08:52:23 UTC (rev 17110) @@ -34,18 +34,19 @@ void peer_odc_close(PeerConnection *conn) { - const gchar *tmp; + gchar *tmp; if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_CLOSED) - tmp = _("The remote user has closed the connection."); + tmp = g_strdup(_("The remote user has closed the connection.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_REFUSED) - tmp = _("The remote user has declined your request."); + tmp = g_strdup(_("The remote user has declined your request.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_LOST_CONNECTION) - tmp = _("Lost connection with the remote user for an unknown reason."); + tmp = g_strdup_printf(_("Lost connection with the remote user:<br>%s"), + conn->error_message); else if (conn->disconnect_reason == OSCAR_DISCONNECT_INVALID_DATA) - tmp = _("Received invalid data on connection with remote user."); + tmp = g_strdup(_("Received invalid data on connection with remote user.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_COULD_NOT_CONNECT) - tmp = _("Could not establish a connection with the remote user."); + tmp = g_strdup(_("Could not establish a connection with the remote user.")); else /* * We shouldn't print a message for some disconnect_reasons. @@ -61,6 +62,7 @@ account = gaim_connection_get_account(conn->od->gc); 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); } if (conn->frame != NULL) @@ -442,7 +444,7 @@ /* Check if the remote user closed the connection */ if (read == 0) { - peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); return; } @@ -452,7 +454,8 @@ /* No worries */ return; - peer_connection_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION); + peer_connection_destroy(conn, + OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); return; } @@ -526,7 +529,8 @@ */ gaim_debug_info("oscar", "Received an incorrect cookie. " "Closing connection.\n"); - peer_connection_destroy(conn, OSCAR_DISCONNECT_INVALID_DATA); + peer_connection_destroy(conn, + OSCAR_DISCONNECT_INVALID_DATA, NULL); g_free(frame); return; } Modified: trunk/libgaim/protocols/oscar/oft.c =================================================================== --- trunk/libgaim/protocols/oscar/oft.c 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/oft.c 2006-09-01 08:52:23 UTC (rev 17110) @@ -269,7 +269,7 @@ if (gaim_circ_buffer_get_max_read(conn->buffer_outgoing) == 0) { conn->sending_data_timer = 0; - peer_connection_destroy(conn, conn->disconnect_reason); + peer_connection_destroy(conn, conn->disconnect_reason, NULL); return FALSE; } @@ -307,7 +307,7 @@ { gaim_debug_info("oscar", "Received an incorrect cookie. " "Closing connection.\n"); - peer_connection_destroy(conn, OSCAR_DISCONNECT_INVALID_DATA); + peer_connection_destroy(conn, OSCAR_DISCONNECT_INVALID_DATA, NULL); return; } @@ -521,7 +521,7 @@ if (conn == NULL) return; - peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); } /*******************************************************************/ Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-09-01 08:52:23 UTC (rev 17110) @@ -2044,7 +2044,7 @@ */ if (conn != NULL) { - peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); } } else if (args->status == AIM_RENDEZVOUS_CONNECTED) @@ -2275,6 +2275,7 @@ msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *)); for (i=0; msg1[i]; i++) { gaim_str_strip_char(msg1[i], '\r'); + /* TODO: Should use an encoding other than ASCII? */ msg2[i] = gaim_plugin_oscar_decode_im_part(account, "1", AIM_CHARSET_ASCII, 0x0000, msg1[i], strlen(msg1[i])); } msg2[i] = NULL; @@ -2583,7 +2584,7 @@ } else { - peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_REFUSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_REFUSED, NULL); } } else @@ -6349,7 +6350,7 @@ if (!conn->ready) aim_im_sendch2_cancel(conn); - peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); } } Modified: trunk/libgaim/protocols/oscar/oscar_data.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar_data.c 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/oscar_data.c 2006-09-01 08:52:23 UTC (rev 17110) @@ -113,7 +113,7 @@ while (od->peer_connections != NULL) peer_connection_destroy(od->peer_connections->data, - OSCAR_DISCONNECT_LOCAL_CLOSED); + OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); if (od->handlerlist != NULL) aim_clearhandlers(od); Modified: trunk/libgaim/protocols/oscar/peer.c =================================================================== --- trunk/libgaim/protocols/oscar/peer.c 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/peer.c 2006-09-01 08:52:23 UTC (rev 17110) @@ -219,6 +219,8 @@ conn->xfer = NULL; } + g_free(conn->sn); + g_free(conn->error_message); g_free(conn->proxyip); g_free(conn->clientip); g_free(conn->verifiedip); @@ -232,16 +234,18 @@ } void -peer_connection_destroy(PeerConnection *conn, OscarDisconnectReason reason) +peer_connection_destroy(PeerConnection *conn, OscarDisconnectReason reason, const gchar *error_message) { - conn->disconnect_reason = reason; if (conn->destroy_timeout != 0) gaim_timeout_remove(conn->destroy_timeout); + conn->disconnect_reason = reason; + g_free(conn->error_message); + conn->error_message = g_strdup(error_message); peer_connection_destroy_cb(conn); } void -peer_connection_schedule_destroy(PeerConnection *conn, OscarDisconnectReason reason) +peer_connection_schedule_destroy(PeerConnection *conn, OscarDisconnectReason reason, const gchar *error_message) { if (conn->destroy_timeout != 0) /* Already taken care of */ @@ -249,6 +253,8 @@ gaim_debug_info("oscar", "Scheduling destruction of peer connection\n"); conn->disconnect_reason = reason; + g_free(conn->error_message); + conn->error_message = g_strdup(error_message); conn->destroy_timeout = gaim_timeout_add(0, peer_connection_destroy_cb, conn); } @@ -289,7 +295,7 @@ /* Check if the remote user closed the connection */ if (read == 0) { - peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); return; } @@ -300,7 +306,8 @@ /* No worries */ return; - peer_connection_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION); + peer_connection_destroy(conn, + OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); return; } @@ -321,7 +328,7 @@ "Closing connection.\n", conn->magic[0], conn->magic[1], conn->magic[2], conn->magic[3], header[0], header[1], header[2], header[3]); - peer_connection_destroy(conn, OSCAR_DISCONNECT_INVALID_DATA); + peer_connection_destroy(conn, OSCAR_DISCONNECT_INVALID_DATA, NULL); return; } @@ -340,7 +347,7 @@ /* Check if the remote user closed the connection */ if (read == 0) { - peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); return; } @@ -350,7 +357,8 @@ /* No worries */ return; - peer_connection_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION); + peer_connection_destroy(conn, + OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); return; } @@ -407,7 +415,8 @@ return; if (conn->ready) - peer_connection_schedule_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION); + peer_connection_schedule_destroy(conn, + OSCAR_DISCONNECT_LOST_CONNECTION, NULL); else { /* @@ -810,7 +819,7 @@ } /* Give up! */ - peer_connection_destroy(conn, OSCAR_DISCONNECT_COULD_NOT_CONNECT); + peer_connection_destroy(conn, OSCAR_DISCONNECT_COULD_NOT_CONNECT, NULL); } /** @@ -842,7 +851,7 @@ } /* Cancel the old connection and try again */ - peer_connection_destroy(conn, OSCAR_DISCONNECT_RETRYING); + peer_connection_destroy(conn, OSCAR_DISCONNECT_RETRYING, NULL); } } @@ -885,7 +894,7 @@ aim_im_denytransfer(conn->od, conn->sn, conn->cookie, AIM_TRANSFER_DENY_DECLINE); - peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); } /** @@ -938,7 +947,7 @@ /* Close the old direct IM and start a new one */ gaim_debug_info("oscar", "Received new direct IM request " "from %s. Destroying old connection.\n", sn); - peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED); + peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); } } Modified: trunk/libgaim/protocols/oscar/peer.h =================================================================== --- trunk/libgaim/protocols/oscar/peer.h 2006-09-01 08:19:31 UTC (rev 17109) +++ trunk/libgaim/protocols/oscar/peer.h 2006-09-01 08:52:23 UTC (rev 17110) @@ -147,6 +147,7 @@ time_t lastactivity; /**< Time of last transmit. */ guint destroy_timeout; OscarDisconnectReason disconnect_reason; + char *error_message; /** * A pointer to either an OdcFrame or an OftFrame. @@ -221,8 +222,8 @@ */ PeerConnection *peer_connection_new(OscarData *od, OscarCapability type, const char *sn); -void peer_connection_destroy(PeerConnection *conn, OscarDisconnectReason reason); -void peer_connection_schedule_destroy(PeerConnection *conn, OscarDisconnectReason reason); +void peer_connection_destroy(PeerConnection *conn, OscarDisconnectReason reason, const gchar *error_message); +void peer_connection_schedule_destroy(PeerConnection *conn, OscarDisconnectReason reason, const gchar *error_message); PeerConnection *peer_connection_find_by_type(OscarData *od, const char *sn, OscarCapability type); PeerConnection *peer_connection_find_by_cookie(OscarData *od, const char *sn, const guchar *cookie); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-09-01 08:19:38
|
Revision: 17109 http://svn.sourceforge.net/gaim/?rev=17109&view=rev Author: deryni9 Date: 2006-09-01 01:19:31 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Remove some stuff from the core perl typemap that is only defined in the gtk files, and some gtk types themselves. Some of this will get added back in the gtk perl typemap when I commit it later. Modified Paths: -------------- trunk/libgaim/plugins/perl/common/typemap Modified: trunk/libgaim/plugins/perl/common/typemap =================================================================== --- trunk/libgaim/plugins/perl/common/typemap 2006-09-01 07:13:08 UTC (rev 17108) +++ trunk/libgaim/plugins/perl/common/typemap 2006-09-01 08:19:31 UTC (rev 17109) @@ -24,7 +24,6 @@ int * T_PTR long * T_PTR size_t * T_PTR -Gaim::GTK::Widget * T_PTR GCallback T_PTR va_list T_PTR GString * T_PTR @@ -73,14 +72,6 @@ Gaim::Desktop::Item T_GaimObj Gaim::DesktopItemType T_IV -Gaim::GTK::BuddyList T_GaimObj -Gaim::GDK::Pixbuf T_GaimObj -Gaim::GTK::Conversation T_GaimObj -Gaim::GTK::Widget T_GaimObj -Gaim::GTK::FileSelection T_GaimObj -Gaim::GTK::SelectionData T_GaimObj -Gaim::GTK::TextView T_GaimObj - Gaim::IconScaleRules T_IV Gaim::Log T_GaimObj @@ -191,11 +182,6 @@ Gaim::ConnectionFlags T_IV Gaim::ConnectionState T_IV -/* gtkutils.h */ -Gaim::ButtonOrientation T_IV -Gaim::ButtonStyle T_IV -Gaim::BrowserPlace T_IV - INPUT T_GaimObj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 07:13:38
|
Revision: 17108 http://svn.sourceforge.net/gaim/?rev=17108&view=rev Author: sadrul Date: 2006-09-01 00:13:08 -0700 (Fri, 01 Sep 2006) Log Message: ----------- It's a better idea to not set urgent-hints by default, especially because it's borked. Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-09-01 07:09:40 UTC (rev 17107) +++ trunk/console/plugins/gntgf.c 2006-09-01 07:13:08 UTC (rev 17108) @@ -383,7 +383,7 @@ gaim_prefs_add_bool(PREFS_BEEP, TRUE); #ifdef HAVE_X11 - gaim_prefs_add_bool(PREFS_URGENT, TRUE); + gaim_prefs_add_bool(PREFS_URGENT, FALSE); #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 07:10:06
|
Revision: 17107 http://svn.sourceforge.net/gaim/?rev=17107&view=rev Author: sadrul Date: 2006-09-01 00:09:40 -0700 (Fri, 01 Sep 2006) Log Message: ----------- Add an option to 'Show offline buddies'. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntprefs.c trunk/console/libgnt/gnttextview.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-09-01 06:38:46 UTC (rev 17106) +++ trunk/console/gntblist.c 2006-09-01 07:09:40 UTC (rev 17107) @@ -109,11 +109,15 @@ gnt_tree_remove(GNT_TREE(ggblist->tree), node); node->ui_data = NULL; - if (GAIM_BLIST_NODE_IS_BUDDY(node)) - { + if (GAIM_BLIST_NODE_IS_BUDDY(node)) { GaimContact *contact = (GaimContact*)node->parent; if (contact->online < 1) node_remove(list, (GaimBlistNode*)contact); + } else if (GAIM_BLIST_NODE_IS_CONTACT(node)) { + GaimGroup *group = (GaimGroup*)node->parent; + if ((!gaim_prefs_get_bool(PREF_ROOT "/showoffline") && group->online < 1) || + group->currentsize < 1) + node_remove(list, node->parent); } draw_tooltip(ggblist); } @@ -136,7 +140,8 @@ if (GAIM_BLIST_NODE_IS_BUDDY(node)) { GaimBuddy *buddy = (GaimBuddy*)node; - if (gaim_presence_is_online(gaim_buddy_get_presence(buddy))) + if (gaim_account_is_connected(buddy->account) && + (GAIM_BUDDY_IS_ONLINE(buddy) || gaim_prefs_get_bool(PREF_ROOT "/showoffline"))) add_node((GaimBlistNode*)buddy, list->ui_data); else node_remove(gaim_get_blist(), node); @@ -343,7 +348,6 @@ GaimBlistNode *node = (GaimBlistNode *)group; if (node->ui_data) return; - gnt_tree_remove(GNT_TREE(ggblist->tree), group); node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), group, gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), NULL, NULL); } @@ -416,7 +420,6 @@ group = gaim_chat_get_group(chat); add_node((GaimBlistNode*)group, ggblist); - gnt_tree_remove(GNT_TREE(ggblist->tree), chat); node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), chat, gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), group, NULL); @@ -430,15 +433,20 @@ { GaimGroup *group; GaimBlistNode *node = (GaimBlistNode*)contact; + const char *name; if (node->ui_data) return; + name = get_display_name(node); + if (name == NULL) + return; + group = (GaimGroup*)node->parent; add_node((GaimBlistNode*)group, ggblist); node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), contact, - gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), + gnt_tree_create_row(GNT_TREE(ggblist->tree), name), group, NULL); gnt_tree_set_expanded(GNT_TREE(ggblist->tree), contact, FALSE); @@ -455,7 +463,6 @@ contact = (GaimContact*)node->parent; add_node((GaimBlistNode*)contact, ggblist); - gnt_tree_remove(GNT_TREE(ggblist->tree), buddy); node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), buddy, gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), contact, NULL); @@ -1195,8 +1202,7 @@ gaim_get_blist()->ui_data = NULL; node = gaim_blist_get_root(); - while (node) - { + while (node) { node->ui_data = NULL; node = gaim_blist_node_next(node, TRUE); } @@ -1284,6 +1290,20 @@ items, (GDestroyNotify)destroy_status_list); } +static void +redraw_blist(const char *name, GaimPrefType type, gconstpointer val, gpointer data) +{ + GaimBlistNode *node; + if (ggblist == NULL) + return; + + gnt_tree_remove_all(GNT_TREE(ggblist->tree)); + node = gaim_blist_get_root(); + for (; node; node = gaim_blist_node_next(node, TRUE)) + node->ui_data = NULL; + populate_buddylist(); +} + void gg_blist_init() { gaim_prefs_add_none(PREF_ROOT); @@ -1293,9 +1313,14 @@ gaim_prefs_add_none(PREF_ROOT "/position"); gaim_prefs_add_int(PREF_ROOT "/position/x", 0); gaim_prefs_add_int(PREF_ROOT "/position/y", 0); + gaim_prefs_add_bool(PREF_ROOT "/idletime", TRUE); + gaim_prefs_add_bool(PREF_ROOT "/showoffline", FALSE); gg_blist_show(); + gaim_prefs_connect_callback(gg_blist_get_handle(), + PREF_ROOT "/showoffline", redraw_blist, NULL); + return; } Modified: trunk/console/gntprefs.c =================================================================== --- trunk/console/gntprefs.c 2006-09-01 06:38:46 UTC (rev 17106) +++ trunk/console/gntprefs.c 2006-09-01 07:09:40 UTC (rev 17107) @@ -14,9 +14,6 @@ gaim_prefs_add_none("/gaim/gnt/plugins"); gaim_prefs_add_string_list("/gaim/gnt/plugins/loaded", NULL); - gaim_prefs_add_none("/gaim/gnt/blist"); - gaim_prefs_add_bool("/gaim/gnt/blist/idletime", TRUE); - gaim_prefs_add_none("/gaim/gnt/conversations"); gaim_prefs_add_bool("/gaim/gnt/conversations/timestamps", TRUE); gaim_prefs_add_bool("/gaim/gnt/conversations/notify_typing", FALSE); /* XXX: Not functional yet */ @@ -99,6 +96,7 @@ static Prefs blist[] = { {GAIM_PREF_BOOLEAN, "/gaim/gnt/blist/idletime", N_("Show Idle Time"), NULL}, + {GAIM_PREF_BOOLEAN, "/gaim/gnt/blist/showoffline", N_("Show Offline Buddies"), NULL}, {GAIM_PREF_NONE, NULL, NULL, NULL} }; Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-09-01 06:38:46 UTC (rev 17106) +++ trunk/console/libgnt/gnttextview.c 2006-09-01 07:09:40 UTC (rev 17107) @@ -100,7 +100,7 @@ { if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_MAPPED)) { - gnt_widget_set_size(widget, 64, 24); + gnt_widget_set_size(widget, 64, 20); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 06:39:16
|
Revision: 17106 http://svn.sourceforge.net/gaim/?rev=17106&view=rev Author: sadrul Date: 2006-08-31 23:38:46 -0700 (Thu, 31 Aug 2006) Log Message: ----------- wabz keeps finding bugs i left in the codes. Modified Paths: -------------- trunk/console/libgnt/gnttextview.c Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-09-01 02:44:46 UTC (rev 17105) +++ trunk/console/libgnt/gnttextview.c 2006-09-01 06:38:46 UTC (rev 17106) @@ -1,6 +1,8 @@ #include "gnttextview.h" #include "gntutils.h" +#include <string.h> + enum { SIGS = 1, @@ -320,14 +322,15 @@ end++; start = end; gnt_text_view_next_line(view); + view->list = g_list_first(view->list); continue; } line = view->list->data; if ((end = strchr(start, '\n')) != NULL || (end = strchr(start, '\r')) != NULL) { - int l = gnt_util_onscreen_width(start, end - 1); - if (l >= widget->priv.width - line->length - 1) { + len = gnt_util_onscreen_width(start, end - 1); + if (len >= widget->priv.width - line->length - 1) { end = NULL; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 02:45:54
|
Revision: 17105 http://svn.sourceforge.net/gaim/?rev=17105&view=rev Author: sadrul Date: 2006-08-31 19:44:46 -0700 (Thu, 31 Aug 2006) Log Message: ----------- fix the bug in textview Modified Paths: -------------- trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gntutils.h trunk/console/libgnt/test/tv.c Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-09-01 02:07:23 UTC (rev 17104) +++ trunk/console/libgnt/gnttextview.c 2006-09-01 02:44:46 UTC (rev 17105) @@ -324,9 +324,18 @@ } line = view->list->data; - end = gnt_util_onscreen_width_to_pointer(start, - widget->priv.width - line->length - 1, &len); + if ((end = strchr(start, '\n')) != NULL || + (end = strchr(start, '\r')) != NULL) { + int l = gnt_util_onscreen_width(start, end - 1); + if (l >= widget->priv.width - line->length - 1) { + end = NULL; + } + } + if (end == NULL) + end = gnt_util_onscreen_width_to_pointer(start, + widget->priv.width - line->length - 1, &len); + seg = g_new0(GntTextSegment, 1); seg->start = start - view->string->str; seg->end = end - view->string->str; Modified: trunk/console/libgnt/gntutils.h =================================================================== --- trunk/console/libgnt/gntutils.h 2006-09-01 02:07:23 UTC (rev 17104) +++ trunk/console/libgnt/gntutils.h 2006-09-01 02:44:46 UTC (rev 17105) @@ -5,6 +5,7 @@ void gnt_util_get_text_bound(const char *text, int *width, int *height); +/* excluding *end */ int gnt_util_onscreen_width(const char *start, const char *end); char *gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w); Modified: trunk/console/libgnt/test/tv.c =================================================================== --- trunk/console/libgnt/test/tv.c 2006-09-01 02:07:23 UTC (rev 17104) +++ trunk/console/libgnt/test/tv.c 2006-09-01 02:44:46 UTC (rev 17105) @@ -83,6 +83,18 @@ gnt_entry_set_history_length(GNT_ENTRY(entry), -1); g_signal_connect_after(G_OBJECT(entry), "key_pressed", G_CALLBACK(key_pressed), view); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 1st line\n", GNT_TEXT_FLAG_NORMAL); + + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 2nd line\n", GNT_TEXT_FLAG_NORMAL); + + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 3rd line\n", GNT_TEXT_FLAG_NORMAL); + + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "plugins: ", GNT_TEXT_FLAG_BOLD); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), "this is the 4th line\n", GNT_TEXT_FLAG_NORMAL); + #ifdef STANDALONE gnt_main(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-09-01 02:09:30
|
Revision: 17104 http://svn.sourceforge.net/gaim/?rev=17104&view=rev Author: sadrul Date: 2006-08-31 19:07:23 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Add option in gntgf to set the URGENT hint for the terminal's window (in X). Unescape the status-string in the statusbox. Modified Paths: -------------- trunk/configure.ac trunk/console/gntblist.c trunk/console/libgnt/gntbox.c trunk/console/plugins/Makefile.am trunk/console/plugins/gntgf.c trunk/doc/gntgaim.1.in Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-31 22:04:16 UTC (rev 17103) +++ trunk/configure.ac 2006-09-01 02:07:23 UTC (rev 17104) @@ -680,6 +680,11 @@ x_incpath_add="-I$x_includes" fi +PKG_CHECK_MODULES(X11, x11, + [AC_DEFINE(HAVE_X11, 1, [Define to 1 if you have X11])], [AC_MSG_RESULT(no)]) +AC_SUBST(X11_LIBS) +AC_SUBST(X11_CFLAGS) + dnl ####################################################################### dnl # Check for DBUS libraries dnl ####################################################################### @@ -823,21 +828,6 @@ if test "x$enable_gtk" = "xyes"; then -AC_PATH_XTRA -# We can't assume that $x_libraries will be set, because autoconf does not -# set it in the case when the X libraries are in a standard place. -# Ditto for $x_includes -if test X"$x_libraries" = X"" || test X"$x_libraries" = XNONE; then - x_libpath_add= -else - x_libpath_add="-L$x_libraries" -fi -if test X"$x_includes" = X"" || test X"$x_includes" = XNONE; then - x_incpath_add= -else - x_incpath_add="-I$x_includes" -fi - dnl ####################################################################### dnl # Check for startup notification dnl ####################################################################### Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-31 22:04:16 UTC (rev 17103) +++ trunk/console/gntblist.c 2006-09-01 02:07:23 UTC (rev 17104) @@ -127,7 +127,7 @@ g_return_if_fail(node != NULL); if (list->ui_data == NULL) - return; + return; /* XXX: this is probably the place to auto-join chats */ if (node->ui_data != NULL) { gnt_tree_change_text(GNT_TREE(ggblist->tree), node, @@ -1417,9 +1417,11 @@ StatusBoxItem *item = list->data; if (item->type == STATUS_PRIMITIVE && item->u.prim == prim) { + char *mess = gaim_unescape_html(message); gnt_combo_box_set_selected(GNT_COMBO_BOX(ggblist->status), item); - gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), message); + gnt_entry_set_text(GNT_ENTRY(ggblist->statustext), mess); gnt_widget_draw(ggblist->status); + g_free(mess); break; } } Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-08-31 22:04:16 UTC (rev 17103) +++ trunk/console/libgnt/gntbox.c 2006-09-01 02:07:23 UTC (rev 17104) @@ -67,7 +67,6 @@ int pos, right; char *title = g_strdup(box->title); - mvwhline(widget->window, 0, 1, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), widget->priv.width - 2); get_title_thingies(box, title, &pos, &right); if (gnt_widget_has_focus(widget)) Modified: trunk/console/plugins/Makefile.am =================================================================== --- trunk/console/plugins/Makefile.am 2006-08-31 22:04:16 UTC (rev 17103) +++ trunk/console/plugins/Makefile.am 2006-09-01 02:07:23 UTC (rev 17104) @@ -1,4 +1,4 @@ -gntgf_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) +gntgf_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) $(X11_LIBS) gnthistory_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) if PLUGINS Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-31 22:04:16 UTC (rev 17103) +++ trunk/console/plugins/gntgf.c 2006-09-01 02:07:23 UTC (rev 17104) @@ -33,6 +33,13 @@ #define MAX_COLS 3 +#ifdef HAVE_X11 +#define PREFS_URGENT PREFS_PREFIX "/urgent" + +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#endif + #include <glib.h> #include <plugin.h> @@ -103,7 +110,36 @@ return FALSE; } +#ifdef HAVE_X11 static void +urgent() +{ + /* This is from deryni/tuomov's urgent_test.c */ + Display *dpy; + Window id; + const char *ids; + XWMHints *hints; + + ids = getenv("WINDOWID"); + if (ids == NULL) + return; + + id = atoi(ids); + + dpy = XOpenDisplay(NULL); + if (dpy == NULL) + return; + + hints = XGetWMHints(dpy, id); + hints->flags|=XUrgencyHint; + XSetWMHints(dpy, id, hints); + + XFlush(dpy); + XCloseDisplay(dpy); +} +#endif + +static void notify(const char *fmt, ...) { GntWidget *window; @@ -114,6 +150,10 @@ if (gaim_prefs_get_bool(PREFS_BEEP)) beep(); +#ifdef HAVE_X11 + if (gaim_prefs_get_bool(PREFS_URGENT)) + urgent(); +#endif window = gnt_vbox_new(FALSE); GNT_WIDGET_SET_FLAGS(window, GNT_WIDGET_TRANSIENT); @@ -254,9 +294,9 @@ } static void -beep_toggled(GntCheckBox *check, gpointer null) +toggle_option(GntCheckBox *check, gpointer str) { - gaim_prefs_set_bool(PREFS_BEEP, gnt_check_box_get_checked(check)); + gaim_prefs_set_bool(str, gnt_check_box_get_checked(check)); } static GntWidget * @@ -288,9 +328,16 @@ check = gnt_check_box_new(_("Beep too!")); gnt_check_box_set_checked(GNT_CHECK_BOX(check), gaim_prefs_get_bool(PREFS_BEEP)); - g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(beep_toggled), NULL); + g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggle_option), PREFS_BEEP); gnt_box_add_widget(GNT_BOX(window), check); +#ifdef HAVE_X11 + check = gnt_check_box_new(_("Set URGENT for the terminal window.")); + gnt_check_box_set_checked(GNT_CHECK_BOX(check), gaim_prefs_get_bool(PREFS_URGENT)); + g_signal_connect(G_OBJECT(check), "toggled", G_CALLBACK(toggle_option), PREFS_URGENT); + gnt_box_add_widget(GNT_BOX(window), check); +#endif + return window; } @@ -335,6 +382,9 @@ gaim_prefs_add_bool(PREFS_EVENT_CHAT_NICK, TRUE); gaim_prefs_add_bool(PREFS_BEEP, TRUE); +#ifdef HAVE_X11 + gaim_prefs_add_bool(PREFS_URGENT, TRUE); +#endif } GAIM_INIT_PLUGIN(PLUGIN_STATIC_NAME, init_plugin, info) Modified: trunk/doc/gntgaim.1.in =================================================================== --- trunk/doc/gntgaim.1.in 2006-08-31 22:04:16 UTC (rev 17103) +++ trunk/doc/gntgaim.1.in 2006-09-01 02:07:23 UTC (rev 17104) @@ -96,6 +96,9 @@ .TP .B Alt \+ l Refresh the windows. This is useful after resizing the terminal window. +.TP +.B Alt \+ 1 2 ... 0 +Jump to the 1st, 2nd ... 10th window. .SH FILES \fI~/.gntrc\fR: configuration file for gnt applications. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-08-31 22:04:24
|
Revision: 17103 http://svn.sourceforge.net/gaim/?rev=17103&view=rev Author: deryni9 Date: 2006-08-31 15:04:16 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Remove the gtk+ checks from around the tests for perl, and throw an extra eval on the dbus services line so that $prefix gets expanded correctly. Modified Paths: -------------- trunk/configure.ac Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-31 21:52:06 UTC (rev 17102) +++ trunk/configure.ac 2006-08-31 22:04:16 UTC (rev 17103) @@ -1030,7 +1030,6 @@ AC_SUBST(MONO_LIBS) AM_CONDITIONAL(USE_MONO, test x"$enable_mono" = x"yes") -if test "x$enable_gtk" = "xyes"; then # This is for now, since perl still requires GTK+ dnl ####################################################################### dnl # Check for Perl support dnl ####################################################################### @@ -1038,10 +1037,6 @@ enable_perl=no fi -else # GTK - enable_perl=no -fi # GTK - if test "$enable_perl" = yes ; then AC_PATH_PROG(perlpath, perl) AC_MSG_CHECKING(for Perl compile flags) @@ -1897,7 +1892,7 @@ echo Build with GtkSpell support... : $enable_gtkspell echo Build with DBUS support....... : $enable_dbus if test "x$enable_dbus" = "xyes" ; then -eval echo DBUS servies directory........ : $DBUS_SERVICES_DIR +eval eval echo DBUS servies directory........ : $DBUS_SERVICES_DIR fi echo Build with Cyrus SASL support. : $enable_cyrus_sasl echo Build with libxml2 support.... : $enable_libxml2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-08-31 21:52:14
|
Revision: 17102 http://svn.sourceforge.net/gaim/?rev=17102&view=rev Author: deryni9 Date: 2006-08-31 14:52:06 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Remove gaim_show_xfer_dialog, it was only used as a callback from the buddy list menus, and it just ended up calling gaim_gtkxfer_dialog_show anyway, so I removed the middle man. Modified Paths: -------------- trunk/doc/ChangeLog.API trunk/gtk/gtkblist.c trunk/gtk/gtkft.c trunk/gtk/gtkft.h Modified: trunk/doc/ChangeLog.API =================================================================== --- trunk/doc/ChangeLog.API 2006-08-31 21:50:55 UTC (rev 17101) +++ trunk/doc/ChangeLog.API 2006-08-31 21:52:06 UTC (rev 17102) @@ -130,6 +130,8 @@ * GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH * gtk_imhtml_search_find(): Now wraps around to the top instead of clearing the search at the end. + * gaim_gtkxfer_dialog_show: Can now take NULL to show (and possibly + create) a default gtkxfer dialog. Removed: * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute @@ -194,6 +196,7 @@ * Removed ui_ops from GaimBuddyList. Use gaim_blist_get_ui_ops() instead * GaimGtkLogViewer hidden... You weren't using it anyway. * GaimGtkConversation: dialogs (dialogs.search moved to GaimGtkWindow) + * gaim_show_xfer_dialog: Use gaim_gtk_xfer_dialog_show(NULL) instead. Added: * gaim_prefs_disconnect_by_handle() @@ -373,6 +376,7 @@ * "gtkblist-unhiding" * "log-displaying" * "savedstatus-changed" + * "sendto-extended-menu" Signals - Removed: * "account-away": replaced by account-status-changed Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-08-31 21:50:55 UTC (rev 17101) +++ trunk/gtk/gtkblist.c 2006-08-31 21:52:06 UTC (rev 17102) @@ -2494,7 +2494,7 @@ { N_("/Tools/Pr_eferences"), "<CTL>P", gaim_gtk_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, { N_("/Tools/Pr_ivacy"), NULL, gaim_gtk_privacy_dialog_show, 0, "<StockItem>", GTK_STOCK_DIALOG_ERROR }, { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL }, - { N_("/Tools/_File Transfers"), "<CTL>T", gaim_show_xfer_dialog, 0, "<StockItem>", GAIM_STOCK_FILE_TRANSFER }, + { N_("/Tools/_File Transfers"), "<CTL>T", gaim_gtkxfer_dialog_show, 0, "<StockItem>", GAIM_STOCK_FILE_TRANSFER }, { N_("/Tools/R_oom List"), NULL, gaim_gtk_roomlist_dialog_show, 0, "<StockItem>", GTK_STOCK_INDEX }, { N_("/Tools/System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, "<StockItem>", GAIM_STOCK_LOG }, { "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL }, Modified: trunk/gtk/gtkft.c =================================================================== --- trunk/gtk/gtkft.c 2006-08-31 21:50:55 UTC (rev 17101) +++ trunk/gtk/gtkft.c 2006-08-31 21:52:06 UTC (rev 17102) @@ -844,9 +844,20 @@ void gaim_gtkxfer_dialog_show(GaimGtkXferDialog *dialog) { - g_return_if_fail(dialog != NULL); + GaimGtkXferDialog *tmp; - gtk_widget_show(dialog->window); + if (dialog == NULL) { + tmp = gaim_get_gtkxfer_dialog(); + + if (tmp == NULL) { + tmp = gaim_gtkxfer_dialog_new(); + gaim_set_gtkxfer_dialog(tmp); + } + + gtk_widget_show(tmp->window); + } else { + gtk_widget_show(dialog->window); + } } void @@ -860,22 +871,6 @@ } void -gaim_show_xfer_dialog() -{ - GaimGtkXferDialog *dialog; - - dialog = gaim_get_gtkxfer_dialog(); - - if (dialog == NULL) { - dialog = gaim_gtkxfer_dialog_new(); - - gaim_set_gtkxfer_dialog(dialog); - } - - gaim_gtkxfer_dialog_show(dialog); -} - -void gaim_gtkxfer_dialog_add_xfer(GaimGtkXferDialog *dialog, GaimXfer *xfer) { GaimGtkXferUiData *data; Modified: trunk/gtk/gtkft.h =================================================================== --- trunk/gtk/gtkft.h 2006-08-31 21:50:55 UTC (rev 17101) +++ trunk/gtk/gtkft.h 2006-08-31 21:52:06 UTC (rev 17102) @@ -55,7 +55,8 @@ void gaim_gtkxfer_dialog_destroy(GaimGtkXferDialog *dialog); /** - * Displays the file transfer dialog. + * Displays the file transfer dialog given. + * If dialog is @c NULL, displays the default dialog, creating one if necessary * * @param dialog The file transfer dialog to show. */ @@ -69,11 +70,6 @@ void gaim_gtkxfer_dialog_hide(GaimGtkXferDialog *dialog); /** - * Shows the file transfer dialog, creating a new one if necessary - */ -void gaim_show_xfer_dialog(void); - -/** * Adds a file transfer to the dialog. * * @param dialog The file transfer dialog. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-08-31 21:51:06
|
Revision: 17101 http://svn.sourceforge.net/gaim/?rev=17101&view=rev Author: eblanton Date: 2006-08-31 14:50:55 -0700 (Thu, 31 Aug 2006) Log Message: ----------- This shouldn't be necessary, but I don't see how it's happening just yet Modified Paths: -------------- trunk/console/gntblist.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-31 12:38:50 UTC (rev 17100) +++ trunk/console/gntblist.c 2006-08-31 21:50:55 UTC (rev 17101) @@ -121,6 +121,11 @@ static void node_update(GaimBuddyList *list, GaimBlistNode *node) { + /* It really looks like this should never happen ... but it does. + This will at least emit a warning to the log when it + happens, so maybe someone will figure it out. */ + g_return_if_fail(node != NULL); + if (list->ui_data == NULL) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-31 12:38:58
|
Revision: 17100 http://svn.sourceforge.net/gaim/?rev=17100&view=rev Author: mayuan2006 Date: 2006-08-31 05:38:50 -0700 (Thu, 31 Aug 2006) Log Message: ----------- fix the bug of MSN picture by processing ILN and NLN command thanks for chris help! committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/notification.c Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-31 09:44:51 UTC (rev 17099) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-31 12:38:50 UTC (rev 17100) @@ -886,7 +886,7 @@ msn_user_set_friendly_name(user, friendly); - if (session->protocol_ver >= 9 && cmd->param_count == 7){ + if (session->protocol_ver >= 9 && cmd->param_count == 8){ msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[6])); msn_user_set_object(user, msnobj); } @@ -938,7 +938,7 @@ msn_user_set_friendly_name(user, friendly); if (session->protocol_ver >= 9){ - if (cmd->param_count == 6){ + if (cmd->param_count == 7){ msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5])); msn_user_set_object(user, msnobj); }else{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-31 09:45:09
|
Revision: 17099 http://svn.sourceforge.net/gaim/?rev=17099&view=rev Author: thekingant Date: 2006-08-31 02:44:51 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Better connection error messages for dnsquery failures in general and for oscar Modified Paths: -------------- trunk/libgaim/dnsquery.c trunk/libgaim/protocols/oscar/flap_connection.c trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/oscar/oscar.h trunk/libgaim/protocols/oscar/oscar_data.c trunk/libgaim/proxy.c Modified: trunk/libgaim/dnsquery.c =================================================================== --- trunk/libgaim/dnsquery.c 2006-08-31 09:02:10 UTC (rev 17098) +++ trunk/libgaim/dnsquery.c 2006-08-31 09:44:51 UTC (rev 17099) @@ -524,7 +524,7 @@ if ((rc == 4) && (err != 0)) { #ifdef HAVE_GETADDRINFO - g_snprintf(message, sizeof(message), _("Error resolving %s: %s"), + g_snprintf(message, sizeof(message), _("Error resolving %s:\n%s"), query_data->hostname, gai_strerror(err)); #else g_snprintf(message, sizeof(message), _("Error resolving %s: %d"), @@ -549,7 +549,7 @@ gaim_dnsquery_resolved(query_data, hosts); } else if (rc == -1) { - g_snprintf(message, sizeof(message), _("Error reading from resolver process: %s"), strerror(errno)); + g_snprintf(message, sizeof(message), _("Error reading from resolver process:\n%s"), strerror(errno)); gaim_dnsquery_failed(query_data, message); } else if (rc == 0) { @@ -668,7 +668,7 @@ } freeaddrinfo(tmp); } else { - query_data->error_message = g_strdup_printf(_("Error resolving %s: %s"), query_data->hostname, gai_strerror(rc)); + query_data->error_message = g_strdup_printf(_("Error resolving %s:\n%s"), query_data->hostname, gai_strerror(rc)); } #else if ((hp = gethostbyname(query_data->hostname))) { Modified: trunk/libgaim/protocols/oscar/flap_connection.c =================================================================== --- trunk/libgaim/protocols/oscar/flap_connection.c 2006-08-31 09:02:10 UTC (rev 17098) +++ trunk/libgaim/protocols/oscar/flap_connection.c 2006-08-31 09:44:51 UTC (rev 17099) @@ -163,6 +163,24 @@ close(conn->fd); conn->fd = -1; } + + if (conn->watcher_incoming != 0) + { + gaim_input_remove(conn->watcher_incoming); + conn->watcher_incoming = 0; + } + + if (conn->watcher_outgoing != 0) + { + gaim_input_remove(conn->watcher_outgoing); + conn->watcher_outgoing = 0; + } + + g_free(conn->buffer_incoming.data.data); + conn->buffer_incoming.data.data = NULL; + + gaim_circ_buffer_destroy(conn->buffer_outgoing); + conn->buffer_outgoing = NULL; } static void @@ -199,34 +217,13 @@ conn = data; od = conn->od; + account = gaim_connection_get_account(od->gc); gaim_debug_info("oscar", "Destroying oscar connection of " "type 0x%04hx\n", conn->type); - flap_connection_close(od, conn); - - g_free(conn->cookie); - - if (conn->watcher_incoming != 0) - gaim_input_remove(conn->watcher_incoming); - if (conn->watcher_outgoing != 0) - gaim_input_remove(conn->watcher_outgoing); - g_free(conn->buffer_incoming.data.data); - gaim_circ_buffer_destroy(conn->buffer_outgoing); - - /* - * Free conn->internal, if necessary - */ - if (conn->type == SNAC_FAMILY_CHAT) - flap_connection_destroy_chat(od, conn); - - g_slist_free(conn->groups); - flap_connection_destroy_rates(conn->rates); - od->oscar_connections = g_slist_remove(od->oscar_connections, conn); - account = gaim_connection_get_account(od->gc); - /* * TODO: If we don't have a SNAC_FAMILY_LOCATE connection then * we should try to request one instead of disconnecting. @@ -235,15 +232,17 @@ || (!flap_connection_getbytype(od, SNAC_FAMILY_LOCATE)))) { /* No more FLAP connections! Sign off this GaimConnection! */ - const gchar *tmp; + gchar *tmp; if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_CLOSED) - tmp = _("Server closed the connection."); + tmp = g_strdup(_("Server closed the connection.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_LOST_CONNECTION) - tmp = _("Lost connection with server for an unknown reason."); + tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + conn->error_message); else if (conn->disconnect_reason == OSCAR_DISCONNECT_INVALID_DATA) - tmp = _("Received invalid data on connection with server."); + tmp = g_strdup(_("Received invalid data on connection with server.")); else if (conn->disconnect_reason == OSCAR_DISCONNECT_COULD_NOT_CONNECT) - tmp = _("Could not establish a connection with the server."); + tmp = g_strdup_printf(_("Could not establish a connection with the server:\n%s"), + conn->error_message); else /* * We shouldn't print a message for some disconnect_reasons. @@ -252,20 +251,43 @@ tmp = NULL; if (tmp != NULL) + { gaim_connection_error(od->gc, tmp); + g_free(tmp); + } } + flap_connection_close(od, conn); + + g_free(conn->error_message); + g_free(conn->cookie); + + /* + * Free conn->internal, if necessary + */ + if (conn->type == SNAC_FAMILY_CHAT) + flap_connection_destroy_chat(od, conn); + + g_slist_free(conn->groups); + flap_connection_destroy_rates(conn->rates); + g_free(conn); return FALSE; } +/** + * See the comments for the parameters of + * flap_connection_schedule_destroy(). + */ void -flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason) +flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message) { if (conn->destroy_timeout != 0) gaim_timeout_remove(conn->destroy_timeout); conn->disconnect_reason = reason; + g_free(conn->error_message); + conn->error_message = g_strdup(error_message); flap_connection_destroy_cb(conn); } @@ -274,9 +296,18 @@ * return control back to the program's main loop. We must do this * if we want to destroy the connection but we are still using it * for some reason. + * + * @param reason The reason for the disconnection. + * @param error_message A brief error message that gives more detail + * regarding the reason for the disconnecting. This should + * be NULL for everything except OSCAR_DISCONNECT_LOST_CONNECTION, + * in which case it should contain the value of strerror(errno), + * and OSCAR_DISCONNECT_COULD_NOT_CONNECT, in which case it + * should contain the error_message passed back from the call + * to gaim_proxy_connect(). */ void -flap_connection_schedule_destroy(FlapConnection *conn, OscarDisconnectReason reason) +flap_connection_schedule_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message) { if (conn->destroy_timeout != 0) /* Already taken care of */ @@ -285,6 +316,7 @@ gaim_debug_info("oscar", "Scheduling destruction of FLAP " "connection of type 0x%04hx\n", conn->type); conn->disconnect_reason = reason; + conn->error_message = g_strdup(error_message); conn->destroy_timeout = gaim_timeout_add(0, flap_connection_destroy_cb, conn); } @@ -571,7 +603,7 @@ "0x00000001 but received FLAP version %08lx. Closing connection.\n", flap_version); flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_INVALID_DATA); + OSCAR_DISCONNECT_INVALID_DATA, NULL); } else conn->connected = TRUE; @@ -616,7 +648,7 @@ if (read == 0) { flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_REMOTE_CLOSED); + OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); break; } @@ -629,7 +661,7 @@ /* Error! */ flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_LOST_CONNECTION); + OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); break; } @@ -644,7 +676,7 @@ if (aimutil_get8(&header[0]) != 0x2a) { flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_INVALID_DATA); + OSCAR_DISCONNECT_INVALID_DATA, NULL); break; } @@ -668,7 +700,7 @@ if (read == 0) { flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_REMOTE_CLOSED); + OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); break; } @@ -680,7 +712,7 @@ /* Error! */ flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_LOST_CONNECTION); + OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); break; } @@ -724,7 +756,8 @@ return; /* Error! */ - flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_LOST_CONNECTION); + flap_connection_schedule_destroy(conn, + OSCAR_DISCONNECT_LOST_CONNECTION, strerror(errno)); return; } Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-08-31 09:02:10 UTC (rev 17098) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-08-31 09:44:51 UTC (rev 17099) @@ -897,7 +897,7 @@ /* Destroy the chat_connection */ od->oscar_chats = g_slist_remove(od->oscar_chats, cc); - flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE); + flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE, NULL); oscar_chat_destroy(cc); } @@ -927,12 +927,27 @@ gaim_debug_error("oscar", "unable to connect FLAP server " "of type 0x%04hx\n", conn->type); if (conn->type == SNAC_FAMILY_AUTH) - gaim_connection_error(gc, _("Could not connect to authentication server")); - if (conn->type == SNAC_FAMILY_LOCATE) - gaim_connection_error(gc, _("Could not connect to BOS server")); - else /* Maybe we should call this for BOS connections, too? */ + { + gchar *msg; + msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"), + error_message); + gaim_connection_error(gc, msg); + g_free(msg); + } + else if (conn->type == SNAC_FAMILY_LOCATE) + { + gchar *msg; + msg = g_strdup_printf(_("Could not connect to BOS server:\n%s"), + error_message); + gaim_connection_error(gc, msg); + g_free(msg); + } + else + { + /* Maybe we should call this for BOS connections, too? */ flap_connection_schedule_destroy(conn, - OSCAR_DISCONNECT_COULD_NOT_CONNECT); + OSCAR_DISCONNECT_COULD_NOT_CONNECT, error_message); + } return; } @@ -1302,7 +1317,7 @@ (info->email != NULL) ? info->email : "null"); gaim_debug_misc("oscar", "BOSIP: %s\n", info->bosip); gaim_debug_info("oscar", "Closing auth connection...\n"); - flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_DONE); + flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_DONE, NULL); for (i = 0; i < strlen(info->bosip); i++) { if (info->bosip[i] == ':') { @@ -1617,7 +1632,9 @@ connection_established_cb, newconn); if (newconn->connect_data == NULL) { - flap_connection_schedule_destroy(newconn, OSCAR_DISCONNECT_COULD_NOT_CONNECT); + flap_connection_schedule_destroy(newconn, + OSCAR_DISCONNECT_COULD_NOT_CONNECT, + _("gaim_proxy_connect() failed")); gaim_debug_error("oscar", "Unable to connect to FLAP server " "of type 0x%04hx\n", redir->group); } @@ -6515,7 +6532,7 @@ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); option = gaim_account_option_bool_new( - _("Always use AIM/ICQ proxy server\n(slower, but does not reveal your IP address)"), "always_use_rv_proxy", + _("Always use AIM/ICQ proxy server for file transfers\n(slower, but does not reveal your IP address)"), "always_use_rv_proxy", OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); Modified: trunk/libgaim/protocols/oscar/oscar.h =================================================================== --- trunk/libgaim/protocols/oscar/oscar.h 2006-08-31 09:02:10 UTC (rev 17098) +++ trunk/libgaim/protocols/oscar/oscar.h 2006-08-31 09:44:51 UTC (rev 17099) @@ -366,6 +366,7 @@ time_t lastactivity; /**< Time of last transmit. */ guint destroy_timeout; OscarDisconnectReason disconnect_reason; + gchar *error_message; /* A few variables that are only used when connecting */ GaimProxyConnectData *connect_data; @@ -571,8 +572,8 @@ /* flap_connection.c */ FlapConnection *flap_connection_new(OscarData *, int type); void flap_connection_close(OscarData *od, FlapConnection *conn); -void flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason); -void flap_connection_schedule_destroy(FlapConnection *conn, OscarDisconnectReason reason); +void flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message); +void flap_connection_schedule_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message); FlapConnection *flap_connection_findbygroup(OscarData *od, guint16 group); FlapConnection *flap_connection_getbytype(OscarData *, int type); FlapConnection *flap_connection_getbytype_all(OscarData *, int type); Modified: trunk/libgaim/protocols/oscar/oscar_data.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar_data.c 2006-08-31 09:02:10 UTC (rev 17098) +++ trunk/libgaim/protocols/oscar/oscar_data.c 2006-08-31 09:44:51 UTC (rev 17099) @@ -109,7 +109,7 @@ gaim_timeout_remove(od->getinfotimer); while (od->oscar_connections != NULL) flap_connection_destroy(od->oscar_connections->data, - OSCAR_DISCONNECT_DONE); + OSCAR_DISCONNECT_DONE, NULL); while (od->peer_connections != NULL) peer_connection_destroy(od->peer_connections->data, Modified: trunk/libgaim/proxy.c =================================================================== --- trunk/libgaim/proxy.c 2006-08-31 09:02:10 UTC (rev 17098) +++ trunk/libgaim/proxy.c 2006-08-31 09:44:51 UTC (rev 17099) @@ -1582,8 +1582,7 @@ if (error_message != NULL) { - gaim_proxy_connect_data_error(connect_data, - _("Error while resolving hostname: %s\n"), error_message); + gaim_proxy_connect_data_error(connect_data, error_message); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-31 09:02:29
|
Revision: 17098 http://svn.sourceforge.net/gaim/?rev=17098&view=rev Author: thekingant Date: 2006-08-31 02:02:10 -0700 (Thu, 31 Aug 2006) Log Message: ----------- I don't think PRPLs should need to make sure that proto_data is valid in the set_idle() callback. Some of my idle changes on the 23rd added that requirement. This removes the requirement to make things the way they were before. I'm also reverting SVN revision 17005 from faceprint and 17009 from marv_sf. Those revisions fixed the PRPLs so they wouldn't crash if set_idle() was called before the acocunt was fully connected. But that shouldn't be needed any more. Revision Links: -------------- http://svn.sourceforge.net/gaim/?rev=17005&view=rev Modified Paths: -------------- trunk/libgaim/protocols/jabber/iq.c trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/jabber.h trunk/libgaim/protocols/msn/state.c trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/status.c Modified: trunk/libgaim/protocols/jabber/iq.c =================================================================== --- trunk/libgaim/protocols/jabber/iq.c 2006-08-31 08:58:36 UTC (rev 17097) +++ trunk/libgaim/protocols/jabber/iq.c 2006-08-31 09:02:10 UTC (rev 17098) @@ -145,7 +145,7 @@ const char *from; const char *id; xmlnode *query; - GaimPresence *gpresence; + char *idle_time; type = xmlnode_get_attrib(packet, "type"); from = xmlnode_get_attrib(packet, "from"); @@ -158,19 +158,10 @@ query = xmlnode_get_child(iq->node, "query"); - gpresence = gaim_account_get_presence(js->gc->account); + idle_time = g_strdup_printf("%ld", js->idle ? time(NULL) - js->idle : 0); + xmlnode_set_attrib(query, "seconds", idle_time); + g_free(idle_time); - if(gaim_presence_is_idle(gpresence)) { - time_t idle_time = gaim_presence_get_idle_time(gpresence); - char *idle_str; - - idle_str = g_strdup_printf("%ld", time(NULL) - idle_time); - xmlnode_set_attrib(query, "seconds", idle_str); - g_free(idle_str); - } else { - xmlnode_set_attrib(query, "seconds", "0"); - } - jabber_iq_send(iq); } } Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-31 08:58:36 UTC (rev 17097) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-31 09:02:10 UTC (rev 17098) @@ -1040,14 +1040,13 @@ return g_strdup_printf("gaim%x", js->next_id++); } -/* + static void jabber_idle_set(GaimConnection *gc, int idle) { JabberStream *js = gc->proto_data; js->idle = idle ? time(NULL) - idle : idle; } -*/ static const char *jabber_list_icon(GaimAccount *a, GaimBuddy *b) { @@ -1848,7 +1847,7 @@ jabber_send_typing, /* send_typing */ jabber_buddy_get_info, /* get_info */ jabber_presence_send, /* set_away */ - NULL, /* set_idle */ + jabber_idle_set, /* set_idle */ NULL, /* change_passwd */ jabber_roster_add_buddy, /* add_buddy */ NULL, /* add_buddies */ Modified: trunk/libgaim/protocols/jabber/jabber.h =================================================================== --- trunk/libgaim/protocols/jabber/jabber.h 2006-08-31 08:58:36 UTC (rev 17097) +++ trunk/libgaim/protocols/jabber/jabber.h 2006-08-31 09:02:10 UTC (rev 17098) @@ -111,6 +111,8 @@ GList *oob_file_transfers; GList *file_transfers; + time_t idle; + JabberID *user; GaimConnection *gc; GaimSslConnection *gsc; Modified: trunk/libgaim/protocols/msn/state.c =================================================================== --- trunk/libgaim/protocols/msn/state.c 2006-08-31 08:58:36 UTC (rev 17097) +++ trunk/libgaim/protocols/msn/state.c 2006-08-31 09:02:10 UTC (rev 17098) @@ -41,7 +41,7 @@ void msn_change_status(MsnSession *session) { - GaimAccount *account = session->account; + GaimAccount *account; MsnCmdProc *cmdproc; MsnUser *user; MsnObject *msnobj; @@ -50,6 +50,7 @@ g_return_if_fail(session != NULL); g_return_if_fail(session->notification != NULL); + account = session->account; cmdproc = session->notification->cmdproc; user = session->user; state_text = msn_state_get_text(msn_state_from_account(account)); Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-31 08:58:36 UTC (rev 17097) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-31 09:02:10 UTC (rev 17098) @@ -3363,9 +3363,6 @@ char *msg = NULL, *msg2 = NULL; GaimStatus *status = NULL; - if (!yd) - return; - if (idle && yd->current_status != YAHOO_STATUS_CUSTOM) yd->current_status = YAHOO_STATUS_IDLE; else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) { Modified: trunk/libgaim/status.c =================================================================== --- trunk/libgaim/status.c 2006-08-31 08:58:36 UTC (rev 17097) +++ trunk/libgaim/status.c 2006-08-31 09:02:10 UTC (rev 17098) @@ -1388,11 +1388,11 @@ gc = gaim_account_get_connection(account); - if (gc != NULL && gc->prpl != NULL) + if (gc != NULL && GAIM_CONNECTION_IS_CONNECTED(gc) && + gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && - prpl_info->set_idle) + if (prpl_info && prpl_info->set_idle) prpl_info->set_idle(gc, (idle ? (time(NULL) - idle_time) : 0)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |