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: <sa...@us...> - 2006-08-23 05:16:47
|
Revision: 16996 Author: sadrul Date: 2006-08-22 22:16:40 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16996&view=rev Log Message: ----------- I am still shooting in the dark, but this may fix Luke's crashes for real. Modified Paths: -------------- trunk/console/gntnotify.c Modified: trunk/console/gntnotify.c =================================================================== --- trunk/console/gntnotify.c 2006-08-23 05:10:08 UTC (rev 16995) +++ trunk/console/gntnotify.c 2006-08-23 05:16:40 UTC (rev 16996) @@ -76,8 +76,8 @@ if (type == GAIM_NOTIFY_SEARCHRESULTS) gaim_notify_searchresults_free(g_object_get_data(handle, "notify-results")); -#if 0 - /* This does not seem to be necessary */ +#if 1 + /* This did not seem to be necessary */ g_signal_handlers_disconnect_by_func(G_OBJECT(widget), G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(type)); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 05:10:27
|
Revision: 16995 Author: sadrul Date: 2006-08-22 22:10:08 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16995&view=rev Log Message: ----------- Do it right Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-23 04:29:16 UTC (rev 16994) +++ trunk/console/plugins/gntgf.c 2006-08-23 05:10:08 UTC (rev 16995) @@ -129,7 +129,7 @@ g_free(str); gnt_widget_size_request(window); gnt_widget_get_size(window, &w, &h); - for (i = 0; i < MAX_COLS && gpsy[i] + h > getmaxy(stdscr) ; ++i) + for (i = 0; i < MAX_COLS && gpsy[i] + h >= getmaxy(stdscr) ; ++i) ; if (i >= MAX_COLS) { gaim_debug_warning("GntGf", "Dude, that's way too many popups\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-23 04:29:33
|
Revision: 16994 Author: marv_sf Date: 2006-08-22 21:29:16 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16994&view=rev Log Message: ----------- If an emblem is really big, scale it down to something sane. Use a really big emblem (the msn prpl icon) in yahoo. Modified Paths: -------------- trunk/gtk/gtkblist.c trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-08-23 04:22:04 UTC (rev 16993) +++ trunk/gtk/gtkblist.c 2006-08-23 04:29:16 UTC (rev 16994) @@ -3014,19 +3014,27 @@ g_free(filename); if(emblem) { if(i == 0 && size == GAIM_STATUS_ICON_SMALL) { + double scale_factor = 0.6; + if(gdk_pixbuf_get_width(emblem) > 20) + scale_factor = 9.0 / gdk_pixbuf_get_width(emblem); + gdk_pixbuf_composite(emblem, scale, 5, 5, 10, 10, 5, 5, - .6, .6, + scale_factor, scale_factor, GDK_INTERP_BILINEAR, 255); } else { + double scale_factor = 1.0; + if(gdk_pixbuf_get_width(emblem) > 20) + scale_factor = 15.0 / gdk_pixbuf_get_width(emblem); + gdk_pixbuf_composite(emblem, scale, emblems[i].x, emblems[i].y, 15, 15, emblems[i].x, emblems[i].y, - 1, 1, + scale_factor, scale_factor, GDK_INTERP_BILINEAR, 255); } Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-23 04:22:04 UTC (rev 16993) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-23 04:29:16 UTC (rev 16994) @@ -300,7 +300,8 @@ if (strtol(pair->value, NULL, 10) == 0) { if (f) f->status = YAHOO_STATUS_OFFLINE; - gaim_prpl_got_user_status(account, name, "offline", NULL); + if (name) + gaim_prpl_got_user_status(account, name, "offline", NULL); break; } break; @@ -2786,6 +2787,8 @@ emblems[i++] = "wireless"; if (yahoo_friend_get_game(f)) emblems[i++] = "game"; + if (f->protocol == 2) + emblems[i] = "msn"; } *se = emblems[0]; *sw = emblems[1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 04:22:10
|
Revision: 16993 Author: sadrul Date: 2006-08-22 21:22:04 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16993&view=rev Log Message: ----------- Patch from wabz (Richard Nelson): Do not crash when there are too many popups. Move the new ones to a different column instead. Modified Paths: -------------- trunk/console/plugins/gntgf.c Modified: trunk/console/plugins/gntgf.c =================================================================== --- trunk/console/plugins/gntgf.c 2006-08-23 03:00:10 UTC (rev 16992) +++ trunk/console/plugins/gntgf.c 2006-08-23 04:22:04 UTC (rev 16993) @@ -31,12 +31,15 @@ #define PREFS_EVENT_CHAT_NICK PREFS_EVENT "/chatnick" #define PREFS_BEEP PREFS_PREFIX "/beep" +#define MAX_COLS 3 + #include <glib.h> #include <plugin.h> #include <version.h> #include <blist.h> #include <conversation.h> +#include <debug.h> #include <util.h> #include <gnt.h> @@ -52,10 +55,12 @@ { GntWidget *window; int timer; + int column; } GntToast; static GList *toasters; -static int gpsy; +static int gpsy[MAX_COLS]; +static int gpsw[MAX_COLS]; static void destroy_toaster(GntToast *toast) @@ -71,21 +76,30 @@ { GList *iter; int h; + int col; + int nwin[MAX_COLS]; gnt_widget_get_size(toast->window, NULL, &h); - gpsy -= h; + gpsy[toast->column] -= h; + col = toast->column; + memset(&nwin, 0, sizeof(nwin)); destroy_toaster(toast); for (iter = toasters; iter; iter = iter->next) { int x, y; toast = iter->data; + nwin[toast->column]++; + if (toast->column != col) continue; gnt_widget_get_position(toast->window, &x, &y); y += h; gnt_screen_move_widget(toast->window, x, y); } + if (nwin[col] == 0) + gpsw[col] = 0; + return FALSE; } @@ -93,15 +107,15 @@ notify(const char *fmt, ...) { GntWidget *window; - GntToast *toast = g_new0(GntToast, 1); + GntToast *toast; char *str; - int h, w; + int h, w, i; va_list args; if (gaim_prefs_get_bool(PREFS_BEEP)) beep(); - toast->window = window = gnt_vbox_new(FALSE); + window = gnt_vbox_new(FALSE); GNT_WIDGET_SET_FLAGS(window, GNT_WIDGET_TRANSIENT); GNT_WIDGET_UNSET_FLAGS(window, GNT_WIDGET_NO_BORDER); @@ -115,9 +129,33 @@ g_free(str); gnt_widget_size_request(window); gnt_widget_get_size(window, &w, &h); - gpsy += h; - gnt_widget_set_position(window, getmaxx(stdscr) - w - 1, - getmaxy(stdscr) - gpsy - 1); + for (i = 0; i < MAX_COLS && gpsy[i] + h > getmaxy(stdscr) ; ++i) + ; + if (i >= MAX_COLS) { + gaim_debug_warning("GntGf", "Dude, that's way too many popups\n"); + gnt_widget_destroy(window); + return; + } + + toast = g_new0(GntToast, 1); + toast->window = window; + toast->column = i; + gpsy[i] += h; + if (w > gpsw[i]) { + if (i == 0) + gpsw[i] = w; + else + gpsw[i] = gpsw[i - 1] + w + 1; + } + + if (i == 0 || (w + gpsw[i - 1] >= getmaxx(stdscr))) { + /* if it's going to be too far left, overlap. */ + gnt_widget_set_position(window, getmaxx(stdscr) - w - 1, + getmaxy(stdscr) - gpsy[i] - 1); + } else { + gnt_widget_set_position(window, getmaxx(stdscr) - gpsw[i - 1] - w - 1, + getmaxy(stdscr) - gpsy[i] - 1); + } gnt_widget_draw(window); toast->timer = g_timeout_add(4000, (GSourceFunc)remove_toaster, toast); @@ -179,7 +217,8 @@ gaim_signal_connect(gaim_conversations_get_handle(), "received-chat-msg", plugin, GAIM_CALLBACK(received_chat_msg), NULL); - gpsy = 0; + memset(&gpsy, 0, sizeof(gpsy)); + memset(&gpsw, 0, sizeof(gpsw)); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-08-23 03:00:34
|
Revision: 16992 Author: eblanton Date: 2006-08-22 20:00:10 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16992&view=rev Log Message: ----------- Use default terminal colors if available Modified Paths: -------------- trunk/console/libgnt/gntcolors.c Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-08-23 02:34:40 UTC (rev 16991) +++ trunk/console/libgnt/gntcolors.c 2006-08-23 03:00:10 UTC (rev 16992) @@ -43,13 +43,14 @@ void gnt_init_colors() { static gboolean init = FALSE; + int defaults; if (init) return; init = TRUE; start_color(); - use_default_colors(); + defaults = use_default_colors(); if (can_use_custom_color()) { @@ -78,14 +79,22 @@ } else { - init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); + if (defaults == OK) + { + init_pair(GNT_COLOR_NORMAL, -1, -1); + init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, -1); + } + else + { + init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); + init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); + } init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK); init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_HIGHLIGHT_D, COLOR_CYAN, COLOR_BLACK); - init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 02:34:43
|
Revision: 16991 Author: sadrul Date: 2006-08-22 19:34:40 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16991&view=rev Log Message: ----------- The color configurations should work now. Modified Paths: -------------- trunk/console/libgnt/gntcolors.c Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-08-23 02:21:00 UTC (rev 16990) +++ trunk/console/libgnt/gntcolors.c 2006-08-23 02:34:40 UTC (rev 16991) @@ -23,6 +23,12 @@ } } +static gboolean +can_use_custom_color() +{ + return (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()); +} + static void restore_colors() { @@ -36,8 +42,16 @@ void gnt_init_colors() { + static gboolean init = FALSE; + + if (init) + return; + init = TRUE; + start_color(); - if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()) + use_default_colors(); + + if (can_use_custom_color()) { backup_colors(); @@ -64,7 +78,6 @@ } else { - use_default_colors(); init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); @@ -79,7 +92,7 @@ void gnt_uninit_colors() { - if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()) + if (can_use_custom_color()) restore_colors(); } @@ -87,23 +100,28 @@ get_color(char *key) { int color; + gboolean custom = can_use_custom_color(); key = g_strstrip(key); if (strcmp(key, "black") == 0) - color = GNT_COLOR_BLACK; + color = custom ? GNT_COLOR_BLACK : COLOR_BLACK; else if (strcmp(key, "red") == 0) - color = GNT_COLOR_RED; + color = custom ? GNT_COLOR_RED : COLOR_RED; else if (strcmp(key, "green") == 0) - color = GNT_COLOR_GREEN; + color = custom ? GNT_COLOR_GREEN : COLOR_GREEN; else if (strcmp(key, "blue") == 0) - color = GNT_COLOR_BLUE; + color = custom ? GNT_COLOR_BLUE : COLOR_BLUE; else if (strcmp(key, "white") == 0) - color = GNT_COLOR_WHITE; + color = custom ? GNT_COLOR_WHITE : COLOR_WHITE; else if (strcmp(key, "gray") == 0) - color = GNT_COLOR_GRAY; + color = custom ? GNT_COLOR_GRAY : COLOR_YELLOW; /* eh? */ else if (strcmp(key, "darkgray") == 0) - color = GNT_COLOR_DARK_GRAY; + color = custom ? GNT_COLOR_DARK_GRAY : COLOR_BLACK; + else if (strcmp(key, "magenta") == 0) + color = COLOR_MAGENTA; + else if (strcmp(key, "cyan") == 0) + color = COLOR_CYAN; else color = -1; return color; @@ -122,8 +140,9 @@ g_error_free(error); error = NULL; } - else + else if (nkeys) { + gnt_init_colors(); while (nkeys--) { gsize len; @@ -164,6 +183,8 @@ g_error_free(error); return; } + else if (nkeys) + gnt_init_colors(); while (nkeys--) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-23 02:21:07
|
Revision: 16990 Author: marv_sf Date: 2006-08-22 19:21:00 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16990&view=rev Log Message: ----------- oops, that was stupid. I blame the juicey goodness. Now that we actually properly set the protocol, it seems to work. I can send and receive messages back and forth between gaim on yahoo and windows live messenger. Messages I send seem to end up with </font>'s in them. Status updates also seem to work to some degree Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-23 01:35:44 UTC (rev 16989) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-23 02:21:00 UTC (rev 16990) @@ -477,17 +477,16 @@ GHashTable *ht; char *grp = NULL; char *norm_bud = NULL; + YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */ + /* But what if you had no friends? */ + GaimBuddy *b; + GaimGroup *g; + ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_slist_free); while (l) { struct yahoo_pair *pair = l->data; - YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */ - /* But what if you had no friends? */ - GaimBuddy *b; - GaimGroup *g; - - l = l->next; switch (pair->key) { @@ -514,8 +513,10 @@ break; case 241: /* another protocol user */ - if (f) + if (f) { f->protocol = strtol(pair->value, NULL, 10); + gaim_debug_info("yahoo", "Setting protocol to %d\n", f->protocol); + } break; /* case 242: */ /* this seems related to 241 */ /* break; */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 01:35:54
|
Revision: 16989 Author: sadrul Date: 2006-08-22 18:35:44 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16989&view=rev Log Message: ----------- Now the customcolors should work. Apparently I didn't include it in last commit. Modified Paths: -------------- trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntstyle.c trunk/console/libgnt/gntstyle.h Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntcolors.c 2006-08-23 01:35:44 UTC (rev 16989) @@ -1,5 +1,6 @@ #include <ncursesw/ncurses.h> #include "gntcolors.h" +#include "gntstyle.h" #include <glib.h> @@ -36,7 +37,7 @@ void gnt_init_colors() { start_color(); - if (can_change_color()) + if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()) { backup_colors(); @@ -63,6 +64,7 @@ } else { + use_default_colors(); init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); @@ -77,7 +79,8 @@ void gnt_uninit_colors() { - restore_colors(); + if (gnt_style_get_bool(GNT_STYLE_COLOR, FALSE) && can_change_color()) + restore_colors(); } static int Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntmain.c 2006-08-23 01:35:44 UTC (rev 16989) @@ -782,13 +782,13 @@ noecho(); curs_set(0); - gnt_init_colors(); gnt_init_styles(); filename = g_build_filename(g_get_home_dir(), ".gntrc", NULL); gnt_style_read_configure_file(filename); g_free(filename); + gnt_init_colors(); X_MIN = 0; Y_MIN = 0; X_MAX = getmaxx(stdscr); Modified: trunk/console/libgnt/gntstyle.c =================================================================== --- trunk/console/libgnt/gntstyle.c 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntstyle.c 2006-08-23 01:35:44 UTC (rev 16989) @@ -141,6 +141,7 @@ const char *style; GntStyle en; } styles[] = {{"shadow", GNT_STYLE_SHADOW}, + {"customcolor", GNT_STYLE_COLOR}, {NULL, 0}}; if (error) Modified: trunk/console/libgnt/gntstyle.h =================================================================== --- trunk/console/libgnt/gntstyle.h 2006-08-23 01:09:33 UTC (rev 16988) +++ trunk/console/libgnt/gntstyle.h 2006-08-23 01:35:44 UTC (rev 16989) @@ -3,6 +3,7 @@ typedef enum { GNT_STYLE_SHADOW = 0, + GNT_STYLE_COLOR = 1, GNT_STYLES } GntStyle; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 01:09:38
|
Revision: 16988 Author: sadrul Date: 2006-08-22 18:09:33 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16988&view=rev Log Message: ----------- This should fix Luke's crash, and this causes the default colors to be used. You can enable custom colors from ~/.gntrc by setting "customcolor=1" under "[general]". Modified Paths: -------------- trunk/console/libgnt/gntwidget.c Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-08-22 20:07:16 UTC (rev 16987) +++ trunk/console/libgnt/gntwidget.c 2006-08-23 01:09:33 UTC (rev 16988) @@ -385,8 +385,8 @@ gnt_widget_hide(GntWidget *widget) { wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); -#if 1 - /* XXX: I have no clue why, but this seems to be necessary. */ +#if 0 + /* XXX: I have no clue why, but this seemed to be necessary. */ if (gnt_widget_has_shadow(widget)) mvwvline(widget->window, 1, widget->priv.width, ' ', widget->priv.height); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-22 20:07:27
|
Revision: 16987 Author: faceprint Date: 2006-08-22 13:07:16 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16987&view=rev Log Message: ----------- I didn't like this in the buddy list, but the plugins dialog needed it Modified Paths: -------------- trunk/gtk/gtkblist.c trunk/gtk/gtkplugin.c Modified: trunk/gtk/gtkblist.c =================================================================== --- trunk/gtk/gtkblist.c 2006-08-22 19:43:30 UTC (rev 16986) +++ trunk/gtk/gtkblist.c 2006-08-22 20:07:16 UTC (rev 16987) @@ -3939,7 +3939,6 @@ G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER); gtkblist->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtkblist->treemodel)); - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW(gtkblist->treeview), TRUE); gtk_widget_show(gtkblist->treeview); gtk_widget_set_name(gtkblist->treeview, "gaim_gtkblist_treeview"); Modified: trunk/gtk/gtkplugin.c =================================================================== --- trunk/gtk/gtkplugin.c 2006-08-22 19:43:30 UTC (rev 16986) +++ trunk/gtk/gtkplugin.c 2006-08-22 20:07:16 UTC (rev 16987) @@ -560,6 +560,8 @@ event_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ls)); + gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(event_view), TRUE); + g_signal_connect(G_OBJECT(event_view), "row-activated", G_CALLBACK(show_plugin_prefs_cb), plugin_dialog); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-22 19:43:49
|
Revision: 16986 Author: faceprint Date: 2006-08-22 12:43:30 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16986&view=rev Log Message: ----------- I got a patch from Ian Goldberg about a year ago to let plugins tweak XML packets as they were sent or received I finally tweaked it the way I wanted it, and here it is. If it sucks, blame me, otherwise give him credit Modified Paths: -------------- trunk/COPYRIGHT trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/value.h Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-08-22 19:18:46 UTC (rev 16985) +++ trunk/COPYRIGHT 2006-08-22 19:43:30 UTC (rev 16986) @@ -111,6 +111,7 @@ Ike Gingerich Gustavo Giráldez Richard Gobeille +Ian Goldberg Michael Golden Charlie Gordon Ryan C. Gordon Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-22 19:18:46 UTC (rev 16985) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-22 19:43:30 UTC (rev 16986) @@ -168,6 +168,12 @@ void jabber_process_packet(JabberStream *js, xmlnode *packet) { + gaim_signal_emit(my_protocol, "jabber-receiving-xmlnode", js->gc, &packet); + + /* if the signal leaves us with a null packet, we're done */ + if(NULL == packet) + return; + if(!strcmp(packet->name, "iq")) { jabber_iq_parse(js, packet); } else if(!strcmp(packet->name, "presence")) { @@ -327,6 +333,12 @@ char *txt; int len; + gaim_signal_emit(my_protocol, "jabber-sending-xmlnode", js->gc, &packet); + + /* if we get NULL back, we're done processing */ + if(NULL == packet) + return; + txt = xmlnode_to_str(packet, &len); jabber_send_raw(js, txt, len); g_free(txt); @@ -1882,6 +1894,30 @@ NULL, /* whiteboard_prpl_ops */ }; +static gboolean load_plugin(GaimPlugin *plugin) +{ + gaim_signal_register(plugin, "jabber-receiving-xmlnode", + gaim_marshal_VOID__POINTER_POINTER, NULL, 2, + gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONNECTION), + gaim_value_new_outgoing(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_XMLNODE)); + + gaim_signal_register(plugin, "jabber-sending-xmlnode", + gaim_marshal_VOID__POINTER_POINTER, NULL, 2, + gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_CONNECTION), + gaim_value_new_outgoing(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_XMLNODE)); + + return TRUE; +} + +static gboolean unload_plugin(GaimPlugin *plugin) +{ + gaim_signal_unregister(plugin, "jabber-receiving-xmlnode"); + + gaim_signal_unregister(plugin, "jabber-sending-xmlnode"); + + return TRUE; +} + static GaimPluginInfo info = { GAIM_PLUGIN_MAGIC, @@ -1903,8 +1939,8 @@ NULL, /**< author */ GAIM_WEBSITE, /**< homepage */ - NULL, /**< load */ - NULL, /**< unload */ + load_plugin, /**< load */ + unload_plugin, /**< unload */ NULL, /**< destroy */ NULL, /**< ui_info */ Modified: trunk/libgaim/value.h =================================================================== --- trunk/libgaim/value.h 2006-08-22 19:18:46 UTC (rev 16985) +++ trunk/libgaim/value.h 2006-08-22 19:43:30 UTC (rev 16986) @@ -74,7 +74,8 @@ GAIM_SUBTYPE_STATUS, GAIM_SUBTYPE_LOG, GAIM_SUBTYPE_XFER, - GAIM_SUBTYPE_SAVEDSTATUS + GAIM_SUBTYPE_SAVEDSTATUS, + GAIM_SUBTYPE_XMLNODE } GaimSubType; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-08-22 19:18:56
|
Revision: 16985 Author: deryni9 Date: 2006-08-22 12:18:46 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16985&view=rev Log Message: ----------- I was working on debugging something and these came in handy. Modified Paths: -------------- trunk/libgaim/plugins/tcl/tcl_cmds.c Modified: trunk/libgaim/plugins/tcl/tcl_cmds.c =================================================================== --- trunk/libgaim/plugins/tcl/tcl_cmds.c 2006-08-22 18:28:00 UTC (rev 16984) +++ trunk/libgaim/plugins/tcl/tcl_cmds.c 2006-08-22 19:18:46 UTC (rev 16985) @@ -670,8 +670,8 @@ int tcl_cmd_conversation(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *list, *elem, *result = Tcl_GetObjResult(interp); - const char *cmds[] = { "find", "handle", "list", "new", "write", NULL }; - enum { CMD_CONV_FIND, CMD_CONV_HANDLE, CMD_CONV_LIST, CMD_CONV_NEW, CMD_CONV_WRITE } cmd; + const char *cmds[] = { "find", "handle", "list", "new", "write", "name", "title", NULL }; + enum { CMD_CONV_FIND, CMD_CONV_HANDLE, CMD_CONV_LIST, CMD_CONV_NEW, CMD_CONV_WRITE , CMD_CONV_NAME, CMD_CONV_TITLE } cmd; const char *styles[] = { "send", "recv", "system", NULL }; enum { CMD_CONV_WRITE_SEND, CMD_CONV_WRITE_RECV, CMD_CONV_WRITE_SYSTEM } style; const char *newopts[] = { "-chat", "-im" }; @@ -783,6 +783,26 @@ else gaim_conv_im_write(GAIM_CONV_IM(convo), from, what, flags, time(NULL)); break; + case CMD_CONV_NAME: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "conversation"); + return TCL_ERROR; + } + + if ((convo = tcl_validate_conversation(objv[2], interp)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, (char *)gaim_conversation_get_name(convo), -1); + break; + case CMD_CONV_TITLE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "conversation"); + return TCL_ERROR; + } + + if ((convo = tcl_validate_conversation(objv[2], interp)) == NULL) + return TCL_ERROR; + Tcl_SetStringObj(result, (char *)gaim_conversation_get_title(convo), -1); + break; } return TCL_OK; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-22 18:28:20
|
Revision: 16984 Author: faceprint Date: 2006-08-22 11:28:00 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16984&view=rev Log Message: ----------- get rid of some hardcoding of jabber IQ callbacks this should let plugins add their own callbacks, I think Modified Paths: -------------- trunk/libgaim/protocols/jabber/disco.c trunk/libgaim/protocols/jabber/iq.c trunk/libgaim/protocols/jabber/iq.h trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/oob.c trunk/libgaim/protocols/jabber/si.c Modified: trunk/libgaim/protocols/jabber/disco.c =================================================================== --- trunk/libgaim/protocols/jabber/disco.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/disco.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -200,7 +200,7 @@ const char *from = xmlnode_get_attrib(packet, "from"); const char *type = xmlnode_get_attrib(packet, "type"); - if(!strcmp(type, "get")) { + if(type && !strcmp(type, "get")) { JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "http://jabber.org/protocol/disco#items"); Modified: trunk/libgaim/protocols/jabber/iq.c =================================================================== --- trunk/libgaim/protocols/jabber/iq.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/iq.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -34,6 +34,9 @@ #include "utsname.h" #endif +GHashTable *iq_handlers = NULL; + + JabberIq *jabber_iq_new(JabberStream *js, JabberIqType type) { JabberIq *iq; @@ -250,6 +253,7 @@ xmlnode *query, *error, *x; const char *xmlns; const char *type, *id, *from; + JabberIqHandler *jih; query = xmlnode_get_child(packet, "query"); type = xmlnode_get_attrib(packet, "type"); @@ -269,53 +273,18 @@ /* Apparently not, so lets see if we have a pre-defined handler */ if(type && query && (xmlns = xmlnode_get_namespace(query))) { - if(!strcmp(type, "set")) { - if(!strcmp(xmlns, "jabber:iq:roster")) { - jabber_roster_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:oob")) { - jabber_oob_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/bytestreams")) { - jabber_bytestreams_parse(js, packet); - return; - } - } else if(!strcmp(type, "get")) { - if(!strcmp(xmlns, "jabber:iq:last")) { - jabber_iq_last_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:time")) { - jabber_iq_time_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:version")) { - jabber_iq_version_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/disco#info")) { - jabber_disco_info_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/disco#items")) { - jabber_disco_items_parse(js, packet); - return; - } - } else if(!strcmp(type, "result")) { - if(!strcmp(xmlns, "jabber:iq:roster")) { - jabber_roster_parse(js, packet); - return; - } else if(!strcmp(xmlns, "jabber:iq:register")) { - jabber_register_parse(js, packet); - return; - } else if(!strcmp(xmlns, "http://jabber.org/protocol/disco#info")) { - jabber_disco_info_parse(js, packet); - return; - } - } - } else { - if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) { - jabber_si_parse(js, packet); + if((jih = g_hash_table_lookup(iq_handlers, xmlns))) { + jih(js, packet); return; } } + + if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) { + jabber_si_parse(js, packet); + return; + } + /* If we get here, send the default error reply mandated by XMPP-CORE */ if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) { JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR); @@ -335,3 +304,28 @@ } } +void jabber_iq_register_handler(const char *xmlns, JabberIqHandler handlerfunc) +{ + g_hash_table_replace(iq_handlers, g_strdup(xmlns), handlerfunc); +} + +void jabber_iq_init(void) +{ + iq_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + + jabber_iq_register_handler("jabber:iq:roster", jabber_roster_parse); + jabber_iq_register_handler("jabber:iq:oob", jabber_oob_parse); + jabber_iq_register_handler("http://jabber.org/protocol/bytestreams", jabber_bytestreams_parse); + jabber_iq_register_handler("jabber:iq:last", jabber_iq_last_parse); + jabber_iq_register_handler("jabber:iq:time", jabber_iq_time_parse); + jabber_iq_register_handler("jabber:iq:version", jabber_iq_version_parse); + jabber_iq_register_handler("http://jabber.org/protocol/disco#info", jabber_disco_info_parse); + jabber_iq_register_handler("http://jabber.org/protocol/disco#items", jabber_disco_items_parse); + jabber_iq_register_handler("jabber:iq:register", jabber_register_parse); +} + +void jabber_iq_uninit(void) +{ + g_hash_table_destroy(iq_handlers); +} + Modified: trunk/libgaim/protocols/jabber/iq.h =================================================================== --- trunk/libgaim/protocols/jabber/iq.h 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/iq.h 2006-08-22 18:28:00 UTC (rev 16984) @@ -34,6 +34,8 @@ JABBER_IQ_NONE } JabberIqType; +typedef void (JabberIqHandler)(JabberStream *js, xmlnode *packet); + typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data); struct _JabberIq { @@ -60,4 +62,9 @@ void jabber_iq_send(JabberIq *iq); void jabber_iq_free(JabberIq *iq); +void jabber_iq_init(void); +void jabber_iq_uninit(void); + +void jabber_iq_register_handler(const char *xmlns, JabberIqHandler *func); + #endif /* _GAIM_JABBER_IQ_H_ */ Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -705,6 +705,10 @@ void jabber_register_parse(JabberStream *js, xmlnode *packet) { + const char *type; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "result")) + return; + if(js->registration) { GaimRequestFields *fields; GaimRequestFieldGroup *group; @@ -1957,6 +1961,8 @@ sasl_client_init(NULL); #endif jabber_register_commands(); + + jabber_iq_init(); } GAIM_INIT_PLUGIN(jabber, init_plugin, info); Modified: trunk/libgaim/protocols/jabber/oob.c =================================================================== --- trunk/libgaim/protocols/jabber/oob.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/oob.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -192,8 +192,12 @@ GaimXfer *xfer; char *filename; char *url; + const char *type; xmlnode *querynode, *urlnode; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "set")) + return; + if(!(querynode = xmlnode_get_child(packet, "query"))) return; Modified: trunk/libgaim/protocols/jabber/si.c =================================================================== --- trunk/libgaim/protocols/jabber/si.c 2006-08-22 18:10:43 UTC (rev 16983) +++ trunk/libgaim/protocols/jabber/si.c 2006-08-22 18:28:00 UTC (rev 16984) @@ -191,8 +191,11 @@ GaimXfer *xfer; JabberSIXfer *jsx; xmlnode *query, *streamhost; - const char *sid, *from; + const char *sid, *from, *type; + if(!(type = xmlnode_get_attrib(packet, "type")) || strcmp(type, "set")) + return; + if(!(from = xmlnode_get_attrib(packet, "from"))) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-22 18:10:53
|
Revision: 16983 Author: datallah Date: 2006-08-22 11:10:43 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16983&view=rev Log Message: ----------- Restructure updates for some makefiles that are not used by default and may not fully work. Remove gtk import stuff from oscar Makefile.mingw Modified Paths: -------------- trunk/libgaim/protocols/bonjour/Makefile.mingw trunk/libgaim/protocols/oscar/Makefile.mingw trunk/libgaim/protocols/qq/Makefile.mingw trunk/libgaim/protocols/toc/Makefile.mingw trunk/libgaim/protocols/zephyr/Makefile.mingw Modified: trunk/libgaim/protocols/bonjour/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/bonjour/Makefile.mingw 2006-08-22 17:02:20 UTC (rev 16982) +++ trunk/libgaim/protocols/bonjour/Makefile.mingw 2006-08-22 18:10:43 UTC (rev 16983) @@ -8,9 +8,9 @@ # PATHS # -INCLUDE_DIR := . GTK_TOP := ../../../../win32-dev/gtk_2_0 GAIM_TOP := ../../.. +LIBGAIM_TOP := ../.. BONJOUR_ROOT := . GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir HOWL_DIR := $(GAIM_TOP)/../win32-dev/howl-1.0.0 @@ -29,7 +29,7 @@ DEFINES = -# Static or Plugin... +# Static or Plugin... ifeq ($(TYPE),STATIC) DEFINES += -DSTATIC DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) @@ -44,7 +44,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -52,21 +52,17 @@ INCLUDE_PATHS += -I$(BONJOUR_ROOT) \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(HOWL_DIR)/include/howl \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(HOWL_DIR)/include \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ -L$(HOWL_DIR)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) ## @@ -86,11 +82,8 @@ ## LIBRARIES ## -LIBS = -lgtk-win32-2.0 \ +LIBS = \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ -lws2_32 \ -lintl \ -lhowl \ @@ -123,15 +116,15 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(LIBGAIM_TOP)/libgaim.dll.a: + $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib - $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll +$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a + $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## ## CLEAN RULES @@ -140,4 +133,3 @@ clean: rm -rf *.o rm -rf $(TARGET).dll - rm -rf $(TARGET).lib Modified: trunk/libgaim/protocols/oscar/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/oscar/Makefile.mingw 2006-08-22 17:02:20 UTC (rev 16982) +++ trunk/libgaim/protocols/oscar/Makefile.mingw 2006-08-22 18:10:43 UTC (rev 16983) @@ -49,12 +49,8 @@ INCLUDE_PATHS += -I$(OSCAR_ROOT) \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ -I$(LIBGAIM_TOP) \ -I$(LIBGAIM_TOP)/win32 \ -I$(GAIM_TOP) Modified: trunk/libgaim/protocols/qq/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/qq/Makefile.mingw 2006-08-22 17:02:20 UTC (rev 16982) +++ trunk/libgaim/protocols/qq/Makefile.mingw 2006-08-22 18:10:43 UTC (rev 16983) @@ -12,6 +12,7 @@ OPENQ_TOP := ../ GTK_TOP := ../../../../win32-dev/gtk_2_0 GAIM_TOP := ../../.. +LIBGAIM_TOP := ../.. OPENQ_ROOT := . GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir @@ -31,7 +32,7 @@ DEFINES = -DOPENQ_VERSION=\"$(OPENQ_VERSION)\" -# Static or Plugin... +# Static or Plugin... ifeq ($(TYPE),STATIC) DEFINES += -DSTATIC DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) @@ -46,7 +47,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -55,19 +56,15 @@ INCLUDE_PATHS += \ -I$(OPENQ_ROOT) \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = \ -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) ## ## SOURCES, OBJECTS @@ -116,12 +113,7 @@ ## LIBS = \ - -lgtk-win32-2.0 \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgdk_pixbuf-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ -lws2_32 \ -lintl \ -lgaim @@ -152,14 +144,14 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(LIBGAIM_TOP)/libgaim.dll.a: + $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib +$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## @@ -169,5 +161,4 @@ clean: rm -rf *.o rm -rf $(TARGET).dll - rm -rf $(TARGET).lib Modified: trunk/libgaim/protocols/toc/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/toc/Makefile.mingw 2006-08-22 17:02:20 UTC (rev 16982) +++ trunk/libgaim/protocols/toc/Makefile.mingw 2006-08-22 18:10:43 UTC (rev 16983) @@ -11,6 +11,7 @@ INCLUDE_DIR := . GTK_TOP := ../../../../win32-dev/gtk_2_0 GAIM_TOP := ../../.. +LIBGAIM_TOP := ../.. TOC_ROOT := . GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir @@ -26,7 +27,7 @@ DEFINES = -# Static or Plugin... +# Static or Plugin... ifeq ($(TYPE),STATIC) DEFINES += -DSTATIC DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) @@ -41,7 +42,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -49,19 +50,15 @@ INCLUDE_PATHS += -I$(TOC_ROOT) \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) ## @@ -78,11 +75,8 @@ ## LIBRARIES ## -LIBS = -lgtk-win32-2.0 \ +LIBS = \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ -lws2_32 \ -lintl \ -lgaim @@ -112,15 +106,15 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(LIBGAIM_TOP)/libgaim.dll.a: + $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib - $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll +$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a + $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## @@ -130,4 +124,3 @@ clean: rm -rf *.o rm -rf $(TARGET).dll - rm -rf $(TARGET).lib Modified: trunk/libgaim/protocols/zephyr/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/zephyr/Makefile.mingw 2006-08-22 17:02:20 UTC (rev 16982) +++ trunk/libgaim/protocols/zephyr/Makefile.mingw 2006-08-22 18:10:43 UTC (rev 16983) @@ -11,6 +11,7 @@ INCLUDE_DIR := . GTK_TOP := ../../../../win32-dev/gtk_2_0 GAIM_TOP := ../../.. +LIBGAIM_TOP := ../.. ZEPHYR_ROOT := . KRB4_TOP := ../../../../win32-dev/kfw-2.6.3-final.fixed GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir @@ -29,7 +30,7 @@ DEFINES = -# Static or Plugin... +# Static or Plugin... ifeq ($(TYPE),STATIC) DEFINES += -DSTATIC DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) @@ -39,7 +40,7 @@ endif endif -DEFINES += -DWIN32 -DKRB5_SYSTYPES__ +DEFINES += -DWIN32 -DKRB5_SYSTYPES__ ifeq ($(USE_KRB4),true) DEFINES += -DZEPHYR_USES_KERBEROS @@ -49,7 +50,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -57,14 +58,10 @@ INCLUDE_PATHS += -I$(ZEPHYR_ROOT) \ -I$(GTK_TOP)/include \ - -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ - -I$(GTK_TOP)/include/pango-1.0 \ - -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ -I$(GAIM_TOP) ifeq ($(USE_KRB4), true) @@ -72,7 +69,7 @@ endif LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) ifeq ($(USE_KRB4), true) LIB_PATHS+=-L$(KRB4_TOP)/lib/i386 @@ -145,17 +142,14 @@ ## LIBRARIES ## -LIBS = -lgtk-win32-2.0 \ +LIBS = \ -lglib-2.0 \ - -lgdk-win32-2.0 \ - -lgmodule-2.0 \ - -lgobject-2.0 \ -lws2_32 \ -lintl \ -lgaim -ifeq ($(USE_KRB4),true) - LIBS+= -lkrbv4w32 +ifeq ($(USE_KRB4),true) + LIBS+= -lkrbv4w32 endif ## @@ -183,15 +177,15 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(LIBGAIM_TOP)/libgaim.dll.a: + $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib - $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--enable-stdcall-fixup -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll +$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a + $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--enable-stdcall-fixup -o $(TARGET).dll ## @@ -201,4 +195,3 @@ clean: rm -rf *.o rm -rf $(TARGET).dll - rm -rf $(TARGET).lib This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-22 17:02:27
|
Revision: 16982 Author: sadrul Date: 2006-08-22 10:02:20 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16982&view=rev Log Message: ----------- Make sure new windows fit in the screen. Modified Paths: -------------- trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntwidget.c trunk/console/libgnt/test/multiwin.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-22 16:43:19 UTC (rev 16981) +++ trunk/console/libgnt/gntmain.c 2006-08-22 17:02:20 UTC (rev 16982) @@ -846,6 +846,8 @@ g_hash_table_replace(nodes, widget, node); + refresh_node(widget, node, NULL); + if (window_list.window) { if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-08-22 16:43:19 UTC (rev 16981) +++ trunk/console/libgnt/gntwidget.c 2006-08-22 17:02:20 UTC (rev 16982) @@ -331,6 +331,30 @@ widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow, widget->priv.y, widget->priv.x); + if (widget->window == NULL) /* The size is probably too large for the screen */ + { + int x = widget->priv.x, y = widget->priv.y; + int w = widget->priv.width + shadow, h = widget->priv.height + shadow; + int maxx, maxy; /* Max-X is cool */ + + getmaxyx(stdscr, maxy, maxx); + + if (x + w >= maxx) + x = MAX(0, maxx - w); + if (y + h >= maxy) + y = MAX(0, maxy - h); + + w = MIN(w, maxx); + h = MIN(h, maxy); + + widget->priv.x = x; + widget->priv.y = y; + widget->priv.width = w - shadow; + widget->priv.height = h - shadow; + + widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow, + widget->priv.y, widget->priv.x); + } init_widget(widget); } Modified: trunk/console/libgnt/test/multiwin.c =================================================================== --- trunk/console/libgnt/test/multiwin.c 2006-08-22 16:43:19 UTC (rev 16981) +++ trunk/console/libgnt/test/multiwin.c 2006-08-22 17:02:20 UTC (rev 16982) @@ -43,7 +43,7 @@ gnt_box_add_widget(GNT_BOX(box2), gnt_entry_new(NULL)); gnt_widget_show(hbox); - gnt_widget_set_position(box2, 35, 15); + gnt_widget_set_position(box2, 80, 40); gnt_widget_show(box2); gnt_tree_add_row_after(GNT_TREE(tree), "a", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-22 16:43:26
|
Revision: 16981 Author: sadrul Date: 2006-08-22 09:43:19 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16981&view=rev Log Message: ----------- Add files in console/ Modified Paths: -------------- trunk/po/POTFILES.in Modified: trunk/po/POTFILES.in =================================================================== --- trunk/po/POTFILES.in 2006-08-22 16:42:14 UTC (rev 16980) +++ trunk/po/POTFILES.in 2006-08-22 16:43:19 UTC (rev 16981) @@ -1,5 +1,34 @@ gaim.desktop.in +console/gntaccount.c +console/gntblist.c +console/gntconn.c +console/gntconv.c +console/gntdebug.c +console/gntgaim.c +console/gntnotify.c +console/gntplugin.c +console/gntprefs.c +console/gntrequest.c +console/gntstatus.c +console/gntui.c +console/libgnt/gntbox.c +console/libgnt/gntbutton.c +console/libgnt/gntcheckbox.c +console/libgnt/gntcolors.c +console/libgnt/gntcombobox.c +console/libgnt/gntentry.c +console/libgnt/gntkeys.c +console/libgnt/gntlabel.c +console/libgnt/gntline.c +console/libgnt/gntmain.c +console/libgnt/gntmarshal.c +console/libgnt/gntstyle.c +console/libgnt/gnttextview.c +console/libgnt/gnttree.c +console/libgnt/gntutils.c +console/libgnt/gntwidget.c console/plugins/gntgf.c +console/plugins/gnthistory.c gtk/gaimcombobox.c gtk/gaimstock.c gtk/gtkaccount.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-08-22 16:42:21
|
Revision: 16980 Author: roast Date: 2006-08-22 09:42:14 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16980&view=rev Log Message: ----------- the beginnings of a purely signal-driven logging subsystem Modified Paths: -------------- branches/soc-2006-file-loggers/src/log.c Modified: branches/soc-2006-file-loggers/src/log.c =================================================================== --- branches/soc-2006-file-loggers/src/log.c 2006-08-22 16:13:43 UTC (rev 16979) +++ branches/soc-2006-file-loggers/src/log.c 2006-08-22 16:42:14 UTC (rev 16980) @@ -82,6 +82,11 @@ static char *txt_logger_read(GaimLog *log, GaimLogReadFlags *flags); static int txt_logger_total_size(GaimLogType type, const char *name, GaimAccount *account); +static void log_buddy_signed_on_cb(GaimBuddy *buddy); +static void log_buddy_signed_off_cb(GaimBuddy *buddy); +static void log_buddy_status_changed_cb(GaimBuddy *buddy, GaimStatus *old_status, GaimStatus *new_status); +static void log_buddy_idle_changed_cb(GaimBuddy *buddy, gboolean old_idle, gboolean new_idle); + static GaimActionData supported_actions[] = { { GAIM_ACTION_UNSET_ACTION, GAIM_ACTION_UNSET_ACTION, FALSE, NULL}, { GAIM_ACTION_UNSET_STATUS, GAIM_ACTION_UNSET_STATUS, FALSE, NULL}, @@ -701,7 +706,8 @@ void gaim_log_init(void) { - void *handle = gaim_log_get_handle(); + void *log_handle = gaim_log_get_handle(); + void *blist_handle = gaim_blist_get_handle(); gaim_prefs_add_none("/core/logging"); gaim_prefs_add_bool("/core/logging/log_ims", FALSE); @@ -758,7 +764,7 @@ old_logger_get_log_sets); gaim_log_logger_add(old_logger); - gaim_signal_register(handle, "log-timestamp", + gaim_signal_register(log_handle, "log-timestamp", #if SIZEOF_TIME_T == 4 gaim_marshal_POINTER__POINTER_INT, #elif SIZEOF_TIME_T == 8 @@ -784,6 +790,17 @@ logsize_users = g_hash_table_new_full((GHashFunc)_gaim_logsize_user_hash, (GEqualFunc)_gaim_logsize_user_equal, (GDestroyNotify)_gaim_logsize_user_free_key, NULL); + + // connect to some of our signals + // eventually can rewrite the whole logging structure to use only signals + gaim_signal_connect(blist_handle, "buddy-signed-on", log_handle, + GAIM_CALLBACK(log_buddy_signed_on_cb), NULL); + gaim_signal_connect(blist_handle, "buddy-signed-off", log_handle, + GAIM_CALLBACK(log_buddy_signed_off_cb), NULL); + gaim_signal_connect(blist_handle, "buddy-status-changed", log_handle, + GAIM_CALLBACK(log_buddy_status_changed_cb), NULL); + gaim_signal_connect(blist_handle, "buddy-idle-changed", log_handle, + GAIM_CALLBACK(log_buddy_idle_changed_cb), NULL); } void @@ -1346,6 +1363,8 @@ GaimLogCommonLoggerData *data = log->logger_data; GIOStatus iostat; GError *gerror = NULL; + gboolean is_event = FALSE; /* if true, action is event. else, status */ + int i = 0; gsize written = 0; GString *writebuf = g_string_new(""); @@ -1380,13 +1399,24 @@ return 0; } + // is this action an event or status? + if (action > GAIM_ACTION_UNSET_STATUS && + action < GAIM_ACTION_UNSET_EVENT) { + is_event = FALSE; + } + else { + is_event = TRUE; + } + // create the log action if (tagdata != NULL && strlen(tagdata) > 0) { - g_string_printf(writebuf, "\t<event time=\"%s\"%s type=\"%s\">%s</event>\n", date, from_attributes, + g_string_printf(writebuf, "\t<%s time=\"%s\"%s type=\"%s\">%s</event>\n", + is_event ? "event" : "status", date, from_attributes, gaim_log_action_ulf_value(action), tagdata); } else { - g_string_printf(writebuf, "\t<event time=\"%s\"%s type=\"%s\" />\n", date, from_attributes, + g_string_printf(writebuf, "\t<%s time=\"%s\"%s type=\"%s\" />\n", + is_event ? "event" : "status", date, from_attributes, gaim_log_action_ulf_value(action)); } @@ -2321,3 +2351,101 @@ gaim_stringref_unref(data->pathref); g_slice_free(struct old_logger_data, data); } + +/* log_buddy_signed_(on|off)_cb shows that the xml_logger_write's don't get sender,senderformatted,alias,handle correct */ +static void log_buddy_signed_on_cb(GaimBuddy *buddy) { + GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); + const char *alias = NULL; + GList *log = NULL; + + if (conv == NULL) return; + + if (buddy->alias != NULL) + alias = buddy->alias; + else if (buddy->server_alias != NULL) + alias = buddy->server_alias; + else + alias = buddy->name; + + log = conv->logs; + while (log != NULL) { + gaim_log_write_action((GaimLog *)log->data, GAIM_ACTION_STATUS_ONLINE, + alias, gaim_presence_get_login_time(buddy->presence), NULL); + log = log->next; + } +} + +static void log_buddy_signed_off_cb(GaimBuddy *buddy) { + GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); + const char *alias = NULL; + GList *log; + + if (conv == NULL) return; + + if (buddy->alias != NULL) + alias = buddy->alias; + else if (buddy->server_alias != NULL) + alias = buddy->server_alias; + else + alias = buddy->name; + + log = conv->logs; + while (log != NULL) { + gaim_log_write_action((GaimLog *)log->data, GAIM_ACTION_STATUS_OFFLINE, + alias, time(NULL), NULL); + log = log->next; + } + +} + +/* create a gaim_log_write(_action)() call after figuring out which GaimLogs need to be written to */ +static void log_buddy_status_changed_cb(GaimBuddy *buddy, GaimStatus *old_status, GaimStatus *new_status) { + GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); + const char *alias = NULL; + GList *log; + + if (conv == NULL) return; + + if (buddy->alias != NULL) + alias = buddy->alias; + else if (buddy->server_alias != NULL) + alias = buddy->server_alias; + else + alias = buddy->name; + + log = conv->logs; + while (log != NULL) { + log = log->next; + } +/* + gaim_debug_info("log-cb", "buddy-status-changed: buddy \"%s\" changed from \"%s\" to \"%s\"\n", + buddy->name, + gaim_status_get_name(old_status), + gaim_status_get_name(new_status)); +*/ +} + +/* create a gaim_log_write(_action)() call after figuring out which GaimLogs need to be written to */ +static void log_buddy_idle_changed_cb(GaimBuddy *buddy, gboolean old_idle, gboolean new_idle) { + GaimConversation *conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account); + const char *alias = NULL; + GList *log; + + if (conv == NULL) return; + + if (buddy->alias != NULL) + alias = buddy->alias; + else if (buddy->server_alias != NULL) + alias = buddy->server_alias; + else + alias = buddy->name; + + log = conv->logs; + while (log != NULL) { + log = log->next; + } +/* + gaim_debug_info("log-cb", "buddy-idle-changed: buddy \"%s\" changed from \"%s\" to \"%s\", since %d\n", buddy->name, old_idle, new_idle, + gaim_presence_get_idle_time(buddy->presence)); +*/ +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-22 16:13:56
|
Revision: 16979 Author: mayuan2006 Date: 2006-08-22 09:13:43 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16979&view=rev Log Message: ----------- oim message post to user committed by Ma Yuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/oim.c branches/soc-2006-msnp13/src/protocols/msn/soap.c Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-22 15:46:59 UTC (rev 16978) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-22 16:13:43 UTC (rev 16979) @@ -419,8 +419,8 @@ gaim_debug_info("MaYuan","send UUM,payload{%s},strlen:%d,len:%d\n", payload,strlen(payload),payload_len); type = msg->type; - trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,payload_len); - msn_transaction_set_payload(trans, payload, payload_len); + trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,strlen(payload)); + msn_transaction_set_payload(trans, payload, strlen(payload)); msn_cmdproc_send_trans(cmdproc, trans); } Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-22 15:46:59 UTC (rev 16978) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-22 16:13:43 UTC (rev 16979) @@ -163,7 +163,7 @@ session = soapconn->session; g_return_if_fail(session != NULL); - msn_session_set_error(session, MSN_ERROR_SERV_DOWN, _("Unable to connect to OIM server")); +// msn_session_set_error(session, MSN_ERROR_SERV_DOWN, _("Unable to connect to OIM server")); } /*msn oim SOAP server connect process*/ @@ -188,13 +188,44 @@ msn_oim_report_to_user(MsnOim *oim,char *msg_str) { MsnMessage *message; - char * end,*endline; + char *date,*from,*decode_msg; + gsize body_len; + char **tokens; + char *start,*end; + int has_nick = 0; + char *passport_str,*passport; message = msn_message_new(MSN_MSG_UNKNOWN); msn_message_parse_payload(message,msg_str,strlen(msg_str), MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM); gaim_debug_info("MaYuan","oim body:{%s}\n",message->body); + decode_msg = gaim_base64_decode(message->body,&body_len); + date = (char *)g_hash_table_lookup(message->attr_table, "Date"); + from = (char *)g_hash_table_lookup(message->attr_table, "From"); + if(strstr(from," ")){ + has_nick = 1; + } + if(has_nick){ + tokens = g_strsplit(from , " " , 2); + passport_str = g_strdup(tokens[1]); + gaim_debug_info("MaYuan","oim Date:{%s},nickname:{%s},tokens[1]:{%s} passport{%s}\n", + date,tokens[0],tokens[1],passport_str); + g_strfreev(tokens); + }else{ + passport_str = g_strdup(from); + gaim_debug_info("MaYuan","oim Date:{%s},passport{%s}\n", + date,passport_str); + } + start = strstr(passport_str,"<"); + start += 1; + end = strstr(passport_str,">"); + passport = g_strndup(start,end - start); + g_free(passport_str); + gaim_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",date,passport); + + msn_session_report_user(oim->session,passport,decode_msg,GAIM_MESSAGE_SYSTEM); + g_free(passport); } void Modified: branches/soc-2006-msnp13/src/protocols/msn/soap.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-22 15:46:59 UTC (rev 16978) +++ branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-22 16:13:43 UTC (rev 16979) @@ -89,13 +89,15 @@ msn_soap_error_cb(GaimSslConnection *gsc, GaimSslErrorType error, void *data) { MsnSoapConn * soapconn = data; + g_return_if_fail(data != NULL); gaim_debug_info("MaYuan","Soap connection error!\n"); + msn_soap_set_process_step(soapconn, MSN_SOAP_UNCONNECTED); + /*error callback*/ if(soapconn->error_cb != NULL){ soapconn->error_cb(gsc,error,data); } - msn_soap_set_process_step(soapconn, MSN_SOAP_UNCONNECTED); } /*init the soap connection*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lsc...@us...> - 2006-08-22 15:47:03
|
Revision: 16978 Author: lschiere Date: 2006-08-22 08:46:59 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16978&view=rev Log Message: ----------- now sorted. Modified Paths: -------------- trunk/po/POTFILES.in Modified: trunk/po/POTFILES.in =================================================================== --- trunk/po/POTFILES.in 2006-08-22 15:38:49 UTC (rev 16977) +++ trunk/po/POTFILES.in 2006-08-22 15:46:59 UTC (rev 16978) @@ -1,46 +1,56 @@ gaim.desktop.in console/plugins/gntgf.c +gtk/gaimcombobox.c +gtk/gaimstock.c +gtk/gtkaccount.c +gtk/gtkblist.c +gtk/gtkcellview.c +gtk/gtkconn.c +gtk/gtkconv.c +gtk/gtkdebug.c +gtk/gtkdialogs.c +gtk/gtkexpander.c +gtk/gtkft.c +gtk/gtkimhtml.c +gtk/gtkimhtmltoolbar.c +gtk/gtklog.c +gtk/gtkmain.c +gtk/gtknotify.c +gtk/gtkplugin.c +gtk/gtkpounce.c +gtk/gtkprefs.c +gtk/gtkprivacy.c +gtk/gtkrequest.c +gtk/gtkroomlist.c +gtk/gtksavedstatuses.c +gtk/gtksound.c +gtk/gtkstatusbox.c +gtk/gtkutils.c +gtk/gtkwhiteboard.c gtk/plugins/cap/cap.c -libgaim/plugins/ciphertest.c gtk/plugins/contact_priority.c gtk/plugins/crazychat/cc_gaim_plugin.c -libgaim/plugins/dbus-example.c gtk/plugins/docklet/docklet.c gtk/plugins/docklet/eggtrayicon.c gtk/plugins/extplacement.c -libgaim/plugins/filectl.c gtk/plugins/gaiminc.c gtk/plugins/gaimrc.c gtk/plugins/gestures/gestures.c gtk/plugins/gevolution/add_buddy_dialog.c gtk/plugins/gevolution/assoc-buddy.c gtk/plugins/gevolution/eds-utils.c +gtk/plugins/gevolution/gevolution.c gtk/plugins/gevolution/gevo-util.c -gtk/plugins/gevolution/gevolution.c gtk/plugins/gevolution/new_person_dialog.c gtk/plugins/gtk-signals-test.c gtk/plugins/history.c gtk/plugins/iconaway.c -libgaim/plugins/idle.c -libgaim/plugins/ipc-test-client.c -libgaim/plugins/ipc-test-server.c -libgaim/plugins/log_reader.c gtk/plugins/mailchk.c -libgaim/plugins/mono/loader/mono.c gtk/plugins/musicmessaging/musicmessaging.c gtk/plugins/notify.c -libgaim/plugins/perl/perl.c -libgaim/plugins/psychic.c gtk/plugins/raw.c gtk/plugins/relnot.c -libgaim/plugins/signals-test.c -libgaim/plugins/simple.c gtk/plugins/spellchk.c -libgaim/plugins/ssl/ssl-gnutls.c -libgaim/plugins/ssl/ssl-nss.c -libgaim/plugins/ssl/ssl.c -libgaim/plugins/statenotify.c -libgaim/plugins/tcl/tcl.c gtk/plugins/ticker/ticker.c gtk/plugins/timestamp.c gtk/plugins/timestamp_format.c @@ -52,35 +62,25 @@ libgaim/conversation.c libgaim/desktopitem.c libgaim/ft.c -gtk/gtkaccount.c -gtk/gtkblist.c -gtk/gtkcellview.c -gtk/gaimcombobox.c -gtk/gtkconn.c -gtk/gtkconv.c -gtk/gtkdebug.c -gtk/gtkdialogs.c -gtk/gtkexpander.c -gtk/gtkft.c -gtk/gtkimhtml.c -gtk/gtkimhtmltoolbar.c -gtk/gtklog.c -gtk/gtkmain.c -gtk/gtknotify.c -gtk/gtkplugin.c -gtk/gtkpounce.c -gtk/gtkprefs.c -gtk/gtkprivacy.c -gtk/gtkrequest.c -gtk/gtkroomlist.c -gtk/gtksavedstatuses.c -gtk/gtksound.c -gtk/gtkstatusbox.c -gtk/gaimstock.c -gtk/gtkutils.c -gtk/gtkwhiteboard.c libgaim/log.c libgaim/plugin.c +libgaim/plugins/ciphertest.c +libgaim/plugins/dbus-example.c +libgaim/plugins/filectl.c +libgaim/plugins/idle.c +libgaim/plugins/ipc-test-client.c +libgaim/plugins/ipc-test-server.c +libgaim/plugins/log_reader.c +libgaim/plugins/mono/loader/mono.c +libgaim/plugins/perl/perl.c +libgaim/plugins/psychic.c +libgaim/plugins/signals-test.c +libgaim/plugins/simple.c +libgaim/plugins/ssl/ssl.c +libgaim/plugins/ssl/ssl-gnutls.c +libgaim/plugins/ssl/ssl-nss.c +libgaim/plugins/statenotify.c +libgaim/plugins/tcl/tcl.c libgaim/protocols/bonjour/bonjour.c libgaim/protocols/bonjour/bonjour.h libgaim/protocols/bonjour/jabber.c @@ -128,11 +128,11 @@ libgaim/protocols/simple/simple.c libgaim/protocols/toc/toc.c libgaim/protocols/yahoo/yahoo.c +libgaim/protocols/yahoo/yahoochat.c libgaim/protocols/yahoo/yahoo_doodle.c libgaim/protocols/yahoo/yahoo_filexfer.c libgaim/protocols/yahoo/yahoo_packet.c libgaim/protocols/yahoo/yahoo_profile.c -libgaim/protocols/yahoo/yahoochat.c libgaim/protocols/yahoo/ycht.c libgaim/protocols/zephyr/zephyr.c libgaim/proxy.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-22 15:38:53
|
Revision: 16977 Author: datallah Date: 2006-08-22 08:38:49 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16977&view=rev Log Message: ----------- Fix for reorganization. Modified Paths: -------------- trunk/gaim-installer.nsi Modified: trunk/gaim-installer.nsi =================================================================== --- trunk/gaim-installer.nsi 2006-08-22 12:07:41 UTC (rev 16976) +++ trunk/gaim-installer.nsi 2006-08-22 15:38:49 UTC (rev 16977) @@ -44,7 +44,7 @@ ;-------------------------------- ;Defines -!define GAIM_NSIS_INCLUDE_PATH ".\src\win32\nsis" +!define GAIM_NSIS_INCLUDE_PATH ".\gtk\win32\nsis" !define GAIM_INSTALLER_DEPS "..\win32-dev\gaim-inst-deps" !define GAIM_REG_KEY "SOFTWARE\gaim" @@ -70,11 +70,11 @@ ;-------------------------------- ;Modern UI Configuration - !define MUI_ICON ".\pixmaps\gaim-install.ico" - !define MUI_UNICON ".\pixmaps\gaim-install.ico" - !define MUI_WELCOMEFINISHPAGE_BITMAP ".\src\win32\nsis\gaim-intro.bmp" + !define MUI_ICON ".\gtk\pixmaps\gaim-install.ico" + !define MUI_UNICON ".\gtk\pixmaps\gaim-install.ico" + !define MUI_WELCOMEFINISHPAGE_BITMAP ".\gtk\win32\nsis\gaim-intro.bmp" !define MUI_HEADERIMAGE - !define MUI_HEADERIMAGE_BITMAP ".\src\win32\nsis\gaim-header.bmp" + !define MUI_HEADERIMAGE_BITMAP ".\gtk\win32\nsis\gaim-header.bmp" ; Alter License section !define MUI_LICENSEPAGE_BUTTON $(GAIM_LICENSE_BUTTON) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lsc...@us...> - 2006-08-22 12:07:59
|
Revision: 16976 Author: lschiere Date: 2006-08-22 05:07:41 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16976&view=rev Log Message: ----------- a POTFILES.in that doesn't break stats.pl Modified Paths: -------------- trunk/po/POTFILES.in Modified: trunk/po/POTFILES.in =================================================================== --- trunk/po/POTFILES.in 2006-08-22 12:02:22 UTC (rev 16975) +++ trunk/po/POTFILES.in 2006-08-22 12:07:41 UTC (rev 16976) @@ -1,142 +1,143 @@ gaim.desktop.in -plugins/cap/cap.c -plugins/ciphertest.c -plugins/contact_priority.c -plugins/crazychat/cc_gaim_plugin.c -plugins/dbus-example.c -plugins/docklet/docklet.c -plugins/docklet/eggtrayicon.c -plugins/extplacement.c -plugins/filectl.c -plugins/gaiminc.c -plugins/gaimrc.c -plugins/gestures/gestures.c -plugins/gevolution/add_buddy_dialog.c -plugins/gevolution/assoc-buddy.c -plugins/gevolution/eds-utils.c -plugins/gevolution/gevo-util.c -plugins/gevolution/gevolution.c -plugins/gevolution/new_person_dialog.c -plugins/gtk-signals-test.c -plugins/history.c -plugins/iconaway.c -plugins/idle.c -plugins/ipc-test-client.c -plugins/ipc-test-server.c -plugins/log_reader.c -plugins/mailchk.c -plugins/mono/loader/mono.c -plugins/musicmessaging/musicmessaging.c -plugins/notify.c -plugins/perl/perl.c -plugins/psychic.c -plugins/raw.c -plugins/relnot.c -plugins/signals-test.c -plugins/simple.c -plugins/spellchk.c -plugins/ssl/ssl-gnutls.c -plugins/ssl/ssl-nss.c -plugins/ssl/ssl.c -plugins/statenotify.c -plugins/tcl/tcl.c -plugins/ticker/ticker.c -plugins/timestamp.c -plugins/timestamp_format.c -plugins/win32/transparency/win2ktrans.c -plugins/win32/winprefs/winprefs.c -src/account.c -src/blist.c -src/connection.c -src/conversation.c -src/desktopitem.c -src/ft.c -src/gtkaccount.c -src/gtkblist.c -src/gtkcellview.c -src/gtkcombobox.c -src/gtkconn.c -src/gtkconv.c -src/gtkdebug.c -src/gtkdialogs.c -src/gtkexpander.c -src/gtkft.c -src/gtkimhtml.c -src/gtkimhtmltoolbar.c -src/gtklog.c -src/gtkmain.c -src/gtknotify.c -src/gtkplugin.c -src/gtkpounce.c -src/gtkprefs.c -src/gtkprivacy.c -src/gtkrequest.c -src/gtkroomlist.c -src/gtksavedstatuses.c -src/gtksound.c -src/gtkstatusbox.c -src/gtkstock.c -src/gtkutils.c -src/gtkwhiteboard.c -src/log.c -src/plugin.c -src/protocols/bonjour/bonjour.c -src/protocols/bonjour/bonjour.h -src/protocols/bonjour/jabber.c -src/protocols/gg/gg.c -src/protocols/irc/cmds.c -src/protocols/irc/dcc_send.c -src/protocols/irc/irc.c -src/protocols/irc/msgs.c -src/protocols/irc/parse.c -src/protocols/jabber/auth.c -src/protocols/jabber/buddy.c -src/protocols/jabber/chat.c -src/protocols/jabber/jabber.c -src/protocols/jabber/message.c -src/protocols/jabber/parser.c -src/protocols/jabber/presence.c -src/protocols/jabber/roster.c -src/protocols/jabber/si.c -src/protocols/jabber/xdata.c -src/protocols/msn/dialog.c -src/protocols/msn/error.c -src/protocols/msn/msn.c -src/protocols/msn/nexus.c -src/protocols/msn/notification.c -src/protocols/msn/servconn.c -src/protocols/msn/session.c -src/protocols/msn/state.c -src/protocols/msn/switchboard.c -src/protocols/msn/userlist.c -src/protocols/novell/nmuser.c -src/protocols/novell/novell.c -src/protocols/oscar/flap_connection.c -src/protocols/oscar/odc.c -src/protocols/oscar/oscar.c -src/protocols/oscar/peer.c -src/protocols/sametime/sametime.c -src/protocols/silc/buddy.c -src/protocols/silc/chat.c -src/protocols/silc/ft.c -src/protocols/silc/ops.c -src/protocols/silc/pk.c -src/protocols/silc/silc.c -src/protocols/silc/util.c -src/protocols/silc/wb.c -src/protocols/simple/simple.c -src/protocols/toc/toc.c -src/protocols/yahoo/yahoo.c -src/protocols/yahoo/yahoo_doodle.c -src/protocols/yahoo/yahoo_filexfer.c -src/protocols/yahoo/yahoo_packet.c -src/protocols/yahoo/yahoo_profile.c -src/protocols/yahoo/yahoochat.c -src/protocols/yahoo/ycht.c -src/protocols/zephyr/zephyr.c -src/proxy.c -src/request.h -src/savedstatuses.c -src/server.c -src/status.c -src/util.c +console/plugins/gntgf.c +gtk/plugins/cap/cap.c +libgaim/plugins/ciphertest.c +gtk/plugins/contact_priority.c +gtk/plugins/crazychat/cc_gaim_plugin.c +libgaim/plugins/dbus-example.c +gtk/plugins/docklet/docklet.c +gtk/plugins/docklet/eggtrayicon.c +gtk/plugins/extplacement.c +libgaim/plugins/filectl.c +gtk/plugins/gaiminc.c +gtk/plugins/gaimrc.c +gtk/plugins/gestures/gestures.c +gtk/plugins/gevolution/add_buddy_dialog.c +gtk/plugins/gevolution/assoc-buddy.c +gtk/plugins/gevolution/eds-utils.c +gtk/plugins/gevolution/gevo-util.c +gtk/plugins/gevolution/gevolution.c +gtk/plugins/gevolution/new_person_dialog.c +gtk/plugins/gtk-signals-test.c +gtk/plugins/history.c +gtk/plugins/iconaway.c +libgaim/plugins/idle.c +libgaim/plugins/ipc-test-client.c +libgaim/plugins/ipc-test-server.c +libgaim/plugins/log_reader.c +gtk/plugins/mailchk.c +libgaim/plugins/mono/loader/mono.c +gtk/plugins/musicmessaging/musicmessaging.c +gtk/plugins/notify.c +libgaim/plugins/perl/perl.c +libgaim/plugins/psychic.c +gtk/plugins/raw.c +gtk/plugins/relnot.c +libgaim/plugins/signals-test.c +libgaim/plugins/simple.c +gtk/plugins/spellchk.c +libgaim/plugins/ssl/ssl-gnutls.c +libgaim/plugins/ssl/ssl-nss.c +libgaim/plugins/ssl/ssl.c +libgaim/plugins/statenotify.c +libgaim/plugins/tcl/tcl.c +gtk/plugins/ticker/ticker.c +gtk/plugins/timestamp.c +gtk/plugins/timestamp_format.c +gtk/plugins/win32/transparency/win2ktrans.c +gtk/plugins/win32/winprefs/winprefs.c +libgaim/account.c +libgaim/blist.c +libgaim/connection.c +libgaim/conversation.c +libgaim/desktopitem.c +libgaim/ft.c +gtk/gtkaccount.c +gtk/gtkblist.c +gtk/gtkcellview.c +gtk/gaimcombobox.c +gtk/gtkconn.c +gtk/gtkconv.c +gtk/gtkdebug.c +gtk/gtkdialogs.c +gtk/gtkexpander.c +gtk/gtkft.c +gtk/gtkimhtml.c +gtk/gtkimhtmltoolbar.c +gtk/gtklog.c +gtk/gtkmain.c +gtk/gtknotify.c +gtk/gtkplugin.c +gtk/gtkpounce.c +gtk/gtkprefs.c +gtk/gtkprivacy.c +gtk/gtkrequest.c +gtk/gtkroomlist.c +gtk/gtksavedstatuses.c +gtk/gtksound.c +gtk/gtkstatusbox.c +gtk/gaimstock.c +gtk/gtkutils.c +gtk/gtkwhiteboard.c +libgaim/log.c +libgaim/plugin.c +libgaim/protocols/bonjour/bonjour.c +libgaim/protocols/bonjour/bonjour.h +libgaim/protocols/bonjour/jabber.c +libgaim/protocols/gg/gg.c +libgaim/protocols/irc/cmds.c +libgaim/protocols/irc/dcc_send.c +libgaim/protocols/irc/irc.c +libgaim/protocols/irc/msgs.c +libgaim/protocols/irc/parse.c +libgaim/protocols/jabber/auth.c +libgaim/protocols/jabber/buddy.c +libgaim/protocols/jabber/chat.c +libgaim/protocols/jabber/jabber.c +libgaim/protocols/jabber/message.c +libgaim/protocols/jabber/parser.c +libgaim/protocols/jabber/presence.c +libgaim/protocols/jabber/roster.c +libgaim/protocols/jabber/si.c +libgaim/protocols/jabber/xdata.c +libgaim/protocols/msn/dialog.c +libgaim/protocols/msn/error.c +libgaim/protocols/msn/msn.c +libgaim/protocols/msn/nexus.c +libgaim/protocols/msn/notification.c +libgaim/protocols/msn/servconn.c +libgaim/protocols/msn/session.c +libgaim/protocols/msn/state.c +libgaim/protocols/msn/switchboard.c +libgaim/protocols/msn/userlist.c +libgaim/protocols/novell/nmuser.c +libgaim/protocols/novell/novell.c +libgaim/protocols/oscar/flap_connection.c +libgaim/protocols/oscar/odc.c +libgaim/protocols/oscar/oscar.c +libgaim/protocols/oscar/peer.c +libgaim/protocols/sametime/sametime.c +libgaim/protocols/silc/buddy.c +libgaim/protocols/silc/chat.c +libgaim/protocols/silc/ft.c +libgaim/protocols/silc/ops.c +libgaim/protocols/silc/pk.c +libgaim/protocols/silc/silc.c +libgaim/protocols/silc/util.c +libgaim/protocols/silc/wb.c +libgaim/protocols/simple/simple.c +libgaim/protocols/toc/toc.c +libgaim/protocols/yahoo/yahoo.c +libgaim/protocols/yahoo/yahoo_doodle.c +libgaim/protocols/yahoo/yahoo_filexfer.c +libgaim/protocols/yahoo/yahoo_packet.c +libgaim/protocols/yahoo/yahoo_profile.c +libgaim/protocols/yahoo/yahoochat.c +libgaim/protocols/yahoo/ycht.c +libgaim/protocols/zephyr/zephyr.c +libgaim/proxy.c +libgaim/request.h +libgaim/savedstatuses.c +libgaim/server.c +libgaim/status.c +libgaim/util.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lsc...@us...> - 2006-08-22 12:02:30
|
Revision: 16975 Author: lschiere Date: 2006-08-22 05:02:22 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16975&view=rev Log Message: ----------- faq-ssl patch for IRIX and HPUX from Lennert (alverino) Van Alboom Modified Paths: -------------- web/htdocs/faq-ssl.txt Modified: web/htdocs/faq-ssl.txt =================================================================== --- web/htdocs/faq-ssl.txt 2006-08-22 06:17:43 UTC (rev 16974) +++ web/htdocs/faq-ssl.txt 2006-08-22 12:02:22 UTC (rev 16975) @@ -206,18 +206,16 @@ <pre><code>./configure --disable-nls</code></pre> Q: IRIX (6.5) -A: See <a href="http://sourceforge.net/forum/forum.php?thread_id=725839&forum_id=665"> -this thread</a> at our Sourceforge forum for some steps towards getting Gaim running on -IRIX. -<p> -Please get in touch if you do manage to make SSL go. +A: GnuTLS will get you SSL support, but with some caveats. +See <a href="http://gaim.sourceforge.net/faq2.php#q9"> +this faq entry</a> at our Sourceforge forum for some steps towards getting Gaim running on IRIX. </p> -<p> -Alternatively, SGI have a package of Gaim 0.64 on their freeware site here: -<a href="http://freeware.sgi.com/index-by-alpha.html"> -http://freeware.sgi.com/index-by-alpha.html</a><br /> -<b>Note:</b> That is not a current release, and is <i>not</i> supported by -Gaim developers or in #gaim. + +Q: HP-UX (11.11) +A: GnuTLS will get you SSL support. +See <a href="http://gaim.sourceforge.net/faq2.php#q10"> +this faq entry</a> at our Sourceforge forum for some steps towards getting +Gaim running on HP-UX. </p> Q: Solaris This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-22 06:17:47
|
Revision: 16974 Author: thekingant Date: 2006-08-21 23:17:43 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16974&view=rev Log Message: ----------- Revert SVN revisions 16945 and 16926. Go back to having 3 DNS lookup methods. It seems like people tend to prefer this. Sigh. Modified Paths: -------------- trunk/libgaim/dnsquery.c Modified: trunk/libgaim/dnsquery.c =================================================================== --- trunk/libgaim/dnsquery.c 2006-08-22 06:10:01 UTC (rev 16973) +++ trunk/libgaim/dnsquery.c 2006-08-22 06:17:43 UTC (rev 16974) @@ -44,11 +44,43 @@ gpointer data; guint timeout; +#if defined(__unix__) || defined(__APPLE__) + GaimDnsQueryResolverProcess *resolver; +#elif defined _WIN32 /* end __unix__ || __APPLE__ */ GThread *resolver; GSList *hosts; gchar *error_message; +#endif }; +#if defined(__unix__) || defined(__APPLE__) + +#define MAX_DNS_CHILDREN 4 + +/* + * This structure keeps a reference to a child resolver process. + */ +struct _GaimDnsQueryResolverProcess { + guint inpa; + int fd_in, fd_out; + pid_t dns_pid; +}; + +static GSList *free_dns_children = NULL; +static GQueue *queued_requests = NULL; + +static int number_of_dns_children = 0; + +/* + * This is a convenience struct used to pass data to + * the child resolver process. + */ +typedef struct { + char hostname[512]; + int port; +} dns_params_t; +#endif + static void gaim_dnsquery_resolved(GaimDnsQueryData *query_data, GSList *hosts) { @@ -67,7 +99,500 @@ gaim_dnsquery_destroy(query_data); } +#if defined(__unix__) || defined(__APPLE__) + +/* + * Unix! + */ + +/* + * Begin the DNS resolver child process functions. + */ +#ifdef HAVE_SIGNAL_H +static void +trap_gdb_bug() +{ + const char *message = + "Gaim's DNS child got a SIGTRAP signal.\n" + "This can be caused by trying to run gaim inside gdb.\n" + "There is a known gdb bug which prevents this. Supposedly gaim\n" + "should have detected you were using gdb and used an ugly hack,\n" + "check cope_with_gdb_brokenness() in dnsquery.c.\n\n" + "For more info about this bug, see http://sources.redhat.com/ml/gdb/2001-07/msg00349.html\n"; + fputs("\n* * *\n",stderr); + fputs(message,stderr); + fputs("* * *\n\n",stderr); + execlp("xmessage","xmessage","-center", message, NULL); + _exit(1); +} +#endif + +static void +gaim_dnsquery_resolver_run(int child_out, int child_in, gboolean show_debug) +{ + dns_params_t dns_params; + const size_t zero = 0; + int rc; +#ifdef HAVE_GETADDRINFO + struct addrinfo hints, *res, *tmp; + char servname[20]; +#else + struct sockaddr_in sin; + const size_t addrlen = sizeof(sin); +#endif + +#ifdef HAVE_SIGNAL_H + signal(SIGHUP, SIG_DFL); + signal(SIGINT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); + signal(SIGCHLD, SIG_DFL); + signal(SIGTERM, SIG_DFL); + signal(SIGTRAP, trap_gdb_bug); +#endif + + /* + * We resolve 1 host name for each iteration of this + * while loop. + * + * The top half of this reads in the hostname and port + * number from the socket with our parent. The bottom + * half of this resolves the IP (blocking) and sends + * the result back to our parent, when finished. + */ + while (1) { + const char ch = 'Y'; + fd_set fds; + struct timeval tv = { .tv_sec = 40 , .tv_usec = 0 }; + FD_ZERO(&fds); + FD_SET(child_in, &fds); + rc = select(child_in + 1, &fds, NULL, NULL, &tv); + if (!rc) { + if (show_debug) + printf("dns[%d]: nobody needs me... =(\n", getpid()); + break; + } + rc = read(child_in, &dns_params, sizeof(dns_params_t)); + if (rc < 0) { + perror("read()"); + break; + } + if (rc == 0) { + if (show_debug) + printf("dns[%d]: Oops, father has gone, wait for me, wait...!\n", getpid()); + _exit(0); + } + if (dns_params.hostname[0] == '\0') { + printf("dns[%d]: hostname = \"\" (port = %d)!!!\n", getpid(), dns_params.port); + _exit(1); + } + /* Tell our parent that we read the data successfully */ + write(child_out, &ch, sizeof(ch)); + + /* We have the hostname and port, now resolve the IP */ + +#ifdef HAVE_GETADDRINFO + g_snprintf(servname, sizeof(servname), "%d", dns_params.port); + memset(&hints, 0, sizeof(hints)); + + /* This is only used to convert a service + * name to a port number. As we know we are + * passing a number already, we know this + * value will not be really used by the C + * library. + */ + hints.ai_socktype = SOCK_STREAM; + rc = getaddrinfo(dns_params.hostname, servname, &hints, &res); + write(child_out, &rc, sizeof(rc)); + if (rc != 0) { + close(child_out); + if (show_debug) + printf("dns[%d] Error: getaddrinfo returned %d\n", + getpid(), rc); + dns_params.hostname[0] = '\0'; + continue; + } + tmp = res; + while (res) { + size_t ai_addrlen = res->ai_addrlen; + write(child_out, &ai_addrlen, sizeof(ai_addrlen)); + write(child_out, res->ai_addr, res->ai_addrlen); + res = res->ai_next; + } + freeaddrinfo(tmp); + write(child_out, &zero, sizeof(zero)); +#else + if (!inet_aton(dns_params.hostname, &sin.sin_addr)) { + struct hostent *hp; + if (!(hp = gethostbyname(dns_params.hostname))) { + write(child_out, &h_errno, sizeof(int)); + close(child_out); + if (show_debug) + printf("DNS Error: %d\n", h_errno); + _exit(0); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); + sin.sin_family = hp->h_addrtype; + } else + sin.sin_family = AF_INET; + + sin.sin_port = htons(dns_params.port); + write(child_out, &addrlen, sizeof(addrlen)); + write(child_out, &sin, addrlen); + write(child_out, &zero, sizeof(zero)); +#endif + dns_params.hostname[0] = '\0'; + } + + close(child_out); + close(child_in); + + _exit(0); +} +/* + * End the DNS resolver child process functions. + */ + +/* + * Begin the functions for dealing with the DNS child processes. + */ +static void +cope_with_gdb_brokenness() +{ +#ifdef __linux__ + static gboolean already_done = FALSE; + char s[256], e[512]; + int n; + pid_t ppid; + + if(already_done) + return; + already_done = TRUE; + ppid = getppid(); + snprintf(s, sizeof(s), "/proc/%d/exe", ppid); + n = readlink(s, e, sizeof(e)); + if(n < 0) + return; + + e[MIN(n,sizeof(e)-1)] = '\0'; + + if(strstr(e,"gdb")) { + gaim_debug_info("dns", + "Debugger detected, performing useless query...\n"); + gethostbyname("x.x.x.x.x"); + } +#endif +} + +static void +gaim_dnsquery_resolver_destroy(GaimDnsQueryResolverProcess *resolver) +{ + g_return_if_fail(resolver != NULL); + + /* + * We might as well attempt to kill our child process. It really + * doesn't matter if this fails, because children will expire on + * their own after a few seconds. + */ + if (resolver->dns_pid > 0) + kill(resolver->dns_pid, SIGKILL); + + if (resolver->inpa != 0) + gaim_input_remove(resolver->inpa); + + close(resolver->fd_in); + close(resolver->fd_out); + + g_free(resolver); + + number_of_dns_children--; +} + +static GaimDnsQueryResolverProcess * +gaim_dnsquery_resolver_new(gboolean show_debug) +{ + GaimDnsQueryResolverProcess *resolver; + int child_out[2], child_in[2]; + + /* Create pipes for communicating with the child process */ + if (pipe(child_out) || pipe(child_in)) { + gaim_debug_error("dns", + "Could not create pipes: %s\n", strerror(errno)); + return NULL; + } + + resolver = g_new(GaimDnsQueryResolverProcess, 1); + resolver->inpa = 0; + + cope_with_gdb_brokenness(); + + /* "Go fork and multiply." --Tommy Caldwell (Emily's dad, not the climber) */ + resolver->dns_pid = fork(); + + /* If we are the child process... */ + if (resolver->dns_pid == 0) { + /* We should not access the parent's side of the pipes, so close them */ + close(child_out[0]); + close(child_in[1]); + + gaim_dnsquery_resolver_run(child_out[1], child_in[0], show_debug); + /* The thread calls _exit() rather than returning, so we never get here */ + } + + /* We should not access the child's side of the pipes, so close them */ + close(child_out[1]); + close(child_in[0]); + if (resolver->dns_pid == -1) { + gaim_debug_error("dns", + "Could not create child process for DNS: %s\n", + strerror(errno)); + gaim_dnsquery_resolver_destroy(resolver); + return NULL; + } + + resolver->fd_out = child_out[0]; + resolver->fd_in = child_in[1]; + number_of_dns_children++; + gaim_debug_info("dns", + "Created new DNS child %d, there are now %d children.\n", + resolver->dns_pid, number_of_dns_children); + + return resolver; +} + +/** + * @return TRUE if the request was sent succesfully. FALSE + * if the request could not be sent. This isn't + * necessarily an error. If the child has expired, + * for example, we won't be able to send the message. + */ static gboolean +send_dns_request_to_child(GaimDnsQueryData *query_data, + GaimDnsQueryResolverProcess *resolver) +{ + pid_t pid; + dns_params_t dns_params; + int rc; + char ch; + + /* This waitpid might return the child's PID if it has recently + * exited, or it might return an error if it exited "long + * enough" ago that it has already been reaped; in either + * instance, we can't use it. */ + pid = waitpid(resolver->dns_pid, NULL, WNOHANG); + if (pid > 0) { + gaim_debug_warning("dns", "DNS child %d no longer exists\n", + resolver->dns_pid); + gaim_dnsquery_resolver_destroy(resolver); + return FALSE; + } else if (pid < 0) { + gaim_debug_warning("dns", "Wait for DNS child %d failed: %s\n", + resolver->dns_pid, strerror(errno)); + gaim_dnsquery_resolver_destroy(resolver); + return FALSE; + } + + /* Copy the hostname and port into a single data structure */ + strncpy(dns_params.hostname, query_data->hostname, sizeof(dns_params.hostname) - 1); + dns_params.hostname[sizeof(dns_params.hostname) - 1] = '\0'; + dns_params.port = query_data->port; + + /* Send the data structure to the child */ + rc = write(resolver->fd_in, &dns_params, sizeof(dns_params)); + if (rc < 0) { + gaim_debug_error("dns", "Unable to write to DNS child %d: %d\n", + resolver->dns_pid, strerror(errno)); + gaim_dnsquery_resolver_destroy(resolver); + return FALSE; + } + + g_return_val_if_fail(rc == sizeof(dns_params), -1); + + /* Did you hear me? (This avoids some race conditions) */ + rc = read(resolver->fd_out, &ch, sizeof(ch)); + if (rc != 1 || ch != 'Y') + { + gaim_debug_warning("dns", + "DNS child %d not responding. Killing it!\n", + resolver->dns_pid); + gaim_dnsquery_resolver_destroy(resolver); + return FALSE; + } + + gaim_debug_info("dns", + "Successfully sent DNS request to child %d\n", + resolver->dns_pid); + + query_data->resolver = resolver; + + return TRUE; +} + +static void host_resolved(gpointer data, gint source, GaimInputCondition cond); + +static void +handle_next_queued_request() +{ + GaimDnsQueryData *query_data; + GaimDnsQueryResolverProcess *resolver; + + if ((queued_requests == NULL) || (g_queue_is_empty(queued_requests))) + /* No more DNS queries, yay! */ + return; + + query_data = g_queue_pop_head(queued_requests); + + /* + * If we have any children, attempt to have them perform the DNS + * query. If we're able to send the query then resolver will be + * set to the GaimDnsQueryResolverProcess. Otherwise, resolver + * will be NULL and we'll need to create a new DNS request child. + */ + while (free_dns_children != NULL) + { + resolver = free_dns_children->data; + free_dns_children = g_slist_remove(free_dns_children, resolver); + + if (send_dns_request_to_child(query_data, resolver)) + /* We found an acceptable child, yay */ + break; + } + + /* We need to create a new DNS request child */ + if (query_data->resolver == NULL) + { + if (number_of_dns_children >= MAX_DNS_CHILDREN) + { + /* Apparently all our children are busy */ + g_queue_push_head(queued_requests, query_data); + return; + } + + resolver = gaim_dnsquery_resolver_new(gaim_debug_is_enabled()); + if (resolver == NULL) + { + gaim_dnsquery_failed(query_data, _("Unable to create new resolver process\n")); + return; + } + if (!send_dns_request_to_child(query_data, resolver)) + { + gaim_dnsquery_failed(query_data, _("Unable to send request to resolver process\n")); + return; + } + } + + query_data->resolver->inpa = gaim_input_add(query_data->resolver->fd_out, + GAIM_INPUT_READ, host_resolved, query_data); +} + +/* + * End the functions for dealing with the DNS child processes. + */ + +static void +host_resolved(gpointer data, gint source, GaimInputCondition cond) +{ + GaimDnsQueryData *query_data; + int rc, err; + GSList *hosts = NULL; + struct sockaddr *addr = NULL; + size_t addrlen; + char message[1024]; + + query_data = data; + + gaim_debug_info("dns", "Got response for '%s'\n", query_data->hostname); + gaim_input_remove(query_data->resolver->inpa); + query_data->resolver->inpa = 0; + + rc = read(query_data->resolver->fd_out, &err, sizeof(err)); + if ((rc == 4) && (err != 0)) + { +#ifdef HAVE_GETADDRINFO + g_snprintf(message, sizeof(message), _("Error resolving %s: %s"), + query_data->hostname, gai_strerror(err)); +#else + g_snprintf(message, sizeof(message), _("Error resolving %s: %d"), + query_data->hostname, err); +#endif + gaim_dnsquery_failed(query_data, message); + + } else if (rc > 0) { + /* Success! */ + while (rc > 0) { + rc = read(query_data->resolver->fd_out, &addrlen, sizeof(addrlen)); + if (rc > 0 && addrlen > 0) { + addr = g_malloc(addrlen); + rc = read(query_data->resolver->fd_out, addr, addrlen); + hosts = g_slist_append(hosts, GINT_TO_POINTER(addrlen)); + hosts = g_slist_append(hosts, addr); + } else { + break; + } + } + /* wait4(resolver->dns_pid, NULL, WNOHANG, NULL); */ + gaim_dnsquery_resolved(query_data, hosts); + + } else if (rc == -1) { + g_snprintf(message, sizeof(message), _("Error reading from resolver process: %s"), strerror(errno)); + gaim_dnsquery_failed(query_data, message); + + } else if (rc == 0) { + g_snprintf(message, sizeof(message), _("EOF while reading from resolver process")); + gaim_dnsquery_failed(query_data, message); + } + + handle_next_queued_request(); +} + +static gboolean +resolve_host(gpointer data) +{ + GaimDnsQueryData *query_data; + + query_data = data; + query_data->timeout = 0; + + handle_next_queued_request(); + + return FALSE; +} + +GaimDnsQueryData * +gaim_dnsquery_a(const char *hostname, int port, + GaimDnsQueryConnectFunction callback, gpointer data) +{ + GaimDnsQueryData *query_data; + + g_return_val_if_fail(hostname != NULL, NULL); + g_return_val_if_fail(port != 0, NULL); + + query_data = g_new(GaimDnsQueryData, 1); + query_data->hostname = g_strdup(hostname); + g_strstrip(query_data->hostname); + query_data->port = port; + query_data->callback = callback; + query_data->data = data; + query_data->resolver = NULL; + + if (!queued_requests) + queued_requests = g_queue_new(); + g_queue_push_tail(queued_requests, query_data); + + gaim_debug_info("dns", "DNS query for '%s' queued\n", query_data->hostname); + + query_data->timeout = gaim_timeout_add(0, resolve_host, query_data); + + return query_data; +} + +#elif defined _WIN32 /* end __unix__ || __APPLE__ */ + +/* + * Windows! + */ + +static gboolean dns_main_thread_cb(gpointer data) { GaimDnsQueryData *query_data; @@ -80,7 +605,7 @@ { GSList *hosts; - /* We don't want gaim_dns_query_resolved() to free hosts */ + /* We don't want gaim_dns_query_resolved() to free(hosts) */ hosts = query_data->hosts; query_data->hosts = NULL; gaim_dnsquery_resolved(query_data, hosts); @@ -89,17 +614,22 @@ return FALSE; } -#ifdef HAVE_GETADDRINFO static gpointer dns_thread(gpointer data) { GaimDnsQueryData *query_data; +#ifdef HAVE_GETADDRINFO int rc; struct addrinfo hints, *res, *tmp; char servname[20]; +#else + struct sockaddr_in sin; + struct hostent *hp; +#endif query_data = data; +#ifdef HAVE_GETADDRINFO g_snprintf(servname, sizeof(servname), "%d", query_data->port); memset(&hints,0,sizeof(hints)); @@ -124,13 +654,27 @@ } else { query_data->error_message = g_strdup_printf(_("Error resolving %s: %s"), query_data->hostname, gai_strerror(rc)); } +#else + if ((hp = gethostbyname(query_data->hostname))) { + memset(&sin, 0, sizeof(struct sockaddr_in)); + memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); + sin.sin_family = hp->h_addrtype; + sin.sin_port = htons(query_data->port); - /* We're done, tell the main thread to look at our results */ + query_data->hosts = g_slist_append(query_data->hosts, + GSIZE_TO_POINTER(sizeof(sin))); + query_data->hosts = g_slist_append(query_data->hosts, + g_memdup(&sin, sizeof(sin))); + } else { + query_data->error_message = g_strdup_printf(_("Error resolving %s: %d"), query_data->hostname, h_errno); + } +#endif + + /* back to main thread */ g_idle_add(dns_main_thread_cb, query_data); return 0; } -#endif static gboolean resolve_host(gpointer data) @@ -157,7 +701,6 @@ } else { -#ifdef HAVE_GETADDRINFO /* * Spin off a separate thread to perform the DNS lookup so * that we don't block the UI. @@ -172,34 +715,6 @@ g_error_free(err); gaim_dnsquery_failed(query_data, message); } -#else - struct sockaddr_in sin; - struct hostent *hp; - - /* - * gethostbyname() is not threadsafe, but gethostbyname_r() is a GNU - * extension. Unfortunately this means that we'll have to do a - * blocking DNS query for systems without GETADDRINFO. Fortunately - * this should be a very small number of systems. - */ - - if ((hp = gethostbyname(query_data->hostname))) { - memset(&sin, 0, sizeof(struct sockaddr_in)); - memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); - sin.sin_family = hp->h_addrtype; - sin.sin_port = htons(query_data->port); - - query_data->hosts = g_slist_append(query_data->hosts, - GSIZE_TO_POINTER(sizeof(sin))); - query_data->hosts = g_slist_append(query_data->hosts, - g_memdup(&sin, sizeof(sin))); - } else { - query_data->error_message = g_strdup_printf(_("Error resolving %s: %d"), query_data->hostname, h_errno); - } - - /* We're done! */ - dns_main_thread(query_data); -#endif } return FALSE; @@ -231,10 +746,85 @@ return query_data; } +#else /* not __unix__ or __APPLE__ or _WIN32 */ + +/* + * We weren't able to do anything fancier above, so use the + * fail-safe name resolution code, which is blocking. + */ + +static gboolean +resolve_host(gpointer data) +{ + GaimDnsQueryData *query_data; + struct sockaddr_in sin; + GSList *hosts = NULL; + + query_data = data; + query_data->timeout = 0; + + if (!inet_aton(query_data->hostname, &sin.sin_addr)) { + struct hostent *hp; + if(!(hp = gethostbyname(query_data->hostname))) { + char message[1024]; + g_snprintf(message, sizeof(message), _("Error resolving %s: %d"), + query_data->hostname, h_errno); + gaim_dnsquery_failed(query_data, message); + return FALSE; + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + memcpy(&sin.sin_addr.s_addr, hp->h_addr, hp->h_length); + sin.sin_family = hp->h_addrtype; + } else + sin.sin_family = AF_INET; + sin.sin_port = htons(query_data->port); + + hosts = g_slist_append(hosts, GINT_TO_POINTER(sizeof(sin))); + hosts = g_slist_append(hosts, g_memdup(&sin, sizeof(sin))); + + gaim_dnsquery_resolved(query_data, hosts); + + return FALSE; +} + +GaimDnsQueryData * +gaim_dnsquery_a(const char *hostname, int port, + GaimDnsQueryConnectFunction callback, gpointer data) +{ + GaimDnsQueryData *query_data; + + g_return_val_if_fail(hostname != NULL, NULL); + g_return_val_if_fail(port != 0, NULL); + + query_data = g_new(GaimDnsQueryData, 1); + query_data->hostname = g_strdup(hostname); + g_strstrip(query_data->hostname); + query_data->port = port; + query_data->callback = callback; + query_data->data = data; + + /* Don't call the callback before returning */ + query_data->timeout = gaim_timeout_add(0, resolve_host, query_data); + + return query_data; +} + +#endif /* not __unix__ or __APPLE__ or _WIN32 */ + void gaim_dnsquery_destroy(GaimDnsQueryData *query_data) { +#if defined(__unix__) || defined(__APPLE__) if (query_data->resolver != NULL) + /* + * Ideally we would tell our resolver child to stop resolving + * shit and then we would add it back to the free_dns_children + * linked list. However, it's hard to tell children stuff, + * they just don't listen. + */ + gaim_dnsquery_resolver_destroy(query_data->resolver); +#elif defined _WIN32 /* end __unix__ || __APPLE__ */ + if (query_data->resolver != NULL) { /* * It's not really possible to kill a thread. So instead we @@ -254,6 +844,7 @@ query_data->hosts = g_slist_remove(query_data->hosts, query_data->hosts->data); } g_free(query_data->error_message); +#endif if (query_data->timeout > 0) gaim_timeout_remove(query_data->timeout); @@ -265,11 +856,20 @@ void gaim_dnsquery_init(void) { +#ifdef _WIN32 if (!g_thread_supported()) g_thread_init(NULL); +#endif } void gaim_dnsquery_uninit(void) { +#if defined(__unix__) || defined(__APPLE__) + while (free_dns_children != NULL) + { + gaim_dnsquery_resolver_destroy(free_dns_children->data); + free_dns_children = g_slist_remove(free_dns_children, free_dns_children->data); + } +#endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-22 06:10:16
|
Revision: 16973 Author: mayuan2006 Date: 2006-08-21 23:10:01 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16973&view=rev Log Message: ----------- change the soap process to below: Post one Soap request After finish one soap request,close the connection, If there are more, reconect and process it. to avoid the below problem: in one socket, If post soap request one by one, The second will always read 0 bytes. comitted by Ma Yuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/contact.c branches/soc-2006-msnp13/src/protocols/msn/msg.c branches/soc-2006-msnp13/src/protocols/msn/msg.h branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/oim.c branches/soc-2006-msnp13/src/protocols/msn/soap.c branches/soc-2006-msnp13/src/protocols/msn/switchboard.c Modified: branches/soc-2006-msnp13/src/protocols/msn/contact.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/contact.c 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/contact.c 2006-08-22 06:10:01 UTC (rev 16973) @@ -179,8 +179,6 @@ } xmlnode_free(node); - - msn_get_address_book(contact); } static void @@ -197,6 +195,10 @@ // gaim_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf); msn_parse_contact_list(contact); + /*free the read buffer*/ + msn_soap_free_read_buf(soapconn); + + msn_get_address_book(contact); } static void @@ -420,6 +422,8 @@ // gaim_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf); msn_parse_addressbook(contact); + /*free the read buffer*/ + msn_soap_free_read_buf(soapconn); } /**/ Modified: branches/soc-2006-msnp13/src/protocols/msn/msg.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msg.c 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/msg.c 2006-08-22 06:10:01 UTC (rev 16973) @@ -206,7 +206,8 @@ void msn_message_parse_payload(MsnMessage *msg, - const char *payload, size_t payload_len) + const char *payload, size_t payload_len, + const char *line_dem,const char *body_dem) { char *tmp_base, *tmp; const char *content_type; @@ -219,7 +220,7 @@ memcpy(tmp_base, payload, payload_len); /* Parse the attributes. */ - end = strstr(tmp, "\r\n\r\n"); + end = strstr(tmp, body_dem); /* TODO? some clients use \r delimiters instead of \r\n, the official client * doesn't send such messages, but does handle receiving them. We'll just * avoid crashing for now */ @@ -229,7 +230,7 @@ } *end = '\0'; - elems = g_strsplit(tmp, "\r\n", 0); + elems = g_strsplit(tmp, line_dem, 0); for (cur = elems; *cur != NULL; cur++){ const char *key, *value; @@ -268,7 +269,7 @@ g_strfreev(elems); /* Proceed to the end of the "\r\n\r\n" */ - tmp = end + 4; + tmp = end + strlen(body_dem); /* Now we *should* be at the body. */ content_type = msn_message_get_content_type(msg); Modified: branches/soc-2006-msnp13/src/protocols/msn/msg.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msg.h 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/msg.h 2006-08-22 06:10:01 UTC (rev 16973) @@ -34,6 +34,12 @@ typedef void (*MsnMsgCb)(MsnMessage *, void *data); +#define MSG_BODY_DEM "\r\n\r\n" +#define MSG_LINE_DEM "\r\n" + +#define MSG_OIM_BODY_DEM "\n\n" +#define MSG_OIM_LINE_DEM "\n" + /* typedef enum { @@ -180,7 +186,8 @@ * @param payload_len The length of the payload. */ void msn_message_parse_payload(MsnMessage *msg, const char *payload, - size_t payload_len); + size_t payload_len, + const char *line_dem,const char *body_dem); /** * Destroys a message. Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-22 06:10:01 UTC (rev 16973) @@ -373,7 +373,7 @@ msg = msn_message_new_from_cmd(cmdproc->session, cmd); - msn_message_parse_payload(msg, payload, len); + msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM); #ifdef MSN_DEBUG_NS msn_message_show_readable(msg, "Notification", TRUE); #endif @@ -436,7 +436,7 @@ gaim_debug_info("MaYuan","Process UBM payload:%s\n",payload); msg = msn_message_new_from_cmd(cmdproc->session, cmd); - msn_message_parse_payload(msg, payload, len); + msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM); #ifdef MSN_DEBUG_NS msn_message_show_readable(msg, "Notification", TRUE); #endif Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-22 06:10:01 UTC (rev 16973) @@ -184,6 +184,37 @@ gaim_debug_info("MaYuan","oim get SOAP Server connected!\n"); } +void +msn_oim_report_to_user(MsnOim *oim,char *msg_str) +{ + MsnMessage *message; + char * end,*endline; + + message = msn_message_new(MSN_MSG_UNKNOWN); + + msn_message_parse_payload(message,msg_str,strlen(msg_str), + MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM); + gaim_debug_info("MaYuan","oim body:{%s}\n",message->body); +} + +void +msn_oim_process(MsnOim *oim,char *oim_msg) +{ + xmlnode *oimNode,*bodyNode,*responseNode,*msgNode; + char *msg_data,*msg_str; + + oimNode = xmlnode_from_str(oim_msg, strlen(oim_msg)); + bodyNode = xmlnode_get_child(oimNode,"Body"); +// gaim_debug_misc("xml","body{%p},name:%s\n",bodyNode,bodyNode->name); + responseNode = xmlnode_get_child(bodyNode,"GetMessageResponse"); + msgNode = xmlnode_get_child(responseNode,"GetMessageResult"); + msg_data = xmlnode_get_data(msgNode); + msg_str = g_strdup(msg_data); + gaim_debug_info("OIM","msg:{%s}\n",msg_str); + msn_oim_report_to_user(oim,msg_str); + g_free(msg_str); +} + static void msn_oim_get_read_cb(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond) @@ -194,9 +225,11 @@ gaim_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body); /*we need to process the read message!*/ + msn_oim_process(oim,soapconn->body); + msn_soap_free_read_buf(soapconn); /*get next single Offline Message*/ // oim->oim_list = g_list_remove(oim->oim_list, oim->oim_list->data); - msn_soap_post_head_request(soapconn); + msn_soap_post(soapconn,NULL,msn_oim_retrieve_connect_init); } static void Modified: branches/soc-2006-msnp13/src/protocols/msn/soap.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-22 06:10:01 UTC (rev 16973) @@ -345,19 +345,22 @@ /*remove the read handler*/ gaim_input_remove(soapconn->input_handler); soapconn->input_handler = -1; + /* + * close the soap connection,if more soap request came, + * Just reconnect to do it, + * + * To solve the problem described below: + * When I post the soap request in one socket one after the other, + * The first read is ok, But the second soap read always got 0 bytes, + * Weird! + * */ + msn_soap_close(soapconn); #endif /*call the read callback*/ if(soapconn->read_cb != NULL){ soapconn->read_cb(soapconn,source,0); } - /*clear the read buffer*/ - msn_soap_free_read_buf(soapconn); -#if 1 -// msn_soap_close(soapconn); -#endif - /*Process the next queued SOAP request*/ -// msn_soap_post_head_request(soapconn); } return; } @@ -510,9 +513,12 @@ msn_soap_post(MsnSoapConn *soapconn,MsnSoapReq *request, MsnSoapConnectInitFunction msn_soap_init_func) { - g_queue_push_tail(soapconn->soap_queue, request); - if(!msn_soap_connected(soapconn)&&(soapconn->step == MSN_SOAP_UNCONNECTED)){ - /*not connected?connect it first*/ + if(request != NULL){ + g_queue_push_tail(soapconn->soap_queue, request); + } + if(!msn_soap_connected(soapconn)&&(soapconn->step == MSN_SOAP_UNCONNECTED) + &&(!g_queue_is_empty(soapconn->soap_queue))){ + /*not connected?and we have something to process connect it first*/ gaim_debug_info("Ma Yuan","soap is not connected!\n"); msn_soap_init_func(soapconn); msn_soap_connect(soapconn); Modified: branches/soc-2006-msnp13/src/protocols/msn/switchboard.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/switchboard.c 2006-08-22 05:52:03 UTC (rev 16972) +++ branches/soc-2006-msnp13/src/protocols/msn/switchboard.c 2006-08-22 06:10:01 UTC (rev 16973) @@ -721,7 +721,8 @@ msg = msn_message_new_from_cmd(cmdproc->session, cmd); - msn_message_parse_payload(msg, payload, len); + msn_message_parse_payload(msg, payload, len, + MSG_LINE_DEM,MSG_BODY_DEM); #ifdef MSN_DEBUG_SB msn_message_show_readable(msg, "SB RECV", FALSE); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-22 05:52:11
|
Revision: 16972 Author: marv_sf Date: 2006-08-21 22:52:03 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16972&view=rev Log Message: ----------- iirc, you shouldn't call the functions in prefix.h directly as they might not exist. also add DATADIR to Makefile.am so EvilDennisR can find something else to complain about. Modified Paths: -------------- trunk/libgaim/protocols/qq/Makefile.am trunk/libgaim/protocols/qq/qq.c Modified: trunk/libgaim/protocols/qq/Makefile.am =================================================================== --- trunk/libgaim/protocols/qq/Makefile.am 2006-08-22 05:30:30 UTC (rev 16971) +++ trunk/libgaim/protocols/qq/Makefile.am 2006-08-22 05:52:03 UTC (rev 16972) @@ -92,7 +92,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libgaim \ - -DVERSION=\"$(VERSION)\" \ - $(DEBUG_CFLAGS) \ - $(GLIB_CFLAGS) \ + -DVERSION=\"$(VERSION)\" \ + -DDATADIR=\"$(datadir)\" \ + $(DEBUG_CFLAGS) \ + $(GLIB_CFLAGS) \ $(GAIM_CFLAGS) Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-08-22 05:30:30 UTC (rev 16971) +++ trunk/libgaim/protocols/qq/qq.c 2006-08-22 05:52:03 UTC (rev 16972) @@ -431,12 +431,11 @@ GaimRequestField *field; struct stat img_stat; FILE *file; - gchar *filename, *prefix, *img_data, *face; + gchar *filename, *img_data, *face; gint size; face = g_strdup_printf("qq_%i.png", face_num); - prefix = br_extract_prefix(DATADIR); - filename = g_build_filename(prefix, "share","pixmaps", + filename = g_build_filename(DATADIR, "pixmaps", "gaim","status","default", face, NULL); g_free(face); face = g_strdup_printf("%i", face_num); @@ -453,7 +452,6 @@ fclose(file); } g_free(face); - g_free(prefix); } /* Change your status icon (face) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |