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: <the...@us...> - 2006-07-06 09:22:03
|
Revision: 16445 Author: thekingant Date: 2006-07-06 02:21:57 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16445&view=rev Log Message: ----------- Fix a crash bug on some systems (mostly amd64) caused by using a va_list twice. My bad! Thanks to Kevin Stange and Vincent Ho for noticing this and suggesting the cause. Vincent's IRC handle reminds me of a Harvey Danger song. Modified Paths: -------------- trunk/src/debug.c trunk/src/debug.h trunk/src/gtkdebug.c Modified: trunk/src/debug.c =================================================================== --- trunk/src/debug.c 2006-07-06 09:15:56 UTC (rev 16444) +++ trunk/src/debug.c 2006-07-06 09:21:57 UTC (rev 16445) @@ -46,15 +46,21 @@ const char *format, va_list args) { GaimDebugUiOps *ops; + char *arg_s = NULL; g_return_if_fail(level != GAIM_DEBUG_ALL); g_return_if_fail(format != NULL); + ops = gaim_debug_get_ui_ops(); + + if (!debug_enabled && ((ops == NULL) || (ops->print == NULL))) + return; + + arg_s = g_strdup_vprintf(format, args); + if (debug_enabled) { - gchar *arg_s, *ts_s; + gchar *ts_s; - arg_s = g_strdup_vprintf(format, args); - if ((category != NULL) && (gaim_prefs_exists("/core/debug/timestamps")) && (gaim_prefs_get_bool("/core/debug/timestamps"))) { @@ -72,14 +78,13 @@ else g_print("%s%s: %s", ts_s, category, arg_s); - g_free(arg_s); g_free(ts_s); } - ops = gaim_debug_get_ui_ops(); + if (ops != NULL && ops->print != NULL) + ops->print(level, category, arg_s); - if (ops != NULL && ops->print != NULL) - ops->print(level, category, format, args); + g_free(arg_s); } void Modified: trunk/src/debug.h =================================================================== --- trunk/src/debug.h 2006-07-06 09:15:56 UTC (rev 16444) +++ trunk/src/debug.h 2006-07-06 09:21:57 UTC (rev 16445) @@ -48,7 +48,7 @@ typedef struct { void (*print)(GaimDebugLevel level, const char *category, - const char *format, va_list args); + const char *arg_s); } GaimDebugUiOps; #ifdef __cplusplus Modified: trunk/src/gtkdebug.c =================================================================== --- trunk/src/gtkdebug.c 2006-07-06 09:15:56 UTC (rev 16444) +++ trunk/src/gtkdebug.c 2006-07-06 09:21:57 UTC (rev 16445) @@ -931,13 +931,13 @@ static void gaim_gtk_debug_print(GaimDebugLevel level, const char *category, - const char *format, va_list args) + const char *arg_s) { #ifdef HAVE_REGEX_H GtkTreeIter iter; #endif /* HAVE_REGEX_H */ gboolean timestamps; - gchar *arg_s, *ts_s; + gchar *ts_s; gchar *esc_s, *cat_s, *tmp, *s; if (!gaim_prefs_get_bool("/gaim/gtk/debug/enabled") || @@ -948,8 +948,6 @@ timestamps = gaim_prefs_get_bool("/core/debug/timestamps"); - arg_s = g_strdup_vprintf(format, args); - /* * For some reason we only print the timestamp if category is * not NULL. Why the hell do we do that? --Mark @@ -971,8 +969,6 @@ esc_s = g_markup_escape_text(arg_s, -1); - g_free(arg_s); - s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>", debug_fg_colors[level], ts_s, cat_s, esc_s); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 09:16:07
|
Revision: 16444 Author: thekingant Date: 2006-07-06 02:15:56 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16444&view=rev Log Message: ----------- Backport SVN revision #16438 from HEAD to v2_0_0 Some minor RPM specfile improvements ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16438&view=rev Modified Paths: -------------- branches/v2_0_0/gaim.spec.in Modified: branches/v2_0_0/gaim.spec.in =================================================================== --- branches/v2_0_0/gaim.spec.in 2006-07-06 08:24:47 UTC (rev 16443) +++ branches/v2_0_0/gaim.spec.in 2006-07-06 09:15:56 UTC (rev 16444) @@ -6,10 +6,10 @@ # When not doing betas comment this out # NOTE: %defines in spec files are evaluated in comments so the correct # way to comment it out is to replace the % with # -%define beta 3 +%define beta 4 %if 0%{?beta} -%define gaimver %(echo "@VERSION@"|sed -e 's/svn//; s/beta.*//') +%define gaimver %(echo "@VERSION@"|sed -e 's/dev//; s/beta.*//') %else %define gaimver @VERSION@ %endif @@ -28,7 +28,7 @@ # Generic build requirements BuildRequires: libtool, pkgconfig, libao-devel, audiofile-devel, intltool, gettext -%{?_with_avahi:BuildRequires: avahi-devel} +%{?_with_avahi:BuildRequires: avahi-compat-howl avahi-compat-howl-devel} %{?_with_howl:BuildRequires: howl-devel} %{?_with_silc:BuildRequires: /usr/include/silc/silcclient.h} %{?_with_meanwhile:BuildRequires: meanwhile-devel} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 08:24:50
|
Revision: 16443 Author: thekingant Date: 2006-07-06 01:24:47 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16443&view=rev Log Message: ----------- Backport SVN revision 16442 from HEAD to v2_0_0 Original commit message: It is currently possible for yourself to not show up in your own buddy list at signon with Jabber. To reproduce: 1. Sign on and add yourself to your buddy list 2. Sign off and exit Gaim 3. Delete your blist.xml 4. Sign on The same bug would also appear when signing into your Jabber account using Gaim for the first time. Normally this works because the Jabber PRPL fakes showing your status whenever jabber_presence_send() is called. However, the call to jabber_presence_send() can happen BEFORE we receive the roster from the server (it usually does, I think) so the PRPL tries to set the status for yourself, but your GaimBuddy node doesn't exist yet. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16442&view=rev Modified Paths: -------------- branches/v2_0_0/src/protocols/jabber/roster.c Modified: branches/v2_0_0/src/protocols/jabber/roster.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/roster.c 2006-07-06 08:24:26 UTC (rev 16442) +++ branches/v2_0_0/src/protocols/jabber/roster.c 2006-07-06 08:24:47 UTC (rev 16443) @@ -56,6 +56,7 @@ const char *alias, GSList *groups) { GSList *buddies, *g2, *l; + gchar *my_bare_jid; buddies = gaim_find_buddies(js->gc->account, jid); @@ -68,6 +69,8 @@ return; } + my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); + while(buddies) { GaimBuddy *b = buddies->data; GaimGroup *g = gaim_buddy_get_group(b); @@ -100,10 +103,27 @@ gaim_blist_add_buddy(b, NULL, g, NULL); gaim_blist_alias_buddy(b, alias); + + + /* If we just learned about ourself, then fake our status, + * because we won't be receiving a normal presence message + * about ourself. */ + if(!strcmp(b->name, my_bare_jid)) { + GaimPresence *gpresence; + GaimStatus *status; + + gpresence = gaim_account_get_presence(js->gc->account); + status = gaim_presence_get_active_status(gpresence); + jabber_presence_fake_to_self(js, status); + } + + + g_free(g2->data); g2 = g_slist_delete_link(g2, g2); } + g_free(my_bare_jid); g_slist_free(buddies); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 08:24:29
|
Revision: 16442 Author: thekingant Date: 2006-07-06 01:24:26 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16442&view=rev Log Message: ----------- It is currently possible for yourself to not show up in your own buddy list at signon with Jabber. To reproduce: 1. Sign on and add yourself to your buddy list 2. Sign off and exit Gaim 3. Delete your blist.xml 4. Sign on The same bug would also appear when signing into your Jabber account using Gaim for the first time. Normally this works because the Jabber PRPL fakes showing your status whenever jabber_presence_send() is called. However, the call to jabber_presence_send() can happen BEFORE we receive the roster from the server (it usually does, I think) so the PRPL tries to set the status for yourself, but your GaimBuddy node doesn't exist yet. Modified Paths: -------------- trunk/src/protocols/jabber/roster.c Modified: trunk/src/protocols/jabber/roster.c =================================================================== --- trunk/src/protocols/jabber/roster.c 2006-07-06 08:11:47 UTC (rev 16441) +++ trunk/src/protocols/jabber/roster.c 2006-07-06 08:24:26 UTC (rev 16442) @@ -56,6 +56,7 @@ const char *alias, GSList *groups) { GSList *buddies, *g2, *l; + gchar *my_bare_jid; buddies = gaim_find_buddies(js->gc->account, jid); @@ -68,6 +69,8 @@ return; } + my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); + while(buddies) { GaimBuddy *b = buddies->data; GaimGroup *g = gaim_buddy_get_group(b); @@ -100,10 +103,27 @@ gaim_blist_add_buddy(b, NULL, g, NULL); gaim_blist_alias_buddy(b, alias); + + + /* If we just learned about ourself, then fake our status, + * because we won't be receiving a normal presence message + * about ourself. */ + if(!strcmp(b->name, my_bare_jid)) { + GaimPresence *gpresence; + GaimStatus *status; + + gpresence = gaim_account_get_presence(js->gc->account); + status = gaim_presence_get_active_status(gpresence); + jabber_presence_fake_to_self(js, status); + } + + + g_free(g2->data); g2 = g_slist_delete_link(g2, g2); } + g_free(my_bare_jid); g_slist_free(buddies); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 08:11:53
|
Revision: 16441 Author: thekingant Date: 2006-07-06 01:11:47 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16441&view=rev Log Message: ----------- Minor odds and ends Modified Paths: -------------- branches/v2_0_0/plugins/ssl/ssl-gnutls.c branches/v2_0_0/src/conversation.c branches/v2_0_0/src/gtkprefs.c branches/v2_0_0/src/server.c branches/v2_0_0/src/util.c Modified: branches/v2_0_0/plugins/ssl/ssl-gnutls.c =================================================================== --- branches/v2_0_0/plugins/ssl/ssl-gnutls.c 2006-07-06 08:11:41 UTC (rev 16440) +++ branches/v2_0_0/plugins/ssl/ssl-gnutls.c 2006-07-06 08:11:47 UTC (rev 16441) @@ -106,6 +106,11 @@ GaimSslGnutlsData *gnutls_data; static const int cert_type_priority[2] = { GNUTLS_CRT_X509, 0 }; + /* + * TODO: Uh, this needs to somehow check to make sure that gsc is + * still valid before actually doing anything. + */ + if(source < 0) { if(gsc->error_cb != NULL) gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data); Modified: branches/v2_0_0/src/conversation.c =================================================================== --- branches/v2_0_0/src/conversation.c 2006-07-06 08:11:41 UTC (rev 16440) +++ branches/v2_0_0/src/conversation.c 2006-07-06 08:11:47 UTC (rev 16441) @@ -57,9 +57,6 @@ gaim_conv_im_update_typing(im); gaim_conv_im_stop_typing_timeout(im); - gaim_signal_emit(gaim_conversations_get_handle(), - "buddy-typing-stopped", c->account, c->name); - return FALSE; } Modified: branches/v2_0_0/src/gtkprefs.c =================================================================== --- branches/v2_0_0/src/gtkprefs.c 2006-07-06 08:11:41 UTC (rev 16440) +++ branches/v2_0_0/src/gtkprefs.c 2006-07-06 08:11:47 UTC (rev 16441) @@ -1818,7 +1818,7 @@ } /* Signon status stuff */ - vbox = gaim_gtk_make_frame(ret, _("Status at startup")); + vbox = gaim_gtk_make_frame(ret, _("Status at Startup")); button = gaim_gtk_prefs_checkbox(_("Use status from last _exit at startup"), "/core/savedstatus/startup_current_status", vbox); Modified: branches/v2_0_0/src/server.c =================================================================== --- branches/v2_0_0/src/server.c 2006-07-06 08:11:41 UTC (rev 16440) +++ branches/v2_0_0/src/server.c 2006-07-06 08:11:47 UTC (rev 16441) @@ -621,9 +621,6 @@ gaim_signal_emit(gaim_conversations_get_handle(), "buddy-typing-stopped", gc->account, name); } - - gaim_signal_emit(gaim_conversations_get_handle(), - "buddy-typing-stopped", gc->account, name); } struct chat_invite_data { Modified: branches/v2_0_0/src/util.c =================================================================== --- branches/v2_0_0/src/util.c 2006-07-06 08:11:41 UTC (rev 16440) +++ branches/v2_0_0/src/util.c 2006-07-06 08:11:47 UTC (rev 16441) @@ -2521,7 +2521,7 @@ } } else { gaim_debug(GAIM_DEBUG_ERROR, "gaim_mkstemp", - "g_get_tmp_dir() failed!"); + "g_get_tmp_dir() failed!\n"); } return fp; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 08:11:44
|
Revision: 16440 Author: thekingant Date: 2006-07-06 01:11:41 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16440&view=rev Log Message: ----------- Minor odds and ends Modified Paths: -------------- trunk/src/gtkprefs.c Modified: trunk/src/gtkprefs.c =================================================================== --- trunk/src/gtkprefs.c 2006-07-06 08:11:08 UTC (rev 16439) +++ trunk/src/gtkprefs.c 2006-07-06 08:11:41 UTC (rev 16440) @@ -1818,7 +1818,7 @@ } /* Signon status stuff */ - vbox = gaim_gtk_make_frame(ret, _("Status at startup")); + vbox = gaim_gtk_make_frame(ret, _("Status at Startup")); button = gaim_gtk_prefs_checkbox(_("Use status from last _exit at startup"), "/core/savedstatus/startup_current_status", vbox); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 08:11:13
|
Revision: 16439 Author: thekingant Date: 2006-07-06 01:11:08 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16439&view=rev Log Message: ----------- Minor odds and ends Modified Paths: -------------- trunk/plugins/ssl/ssl-gnutls.c trunk/src/conversation.c trunk/src/server.c trunk/src/util.c Modified: trunk/plugins/ssl/ssl-gnutls.c =================================================================== --- trunk/plugins/ssl/ssl-gnutls.c 2006-07-06 08:01:36 UTC (rev 16438) +++ trunk/plugins/ssl/ssl-gnutls.c 2006-07-06 08:11:08 UTC (rev 16439) @@ -106,6 +106,11 @@ GaimSslGnutlsData *gnutls_data; static const int cert_type_priority[2] = { GNUTLS_CRT_X509, 0 }; + /* + * TODO: Uh, this needs to somehow check to make sure that gsc is + * still valid before actually doing anything. + */ + if(source < 0) { if(gsc->error_cb != NULL) gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data); Modified: trunk/src/conversation.c =================================================================== --- trunk/src/conversation.c 2006-07-06 08:01:36 UTC (rev 16438) +++ trunk/src/conversation.c 2006-07-06 08:11:08 UTC (rev 16439) @@ -57,9 +57,6 @@ gaim_conv_im_update_typing(im); gaim_conv_im_stop_typing_timeout(im); - gaim_signal_emit(gaim_conversations_get_handle(), - "buddy-typing-stopped", c->account, c->name); - return FALSE; } Modified: trunk/src/server.c =================================================================== --- trunk/src/server.c 2006-07-06 08:01:36 UTC (rev 16438) +++ trunk/src/server.c 2006-07-06 08:11:08 UTC (rev 16439) @@ -621,9 +621,6 @@ gaim_signal_emit(gaim_conversations_get_handle(), "buddy-typing-stopped", gc->account, name); } - - gaim_signal_emit(gaim_conversations_get_handle(), - "buddy-typing-stopped", gc->account, name); } struct chat_invite_data { Modified: trunk/src/util.c =================================================================== --- trunk/src/util.c 2006-07-06 08:01:36 UTC (rev 16438) +++ trunk/src/util.c 2006-07-06 08:11:08 UTC (rev 16439) @@ -2521,7 +2521,7 @@ } } else { gaim_debug(GAIM_DEBUG_ERROR, "gaim_mkstemp", - "g_get_tmp_dir() failed!"); + "g_get_tmp_dir() failed!\n"); } return fp; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 08:01:37
|
Revision: 16438 Author: thekingant Date: 2006-07-06 01:01:36 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16438&view=rev Log Message: ----------- I think these changes make sense? Maybe? Modified Paths: -------------- trunk/gaim.spec.in Modified: trunk/gaim.spec.in =================================================================== --- trunk/gaim.spec.in 2006-07-06 02:52:10 UTC (rev 16437) +++ trunk/gaim.spec.in 2006-07-06 08:01:36 UTC (rev 16438) @@ -6,10 +6,10 @@ # When not doing betas comment this out # NOTE: %defines in spec files are evaluated in comments so the correct # way to comment it out is to replace the % with # -%define beta 3 +%define beta 4 %if 0%{?beta} -%define gaimver %(echo "@VERSION@"|sed -e 's/svn//; s/beta.*//') +%define gaimver %(echo "@VERSION@"|sed -e 's/dev//; s/beta.*//') %else %define gaimver @VERSION@ %endif @@ -28,7 +28,7 @@ # Generic build requirements BuildRequires: libtool, pkgconfig, libao-devel, audiofile-devel, intltool, gettext -%{?_with_avahi:BuildRequires: avahi-devel} +%{?_with_avahi:BuildRequires: avahi-compat-howl avahi-compat-howl-devel} %{?_with_howl:BuildRequires: howl-devel} %{?_with_silc:BuildRequires: /usr/include/silc/silcclient.h} %{?_with_meanwhile:BuildRequires: meanwhile-devel} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-06 02:52:22
|
Revision: 16437 Author: roast Date: 2006-07-05 19:52:10 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16437&view=rev Log Message: ----------- xml|html|txt_logger_read uses GIOChannels 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-07-06 02:40:39 UTC (rev 16436) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-06 02:52:10 UTC (rev 16437) @@ -1193,16 +1193,29 @@ { char *read; GaimLogCommonLoggerData *data = log->logger_data; + int filedes = 0; + GIOChannel *channel; + *flags = GAIM_LOG_READ_NO_NEWLINE; + if (!data || !data->path) return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>")); - if (g_file_get_contents(data->path, &read, NULL, NULL)) { - gboolean bad_formatting; - char *processed; - bad_formatting = gaim_ufl_to_xhtml(read, &processed); + if ((filedes = open(data->path, O_RDONLY))) { + channel = g_io_channel_unix_new(filedes); + + if (g_io_channel_read_to_end(channel, &read, NULL, NULL) != G_IO_STATUS_ERROR) { + gboolean bad_formatting; + char *processed; + + bad_formatting = gaim_ufl_to_xhtml(read, &processed); + + g_io_channel_shutdown(channel, FALSE, NULL); + close(filedes); + return processed; + } - return processed; + close(filedes); } return g_strdup_printf(_("<font color=\"red\"><b>Could not read file: %s</b></font>"), data->path); @@ -1379,19 +1392,30 @@ { char *read; GaimLogCommonLoggerData *data = log->logger_data; + int filedes = 0; + GIOChannel *channel; + *flags = GAIM_LOG_READ_NO_NEWLINE; if (!data || !data->path) return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>")); - if (g_file_get_contents(data->path, &read, NULL, NULL)) { - char *minus_header = strchr(read, '\n'); - if (!minus_header) - return read; + if ((filedes = open(data->path, O_RDONLY))) { + channel = g_io_channel_unix_new(filedes); - minus_header = g_strdup(minus_header + 1); - g_free(read); + if (g_io_channel_read_to_end(channel, &read, NULL, NULL) != G_IO_STATUS_ERROR) { + char *minus_header = strchr(read, '\n'); - return minus_header; + if (!minus_header) + return read; + + minus_header = g_strdup(minus_header + 1); + g_free(read); + + g_io_channel_shutdown(channel, FALSE, NULL); + close(filedes); + return minus_header; + } + close(filedes); } return g_strdup_printf(_("<font color=\"red\"><b>Could not read file: %s</b></font>"), data->path); } @@ -1539,21 +1563,34 @@ { char *read, *minus_header, *minus_header2; GaimLogCommonLoggerData *data = log->logger_data; + int filedes = 0; + GIOChannel *channel; + *flags = 0; + if (!data || !data->path) return g_strdup(_("<font color=\"red\"><b>Unable to find log path!</b></font>")); - if (g_file_get_contents(data->path, &read, NULL, NULL)) { - minus_header = strchr(read, '\n'); - if (!minus_header) - minus_header = g_strdup(read); - else - minus_header = g_strdup(minus_header + 1); - g_free(read); - minus_header2 = g_markup_escape_text(minus_header, -1); - g_free(minus_header); - read = gaim_markup_linkify(minus_header2); - g_free(minus_header2); - return read; + + if ((filedes = open(data->path, O_RDONLY))) { + channel = g_io_channel_unix_new(filedes); + + if (g_io_channel_read_to_end(channel, &read, NULL, NULL) != G_IO_STATUS_ERROR) { + minus_header = strchr(read, '\n'); + if (!minus_header) + minus_header = g_strdup(read); + else + minus_header = g_strdup(minus_header + 1); + g_free(read); + minus_header2 = g_markup_escape_text(minus_header, -1); + g_free(minus_header); + read = gaim_markup_linkify(minus_header2); + g_free(minus_header2); + + g_io_channel_shutdown(channel, FALSE, NULL); + close(filedes); + return read; + } + close(filedes); } return g_strdup_printf(_("<font color=\"red\"><b>Could not read file: %s</b></font>"), data->path); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-07-06 00:42:48
|
Revision: 16435 Author: aaronsheldon Date: 2006-07-05 17:42:42 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16435&view=rev Log Message: ----------- Removed comment that I should check something later. It is 5 minutes past later. Modified Paths: -------------- branches/soc-2006-chat-speed/src/conversation.c Modified: branches/soc-2006-chat-speed/src/conversation.c =================================================================== --- branches/soc-2006-chat-speed/src/conversation.c 2006-07-06 00:32:38 UTC (rev 16434) +++ branches/soc-2006-chat-speed/src/conversation.c 2006-07-06 00:42:42 UTC (rev 16435) @@ -1610,7 +1610,6 @@ g_return_if_fail(prpl_info != NULL); flags = gaim_conv_chat_user_get_flags(chat, old_user); - /* Check this later - F.P. */ cb = gaim_conv_chat_cb_new(new_user, NULL, flags); gaim_conv_chat_set_users(chat, g_list_prepend(gaim_conv_chat_get_users(chat), cb)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-07-06 00:32:45
|
Revision: 16434 Author: aaronsheldon Date: 2006-07-05 17:32:38 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16434&view=rev Log Message: ----------- A group is a chat's parent, not a chat's grandparent. (Thanks, Sadrul). Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-07-05 23:55:22 UTC (rev 16433) +++ trunk/src/gtkblist.c 2006-07-06 00:32:38 UTC (rev 16434) @@ -4110,9 +4110,9 @@ if (GAIM_BLIST_NODE_IS_GROUP(node)) gnode = node; - else if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CHAT(node)) + else if (GAIM_BLIST_NODE_IS_BUDDY(node)) gnode = node->parent->parent; - else if (GAIM_BLIST_NODE_IS_CONTACT(node)) + else if (GAIM_BLIST_NODE_IS_CONTACT(node) || GAIM_BLIST_NODE_IS_CHAT(node)) gnode = node->parent; else return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-07-05 17:42:12
|
Revision: 16432 Author: aaronsheldon Date: 2006-07-05 10:41:37 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16432&view=rev Log Message: ----------- Fixes potential segfaults. Modified Paths: -------------- trunk/src/gtkblist.c Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-07-05 00:42:58 UTC (rev 16431) +++ trunk/src/gtkblist.c 2006-07-05 17:41:37 UTC (rev 16432) @@ -4106,14 +4106,16 @@ gboolean show = FALSE; GaimBlistNode* gnode; + g_return_if_fail(node != NULL); if (GAIM_BLIST_NODE_IS_GROUP(node)) gnode = node; - else if (GAIM_BLIST_NODE_IS_BUDDY(node)) /* maybe OR'ed with IS_CHAT? */ + else if (GAIM_BLIST_NODE_IS_BUDDY(node) || GAIM_BLIST_NODE_IS_CHAT(node)) gnode = node->parent->parent; else if (GAIM_BLIST_NODE_IS_CONTACT(node)) gnode = node->parent; - g_return_if_fail(GAIM_BLIST_NODE_IS_GROUP(gnode)); + else + return; group = (GaimGroup*)gnode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-05 00:43:02
|
Revision: 16431 Author: roast Date: 2006-07-04 17:42:58 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16431&view=rev Log Message: ----------- reverted 16428/g_free() tests for null arguments. removed txt_logger's g_free check 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-07-05 00:09:56 UTC (rev 16430) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-05 00:42:58 UTC (rev 16431) @@ -1178,9 +1178,7 @@ } - - if (data->path) - g_free(data->path); + g_free(data->path); g_slice_free(GaimLogCommonLoggerData, data); } @@ -1361,10 +1359,8 @@ } } + g_free(data->path); - if (data->path) - g_free(data->path); - g_slice_free(GaimLogCommonLoggerData, data); } } @@ -1523,8 +1519,7 @@ } } - if(data->path) - g_free(data->path); + g_free(data->path); g_slice_free(GaimLogCommonLoggerData, data); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-05 00:10:01
|
Revision: 16430 Author: sadrul Date: 2006-07-04 17:09:56 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16430&view=rev Log Message: ----------- Remove some warnings, and make sure the window in focus is always on top of all other windows. Modified Paths: -------------- trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-04 23:45:59 UTC (rev 16429) +++ trunk/console/libgnt/gntmain.c 2006-07-05 00:09:56 UTC (rev 16430) @@ -47,6 +47,7 @@ static void free_node(gpointer data); static void draw_taskbar(); +static void bring_on_top(GntWidget *widget); void gnt_screen_take_focus(GntWidget *widget) { @@ -88,8 +89,7 @@ if (focus_list) { - gnt_widget_set_focus(focus_list->data, TRUE); - gnt_widget_draw(focus_list->data); + bring_on_top(focus_list->data); } draw_taskbar(); } @@ -98,7 +98,6 @@ bring_on_top(GntWidget *widget) { GntNode *node = g_hash_table_lookup(nodes, widget); - GList *iter; g_return_if_fail(focus_list->data == widget); @@ -124,7 +123,7 @@ { static WINDOW *taskbar = NULL; GList *iter; - int n, width; + int n, width = 0; int i; if (taskbar == NULL) @@ -204,7 +203,7 @@ window_list_activate(GntTree *tree, gpointer null) { GntWidget *widget = gnt_tree_get_selection_data(GNT_TREE(tree)); - GntWidget *old; + GntWidget *old = NULL; if (focus_list) old = focus_list->data; @@ -218,15 +217,14 @@ } } -static GntWidget * +static void show_window_list() { GntWidget *tree, *win; GList *iter; - int id; if (window_list.window) - return window_list.window; + return; win = window_list.window = gnt_box_new(FALSE, FALSE); gnt_box_set_toplevel(GNT_BOX(win), TRUE); @@ -497,8 +495,6 @@ void gnt_screen_release(GntWidget *widget) { - WINDOW *win; - GList *iter; GntNode *node; gnt_screen_remove_widget(widget); @@ -520,8 +516,6 @@ void gnt_screen_update(GntWidget *widget) { - GList *iter; - WINDOW *win; GntNode *node; if (widget->parent) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-07-04 23:46:06
|
Revision: 16429 Author: aaronsheldon Date: 2006-07-04 16:45:59 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16429&view=rev Log Message: ----------- Mass code cleanup. Should be good enough to use now. Dramatic speedups in large room joins. Modified Paths: -------------- branches/soc-2006-chat-speed/src/conversation.c branches/soc-2006-chat-speed/src/conversation.h branches/soc-2006-chat-speed/src/gtkconv.c Modified: branches/soc-2006-chat-speed/src/conversation.c =================================================================== --- branches/soc-2006-chat-speed/src/conversation.c 2006-07-04 23:15:43 UTC (rev 16428) +++ branches/soc-2006-chat-speed/src/conversation.c 2006-07-04 23:45:59 UTC (rev 16429) @@ -39,8 +39,6 @@ static GaimConversationUiOps *default_ops = NULL; int gaim_conv_chat_cb_compare(GaimConvChatBuddy *a, GaimConvChatBuddy *b); -GaimConvChatBuddy *gaim_conv_chat_cb_new2(const char *name, const char *alias, - GaimConvChatBuddyFlags flags); void gaim_conversations_set_ui_ops(GaimConversationUiOps *ops) @@ -1480,8 +1478,8 @@ GaimConvChatBuddyFlags flags = GPOINTER_TO_INT(fl->data); const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL); - cbuddy = gaim_conv_chat_cb_new(user, GPOINTER_TO_INT(fl->data)); - + cbuddy = gaim_conv_chat_cb_new(user, NULL, GPOINTER_TO_INT(fl->data)); + if (!strcmp(chat->nick, gaim_normalize(conv->account, user))) { const char *alias2 = gaim_account_get_alias(conv->account); if (alias2 != NULL) @@ -1502,7 +1500,7 @@ "chat-buddy-joining", conv, user, flags)) | gaim_conv_chat_is_user_ignored(chat, user); - cb = gaim_conv_chat_cb_new(user, flags); + cb = gaim_conv_chat_cb_new(user, NULL, flags); /* This seems dumb. Why should we set users thousands of times? */ gaim_conv_chat_set_users(chat, g_list_prepend(gaim_conv_chat_get_users(chat), cb)); @@ -1540,13 +1538,13 @@ cbuddies = g_list_sort(cbuddies, (GCompareFunc)gaim_conv_chat_cb_compare); - if (ops != NULL && ops->chat_add_users2 != NULL) - ops->chat_add_users2(conv, cbuddies, new_arrivals); - + if (ops != NULL && ops->chat_add_users != NULL) + ops->chat_add_users(conv, cbuddies, new_arrivals); + } - -int gaim_conv_chat_cb_compare(GaimConvChatBuddy *a, GaimConvChatBuddy *b) +int +gaim_conv_chat_cb_compare(GaimConvChatBuddy *a, GaimConvChatBuddy *b) { GaimConvChatBuddyFlags f1 = 0, f2 = 0; char *user1 = NULL, *user2 = NULL; @@ -1569,18 +1567,6 @@ user2 = b->name; } - /* - gtk_tree_model_get(model, a, - CHAT_USERS_ALIAS_KEY_COLUMN, &user1, - CHAT_USERS_FLAGS_COLUMN, &f1, - CHAT_USERS_BUDDY_COLUMN, &buddy1, - -1); - gtk_tree_model_get(model, b, - CHAT_USERS_ALIAS_KEY_COLUMN, &user2, - CHAT_USERS_FLAGS_COLUMN, &f2, - CHAT_USERS_BUDDY_COLUMN, &buddy2, - -1);*/ - if (user1 == NULL || user2 == NULL) { if (!(user1 == NULL && user2 == NULL)) ret = (user1 == NULL) ? -1: 1; @@ -1625,7 +1611,7 @@ flags = gaim_conv_chat_user_get_flags(chat, old_user); /* Check this later - F.P. */ - cb = gaim_conv_chat_cb_new(new_user, flags); + cb = gaim_conv_chat_cb_new(new_user, NULL, flags); gaim_conv_chat_set_users(chat, g_list_prepend(gaim_conv_chat_get_users(chat), cb)); @@ -1936,9 +1922,8 @@ return chat->left; } - GaimConvChatBuddy * -gaim_conv_chat_cb_new(const char *name, GaimConvChatBuddyFlags flags) +gaim_conv_chat_cb_new(const char *name, const char *alias, GaimConvChatBuddyFlags flags) { GaimConvChatBuddy *cb; @@ -1947,26 +1932,10 @@ cb = g_new0(GaimConvChatBuddy, 1); cb->name = g_strdup(name); cb->flags = flags; - cb->alias = g_strdup(name); - - GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy); - return cb; -} - -GaimConvChatBuddy * -gaim_conv_chat_cb_new2(const char *name, const char *alias, GaimConvChatBuddyFlags flags) -{ - GaimConvChatBuddy *cb; - - g_return_val_if_fail(name != NULL, NULL); - - cb = g_new0(GaimConvChatBuddy, 1); - cb->name = g_strdup(name); - cb->flags = flags; if (alias) cb->alias = g_strdup(alias); else - cb->alias = g_strdup(name); + cb->alias = NULL; GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy); return cb; Modified: branches/soc-2006-chat-speed/src/conversation.h =================================================================== --- branches/soc-2006-chat-speed/src/conversation.h 2006-07-04 23:15:43 UTC (rev 16428) +++ branches/soc-2006-chat-speed/src/conversation.h 2006-07-04 23:45:59 UTC (rev 16429) @@ -158,11 +158,8 @@ const char *message, GaimMessageFlags flags, time_t mtime); - void (*chat_add_users)(GaimConversation *conv, GList *users, - GList *flags, GList *aliases, gboolean new_arrivals); + void (*chat_add_users)(GaimConversation *conv, GList *cbuddies, gboolean new_arrivals); - void (*chat_add_users2)(GaimConversation *conv, GList *cbuddies, gboolean new_arrivals); - void (*chat_rename_user)(GaimConversation *conv, const char *old_name, const char *new_name, const char *new_alias); void (*chat_remove_users)(GaimConversation *conv, GList *users); @@ -1019,6 +1016,7 @@ */ void gaim_conv_chat_add_users(GaimConvChat *chat, GList *users, GList *extra_msgs, GList *flags, gboolean new_arrivals); + /** * Renames a user in a chat. @@ -1139,23 +1137,12 @@ * Creates a new chat buddy * * @param name The name. - * @param flags The flags. - * - * @return The new chat buddy - */ -GaimConvChatBuddy *gaim_conv_chat_cb_new(const char *name, - GaimConvChatBuddyFlags flags); - -/** - * Creates a new chat buddy - * - * @param name The name. * @param alias The alias. * @param flags The flags. * * @return The new chat buddy */ -GaimConvChatBuddy *gaim_conv_chat_cb_new2(const char *name, const char *alias, +GaimConvChatBuddy *gaim_conv_chat_cb_new(const char *name, const char *alias, GaimConvChatBuddyFlags flags); /** Modified: branches/soc-2006-chat-speed/src/gtkconv.c =================================================================== --- branches/soc-2006-chat-speed/src/gtkconv.c 2006-07-04 23:15:43 UTC (rev 16428) +++ branches/soc-2006-chat-speed/src/gtkconv.c 2006-07-04 23:45:59 UTC (rev 16429) @@ -1424,7 +1424,7 @@ else gaim_conv_chat_ignore(chat, name); - cbuddy = gaim_conv_chat_cb_new2(name, alias, flags); + cbuddy = gaim_conv_chat_cb_new(name, alias, flags); add_chat_buddy_common(conv, cbuddy, NULL); g_free(name); @@ -5023,62 +5023,15 @@ account, name, message, conv, flags); g_free(displaying); } -/* This function is deprecated and I will replace it with the version below soon. */ static void -gaim_gtkconv_chat_add_users(GaimConversation *conv, GList *users, GList *flags, GList *aliases, gboolean new_arrivals) +gaim_gtkconv_chat_add_users(GaimConversation *conv, GList *cbuddies, gboolean new_arrivals) { GaimConvChat *chat; GaimGtkConversation *gtkconv; GaimGtkChatPane *gtkchat; GtkListStore *ls; GList *l; - GList *ll; - GList *lll; - char tmp[BUF_LONG]; - int num_users; - chat = GAIM_CONV_CHAT(conv); - gtkconv = GAIM_GTK_CONVERSATION(conv); - gtkchat = gtkconv->u.chat; - - num_users = g_list_length(gaim_conv_chat_get_users(chat)); - - g_snprintf(tmp, sizeof(tmp), - ngettext("%d person in room", "%d people in room", - num_users), - num_users); - - gtk_label_set_text(GTK_LABEL(gtkchat->count), tmp); - - ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list))); - gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, - GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID); - - l = users; - ll = flags; - lll = aliases; - while (l != NULL && ll != NULL && lll != NULL) { - GaimConvChatBuddy *cb = gaim_conv_chat_cb_new2((const char*)l->data, (const char *)lll->data, GPOINTER_TO_INT(ll->data)); - add_chat_buddy_common(conv, cb, NULL); - l = l->next; - ll = ll->next; - lll = lll->next; - } - - gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(ls), CHAT_USERS_ALIAS_KEY_COLUMN, - GTK_SORT_ASCENDING); - -} - -static void -gaim_gtkconv_chat_add_users2(GaimConversation *conv, GList *cbuddies, gboolean new_arrivals) -{ - GaimConvChat *chat; - GaimGtkConversation *gtkconv; - GaimGtkChatPane *gtkchat; - GtkListStore *ls; - GList *l; - char tmp[BUF_LONG]; int num_users; @@ -5159,7 +5112,7 @@ g_return_if_fail(new_alias != NULL); - cbuddy = gaim_conv_chat_cb_new2(new_name, new_alias, flags); + cbuddy = gaim_conv_chat_cb_new(new_name, new_alias, flags); add_chat_buddy_common(conv, cbuddy, old_name); } @@ -5266,7 +5219,7 @@ flags = gaim_conv_chat_user_get_flags(chat, user); - cbuddy = gaim_conv_chat_cb_new2(user, alias, flags); + cbuddy = gaim_conv_chat_cb_new(user, alias, flags); add_chat_buddy_common(conv, cbuddy, NULL); g_free(alias); @@ -5878,7 +5831,6 @@ gaim_gtkconv_write_im, /* write_im */ gaim_gtkconv_write_conv, /* write_conv */ gaim_gtkconv_chat_add_users, /* chat_add_users */ - gaim_gtkconv_chat_add_users2, /* chat_add_users */ gaim_gtkconv_chat_rename_user, /* chat_rename_user */ gaim_gtkconv_chat_remove_users, /* chat_remove_users */ gaim_gtkconv_chat_update_user, /* chat_update_user */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 23:15:49
|
Revision: 16428 Author: roast Date: 2006-07-04 16:15:43 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16428&view=rev Log Message: ----------- data->path freed only if it exists (it should anyway) 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-07-04 23:14:32 UTC (rev 16427) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 23:15:43 UTC (rev 16428) @@ -1178,7 +1178,9 @@ } - g_free(data->path); + + if (data->path) + g_free(data->path); g_slice_free(GaimLogCommonLoggerData, data); } @@ -1359,8 +1361,10 @@ } } - g_free(data->path); + if (data->path) + g_free(data->path); + g_slice_free(GaimLogCommonLoggerData, data); } } @@ -1518,6 +1522,7 @@ gerror = NULL; } } + if(data->path) g_free(data->path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 23:14:38
|
Revision: 16427 Author: roast Date: 2006-07-04 16:14:32 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16427&view=rev Log Message: ----------- txt_logger now uses giochannels too; txt_logger_writer bug now frees all data when it prematurely exists; removed gaim_common_log_writer's compensating checking 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-07-04 22:51:43 UTC (rev 16426) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 23:14:32 UTC (rev 16427) @@ -720,15 +720,9 @@ log->logger_data = data = g_slice_new0(GaimLogCommonLoggerData); - if (current_logger == xml_logger || current_logger == html_logger) { - data->channel = g_io_channel_new_file(path, "w+", NULL); - } - else { - data->file = g_fopen(path, "w+"); - } + data->channel = g_io_channel_new_file(path, "w+", NULL); - // they can't be /both/ null - if (data->channel == NULL && data->file == NULL) { + if (data->channel == NULL) { gaim_debug(GAIM_DEBUG_ERROR, "log", "Could not create log file %s\n", path); @@ -1420,9 +1414,11 @@ GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); GaimLogCommonLoggerData *data = log->logger_data; char *stripped = NULL; + gsize written = 0, written_buf = 0; + GString *writebuf = g_string_new(""); + GIOStatus iostat; + GError *gerror = NULL; - gsize written = 0; - if (data == NULL) { /* This log is new. We could use the loggers 'new' function, but * creating a new file there would result in empty files in the case @@ -1435,58 +1431,75 @@ data = log->logger_data; /* if we can't write to the file, give up before we hurt ourselves */ - if(!data->file) + if(!data->channel) return 0; if (log->type == GAIM_LOG_SYSTEM) - written += fprintf(data->file, "System log for account %s (%s) connected at %s\n", - gaim_account_get_username(log->account), prpl, - gaim_date_format_full(localtime(&log->time))); + g_string_printf(writebuf, "System log for account %s (%s) connected at %s\n", + gaim_account_get_username(log->account), prpl, + gaim_date_format_full(localtime(&log->time))); else - written += fprintf(data->file, "Conversation with %s at %s on %s (%s)\n", - log->name, gaim_date_format_full(localtime(&log->time)), - gaim_account_get_username(log->account), prpl); + g_string_printf(writebuf, "Conversation with %s at %s on %s (%s)\n", + log->name, gaim_date_format_full(localtime(&log->time)), + gaim_account_get_username(log->account), prpl); + + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "html_logger_write could not write to a new file: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + else written += written_buf; } /* if we can't write to the file, give up before we hurt ourselves */ - if(!data->file) + if(!data->channel) return 0; stripped = gaim_markup_strip_html(message); date = log_get_timestamp(log, time); if(log->type == GAIM_LOG_SYSTEM){ - written += fprintf(data->file, "---- %s @ %s ----\n", stripped, date); - } else { - if (type & GAIM_MESSAGE_SEND || - type & GAIM_MESSAGE_RECV) { - if (type & GAIM_MESSAGE_AUTO_RESP) { - written += fprintf(data->file, _("(%s) %s <AUTO-REPLY>: %s\n"), date, - from, stripped); - } else { - if(gaim_message_meify(stripped, -1)) - written += fprintf(data->file, "(%s) ***%s %s\n", date, from, - stripped); - else - written += fprintf(data->file, "(%s) %s: %s\n", date, from, - stripped); - } - } else if (type & GAIM_MESSAGE_SYSTEM) - written += fprintf(data->file, "(%s) %s\n", date, stripped); - else if (type & GAIM_MESSAGE_NO_LOG) { - /* This shouldn't happen */ - g_free(stripped); - return written; - } else if (type & GAIM_MESSAGE_WHISPER) - written += fprintf(data->file, "(%s) *%s* %s", date, from, stripped); + g_string_printf(writebuf, "---- %s @ %s ----\n", stripped, date); + } else if (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV) { + if (type & GAIM_MESSAGE_AUTO_RESP) + g_string_printf(writebuf, _("(%s) %s <AUTO-REPLY>: %s\n"), date, from, stripped); + else if(gaim_message_meify(stripped, -1)) + g_string_printf(writebuf, "(%s) ***%s %s\n", date, from, stripped); else - written += fprintf(data->file, "(%s) %s%s %s\n", date, from ? from : "", - from ? ":" : "", stripped); - } + g_string_printf(writebuf, "(%s) %s: %s\n", date, from, stripped); + } else if (type & GAIM_MESSAGE_SYSTEM) + g_string_printf(writebuf, "(%s) %s\n", date, stripped); + else if (type & GAIM_MESSAGE_NO_LOG) { + /* This shouldn't happen */ + g_free(date); + g_free(stripped); + g_string_free(writebuf, TRUE); + return written; + } else if (type & GAIM_MESSAGE_WHISPER) + g_string_printf(writebuf, "(%s) *%s* %s", date, from, stripped); + else + g_string_printf(writebuf, "(%s) %s%s %s\n", date, from ? from : "", from ? ":" : "", stripped); + g_free(date); g_free(stripped); - fflush(data->file); + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "txt_logger_write could not write the message to the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + else written += written_buf; + + iostat = g_io_channel_flush(data->channel, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "txt_logger_write could not flush the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + + g_string_free(writebuf, TRUE); return written; } @@ -1494,8 +1507,17 @@ { GaimLogCommonLoggerData *data = log->logger_data; if (data) { - if(data->file) - fclose(data->file); + if(data->channel) { + GIOStatus iostat; + GError *gerror = NULL; + + iostat = g_io_channel_shutdown(data->channel, TRUE, &gerror); // this may cause hanging + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "txt_logger_finalize could not shutdown the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + } if(data->path) g_free(data->path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 22:51:48
|
Revision: 16426 Author: roast Date: 2006-07-04 15:51:43 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16426&view=rev Log Message: ----------- cosmetic change in html_logger, and add the written buffer length only if giochannel operation didn't fail 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-07-04 22:45:48 UTC (rev 16425) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 22:51:43 UTC (rev 16426) @@ -1053,8 +1053,7 @@ g_error_free(gerror); gerror = NULL; } - - written += written_buf; + else written += written_buf; } /* if we can't write to the file, give up before we hurt ourselves */ @@ -1116,7 +1115,7 @@ g_error_free(gerror); gerror = NULL; } - written += written_buf; + else written += written_buf; g_free(date); g_free(msg_fixed); @@ -1278,7 +1277,7 @@ g_error_free(gerror); gerror = NULL; } - written += written_buf; + else written += written_buf; } /* if we can't write to the file, give up before we hurt ourselves */ @@ -1288,9 +1287,9 @@ gaim_markup_html_to_xhtml(message, &msg_fixed, NULL); date = log_get_timestamp(log, time); - if(log->type == GAIM_LOG_SYSTEM){ + if(log->type == GAIM_LOG_SYSTEM) g_string_printf(writebuf, "---- %s @ %s ----<br/>\n", msg_fixed, date); - } else if (type & GAIM_MESSAGE_SYSTEM) + else if (type & GAIM_MESSAGE_SYSTEM) g_string_printf(writebuf, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed); else if (type & GAIM_MESSAGE_ERROR) g_string_printf(writebuf, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed); @@ -1330,7 +1329,7 @@ g_error_free(gerror); gerror = NULL; } - written += written_buf; + else written += written_buf; iostat = g_io_channel_flush(data->channel, &gerror); if (iostat == G_IO_STATUS_ERROR) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 22:45:54
|
Revision: 16425 Author: roast Date: 2006-07-04 15:45:48 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16425&view=rev Log Message: ----------- html_logger now writes using giochannel 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-07-04 22:32:05 UTC (rev 16424) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 22:45:48 UTC (rev 16425) @@ -720,7 +720,7 @@ log->logger_data = data = g_slice_new0(GaimLogCommonLoggerData); - if (current_logger == xml_logger) { + if (current_logger == xml_logger || current_logger == html_logger) { data->channel = g_io_channel_new_file(path, "w+", NULL); } else { @@ -1234,87 +1234,112 @@ { char *msg_fixed; char *date; - char *header; GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); GaimLogCommonLoggerData *data = log->logger_data; - gsize written = 0; + gsize written = 0, written_buf = 0; + GString *writebuf = g_string_new(""); + GIOStatus iostat; + GError *gerror = NULL; if(!data) { const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO(plugin)->list_icon(log->account, NULL); const char *date; + char *header; + gaim_log_common_writer(log, ".html"); data = log->logger_data; /* if we can't write to the file, give up before we hurt ourselves */ - if(!data->file) + if(!data->channel) return 0; date = gaim_date_format_full(localtime(&log->time)); - written += fprintf(data->file, "<html><head>"); - written += fprintf(data->file, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"); - written += fprintf(data->file, "<title>"); + g_string_printf(writebuf, + "<html><head>" + "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">" + "<title>"); + if (log->type == GAIM_LOG_SYSTEM) header = g_strdup_printf("System log for account %s (%s) connected at %s", gaim_account_get_username(log->account), prpl, date); else header = g_strdup_printf("Conversation with %s at %s on %s (%s)", - log->name, date, gaim_account_get_username(log->account), prpl); + log->name, date, gaim_account_get_username(log->account), prpl); - written += fprintf(data->file, "%s", header); - written += fprintf(data->file, "</title></head><body>"); - written += fprintf(data->file, "<h3>%s</h3>\n", header); + g_string_append_printf(writebuf, "%s" "</title></head><body>" "<h3>%s</h3>\n", header, header); g_free(header); + + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "html_logger_write could not write to a new file: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + written += written_buf; } /* if we can't write to the file, give up before we hurt ourselves */ - if(!data->file) + if(!data->channel) return 0; gaim_markup_html_to_xhtml(message, &msg_fixed, NULL); date = log_get_timestamp(log, time); if(log->type == GAIM_LOG_SYSTEM){ - written += fprintf(data->file, "---- %s @ %s ----<br/>\n", msg_fixed, date); + g_string_printf(writebuf, "---- %s @ %s ----<br/>\n", msg_fixed, date); + } else if (type & GAIM_MESSAGE_SYSTEM) + g_string_printf(writebuf, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed); + else if (type & GAIM_MESSAGE_ERROR) + g_string_printf(writebuf, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed); + else if (type & GAIM_MESSAGE_WHISPER) + g_string_printf(writebuf, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n", + date, from, msg_fixed); + else if (type & GAIM_MESSAGE_AUTO_RESP) { + if (type & GAIM_MESSAGE_SEND) + g_string_printf(writebuf, _("<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); + else if (type & GAIM_MESSAGE_RECV) + g_string_printf(writebuf, _("<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); + } else if (type & GAIM_MESSAGE_RECV) { + if(gaim_message_meify(msg_fixed, -1)) + g_string_printf(writebuf, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", + date, from, msg_fixed); + else + g_string_printf(writebuf, "<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n", + date, from, msg_fixed); + } else if (type & GAIM_MESSAGE_SEND) { + if(gaim_message_meify(msg_fixed, -1)) + g_string_printf(writebuf, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", + date, from, msg_fixed); + else + g_string_printf(writebuf, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n", + date, from, msg_fixed); } else { - if (type & GAIM_MESSAGE_SYSTEM) - written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s</b><br/>\n", date, msg_fixed); - else if (type & GAIM_MESSAGE_ERROR) - written += fprintf(data->file, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed); - else if (type & GAIM_MESSAGE_WHISPER) - written += fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n", - date, from, msg_fixed); - else if (type & GAIM_MESSAGE_AUTO_RESP) { - if (type & GAIM_MESSAGE_SEND) - written += fprintf(data->file, _("<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); - else if (type & GAIM_MESSAGE_RECV) - written += fprintf(data->file, _("<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); - } else if (type & GAIM_MESSAGE_RECV) { - if(gaim_message_meify(msg_fixed, -1)) - written += fprintf(data->file, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", - date, from, msg_fixed); - else - written += fprintf(data->file, "<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n", - date, from, msg_fixed); - } else if (type & GAIM_MESSAGE_SEND) { - if(gaim_message_meify(msg_fixed, -1)) - written += fprintf(data->file, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", - date, from, msg_fixed); - else - written += fprintf(data->file, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n", - date, from, msg_fixed); - } else { - gaim_debug_error("log", "Unhandled message type."); - written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n", - date, from, msg_fixed); - } + gaim_debug_error("log", "Unhandled message type."); + g_string_printf(writebuf, "<font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\n", + date, from, msg_fixed); } g_free(date); g_free(msg_fixed); - fflush(data->file); + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "html_logger_write could not write the message to the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + written += written_buf; + + iostat = g_io_channel_flush(data->channel, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_write could not flush the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + + g_string_free(writebuf, TRUE); return written; } @@ -1322,9 +1347,24 @@ { GaimLogCommonLoggerData *data = log->logger_data; if (data) { - if(data->file) { - fprintf(data->file, "</body></html>\n"); - fclose(data->file); + if(data->channel) { + GIOStatus iostat; + GError *gerror = NULL; + + iostat = g_io_channel_write_chars(data->channel, "</body></html>\n", -1, NULL, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "html_logger_finalize could not write the tail: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + + iostat = g_io_channel_shutdown(data->channel, TRUE, &gerror); // this may cause hanging + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "html_logger_finalize could not shutdown the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + } g_free(data->path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 22:32:13
|
Revision: 16424 Author: roast Date: 2006-07-04 15:32:05 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16424&view=rev Log Message: ----------- free the GString too 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-07-04 22:22:45 UTC (rev 16423) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 22:32:05 UTC (rev 16424) @@ -1148,6 +1148,7 @@ gerror = NULL; } + g_string_free(writebuf, TRUE); return written; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 22:22:49
|
Revision: 16423 Author: roast Date: 2006-07-04 15:22:45 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16423&view=rev Log Message: ----------- using GString to build write buffer instead of a static 2048byte block 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-07-04 22:12:58 UTC (rev 16422) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 22:22:45 UTC (rev 16423) @@ -1020,10 +1020,12 @@ GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); GaimLogCommonLoggerData *data = log->logger_data; gsize written = 0, written_buf = 0; - char writebuf[4096]; + GString *writebuf; GIOStatus iostat; GError *gerror = NULL; + writebuf = g_string_new(""); + /* This log is new. We could use the loggers 'new' function, but * creating a new file there would result in empty files in the case * that you open a convo with someone, but don't say anything. @@ -1038,14 +1040,14 @@ // if file doesn't exist, die if (!data->channel) return 0; - g_snprintf(writebuf, sizeof(writebuf), - "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" - "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\"%s>\n" - "\t<event time=\"%s\" type=\"logStart\" />\n", - prpl, gaim_account_get_username(log->account), - log->type == GAIM_LOG_SYSTEM ? "gaim:logtype=\"system\"" : "", date); + g_string_printf(writebuf, + "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\"%s>\n" + "\t<event time=\"%s\" type=\"logStart\" />\n", + prpl, gaim_account_get_username(log->account), + log->type == GAIM_LOG_SYSTEM ? "gaim:logtype=\"system\"" : "", date); - iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); if (iostat == G_IO_STATUS_ERROR) { gaim_debug_info("log", "xml_logger_write could not write to new file: %s\n", gerror->message); g_error_free(gerror); @@ -1062,16 +1064,16 @@ gaim_markup_html_to_xhtml(message, &msg_fixed, NULL); if (log->type == GAIM_LOG_SYSTEM) { - g_snprintf(writebuf, sizeof(writebuf), "\t<event time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</event>\n", date, from, msg_fixed); + g_string_printf(writebuf, "\t<event time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</event>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_SYSTEM) { - g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</message>\n", date, from, msg_fixed); + g_string_printf(writebuf, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_ERROR) { - g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"error\">%s</message>\n", date, from, msg_fixed); + g_string_printf(writebuf, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"error\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_WHISPER) { - g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"whisper\">%s</message>\n", date, from, msg_fixed); + g_string_printf(writebuf, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"whisper\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_AUTO_RESP && (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV)) { gboolean recv_from_self = FALSE; @@ -1085,8 +1087,8 @@ } } - g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\"%s auto=\"true\">%s</message>\n", - date, from, recv_from_self ? " gaim:self=\"true\"" : "", msg_fixed); + g_string_printf(writebuf, "\t<message time=\"%s\" sender=\"%s\"%s auto=\"true\">%s</message>\n", + date, from, recv_from_self ? " gaim:self=\"true\"" : "", msg_fixed); } else if (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV) { gboolean recv_from_self = FALSE; @@ -1100,15 +1102,15 @@ } } - g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\"%s>%s</message>\n", + g_string_printf(writebuf, "\t<message time=\"%s\" sender=\"%s\"%s>%s</message>\n", date, from, recv_from_self ? " gaim:self=\"true\"" : "", msg_fixed); } else { gaim_debug_error("log", "Unhandled message type."); - g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); + g_string_printf(writebuf, "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); } - iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); if (iostat == G_IO_STATUS_ERROR) { gaim_debug_info("log", "xml_logger_write could not the message to the logfile: %s\n", gerror->message); g_error_free(gerror); @@ -1120,12 +1122,12 @@ g_free(msg_fixed); // append suffix to file and seek back to keep a valid XML document out of the user space buffer - g_snprintf(writebuf, sizeof(writebuf), - "\t<event time=\"%s\" type=\"logEnd\" />\n" - "</chat>\n", - gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); + g_string_printf(writebuf, + "\t<event time=\"%s\" type=\"logEnd\" />\n" + "</chat>\n", + gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); - iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, &written_buf, &gerror); if (iostat == G_IO_STATUS_ERROR) { gaim_debug_info("log", "xml_logger_write could not write the tail to the logfile: %s\n", gerror->message); g_error_free(gerror); @@ -1152,18 +1154,21 @@ static void xml_logger_finalize(GaimLog *log) { GaimLogCommonLoggerData *data = log->logger_data; + if (data) { if (data->channel) { - char writebuf[256]; + GString *writebuf; GIOStatus iostat; GError *gerror = NULL; - g_snprintf(writebuf, sizeof(writebuf), - "\t<event time=\"%s\" type=\"logEnd\" />\n" - "</chat>\n", - gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); + writebuf = g_string_new(""); - iostat = g_io_channel_write_chars(data->channel, writebuf, -1, NULL, &gerror); + g_string_printf(writebuf, + "\t<event time=\"%s\" type=\"logEnd\" />\n" + "</chat>\n", + gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); + + iostat = g_io_channel_write_chars(data->channel, writebuf->str, -1, NULL, &gerror); if (iostat == G_IO_STATUS_ERROR) { gaim_debug_info("log", "xml_logger_finalize could not write the tail: %s\n", gerror->message); g_error_free(gerror); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 22:13:07
|
Revision: 16422 Author: roast Date: 2006-07-04 15:12:58 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16422&view=rev Log Message: ----------- xml_logger's giochannel calls now nicely report errors 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-07-04 18:49:13 UTC (rev 16421) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 22:12:58 UTC (rev 16422) @@ -1046,6 +1046,12 @@ log->type == GAIM_LOG_SYSTEM ? "gaim:logtype=\"system\"" : "", date); iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_write could not write to new file: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + written += written_buf; } @@ -1103,6 +1109,11 @@ } iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_write could not the message to the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } written += written_buf; g_free(date); @@ -1115,11 +1126,25 @@ gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_write could not write the tail to the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + iostat = g_io_channel_seek_position(data->channel, -1*(gint64)(written_buf), G_SEEK_CUR, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_write could not seek backwards to the beginning of the tail: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } - //gaim_debug_error("log", "Could not return logfile stream position after tail write."); - iostat = g_io_channel_flush(data->channel, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_write could not flush the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } return written; } @@ -1139,8 +1164,20 @@ gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); iostat = g_io_channel_write_chars(data->channel, writebuf, -1, NULL, &gerror); + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_finalize could not write the tail: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } iostat = g_io_channel_shutdown(data->channel, TRUE, &gerror); // this may cause hanging + if (iostat == G_IO_STATUS_ERROR) { + gaim_debug_info("log", "xml_logger_finalize could not shutdown the logfile: %s\n", gerror->message); + g_error_free(gerror); + gerror = NULL; + } + + } g_free(data->path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-04 18:49:18
|
Revision: 16421 Author: sadrul Date: 2006-07-04 11:49:13 -0700 (Tue, 04 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16421&view=rev Log Message: ----------- Paco-Paco thinks it would be good to make libgnt configure look for ncursesw. Thanks to rekkanoryo and grim, we can do that. Modified Paths: -------------- trunk/console/libgnt/configure.ac Modified: trunk/console/libgnt/configure.ac =================================================================== --- trunk/console/libgnt/configure.ac 2006-07-04 05:17:07 UTC (rev 16420) +++ trunk/console/libgnt/configure.ac 2006-07-04 18:49:13 UTC (rev 16421) @@ -239,6 +239,8 @@ AC_CHECK_HEADERS(termios.h) #AC_VAR_TIMEZONE_EXTERNALS +AC_CHECK_LIB(ncursesw, initscr, , [AC_MSG_ERROR([ +*** You need ncursesw. ])]) AC_OUTPUT([Makefile gnt.pc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ro...@us...> - 2006-07-04 05:17:12
|
Revision: 16420 Author: roast Date: 2006-07-03 22:17:07 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16420&view=rev Log Message: ----------- preliminary (but completely functional) GIOChannel use for xmllogger without error checking Modified Paths: -------------- branches/soc-2006-file-loggers/src/log.c branches/soc-2006-file-loggers/src/log.h Modified: branches/soc-2006-file-loggers/src/log.c =================================================================== --- branches/soc-2006-file-loggers/src/log.c 2006-07-04 03:50:59 UTC (rev 16419) +++ branches/soc-2006-file-loggers/src/log.c 2006-07-04 05:17:07 UTC (rev 16420) @@ -720,15 +720,21 @@ log->logger_data = data = g_slice_new0(GaimLogCommonLoggerData); - data->file = g_fopen(path, "w+"); - if (data->file == NULL) - { + if (current_logger == xml_logger) { + data->channel = g_io_channel_new_file(path, "w+", NULL); + } + else { + data->file = g_fopen(path, "w+"); + } + + // they can't be /both/ null + if (data->channel == NULL && data->file == NULL) { gaim_debug(GAIM_DEBUG_ERROR, "log", - "Could not create log file %s\n", path); - + "Could not create log file %s\n", path); + if (log->conv != NULL) gaim_conversation_write(log->conv, NULL, _("Logging of this conversation failed."), - GAIM_MESSAGE_ERROR, time(NULL)); + GAIM_MESSAGE_ERROR, time(NULL)); g_free(dir); g_free(path); g_free(extname); @@ -1013,7 +1019,10 @@ GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); GaimLogCommonLoggerData *data = log->logger_data; - gsize written = 0; + gsize written = 0, written_buf = 0; + char writebuf[4096]; + GIOStatus iostat; + GError *gerror = NULL; /* This log is new. We could use the loggers 'new' function, but * creating a new file there would result in empty files in the case @@ -1027,36 +1036,36 @@ data = log->logger_data; // if file doesn't exist, die - if (!data->file) return 0; + if (!data->channel) return 0; + + g_snprintf(writebuf, sizeof(writebuf), + "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\"%s>\n" + "\t<event time=\"%s\" type=\"logStart\" />\n", + prpl, gaim_account_get_username(log->account), + log->type == GAIM_LOG_SYSTEM ? "gaim:logtype=\"system\"" : "", date); - fprintf(data->file, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); - - if (log->type == GAIM_LOG_SYSTEM) - written += fprintf(data->file, "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\" gaim:logtype=\"system\">\n", - prpl, gaim_account_get_username(log->account)); - else - written += fprintf(data->file, "<chat service=\"%s\" account=\"%s\" version=\"0.3.1-04\">\n", - prpl, gaim_account_get_username(log->account)); - written += fprintf(data->file, "\t<event time=\"%s\" type=\"logStart\" />\n", date); + iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + written += written_buf; } /* if we can't write to the file, give up before we hurt ourselves */ - if(!data->file) + if(!data->channel) return 0; gaim_markup_html_to_xhtml(message, &msg_fixed, NULL); if (log->type == GAIM_LOG_SYSTEM) { - written += fprintf(data->file, "\t<event time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</event>\n", date, from, msg_fixed); + g_snprintf(writebuf, sizeof(writebuf), "\t<event time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</event>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_SYSTEM) { - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</message>\n", date, from, msg_fixed); + g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"system\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_ERROR) { - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"error\">%s</message>\n", date, from, msg_fixed); + g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"error\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_WHISPER) { - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"whisper\">%s</message>\n", date, from, msg_fixed); + g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"whisper\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_AUTO_RESP && (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV)) { gboolean recv_from_self = FALSE; @@ -1070,7 +1079,7 @@ } } - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\"%s auto=\"true\">%s</message>\n", + g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\"%s auto=\"true\">%s</message>\n", date, from, recv_from_self ? " gaim:self=\"true\"" : "", msg_fixed); } else if (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV) { @@ -1085,36 +1094,33 @@ } } - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\"%s>%s</message>\n", + g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\"%s>%s</message>\n", date, from, recv_from_self ? " gaim:self=\"true\"" : "", msg_fixed); } else { gaim_debug_error("log", "Unhandled message type."); - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); + g_snprintf(writebuf, sizeof(writebuf), "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); } + iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + written += written_buf; + + g_free(date); g_free(msg_fixed); // append suffix to file and seek back to keep a valid XML document out of the user space buffer - { - fpos_t tail; - const char *date = gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL); + g_snprintf(writebuf, sizeof(writebuf), + "\t<event time=\"%s\" type=\"logEnd\" />\n" + "</chat>\n", + gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); - if (fgetpos(data->file, &tail) != 0) { - gaim_debug_error("log", "Could not save logfile stream position. Not writing tail."); - } - else { - fprintf(data->file, "\t<event time=\"%s\" type=\"logEnd\" />\n", date); - fprintf(data->file, "</chat>\n"); + iostat = g_io_channel_write_chars(data->channel, writebuf, -1, &written_buf, &gerror); + iostat = g_io_channel_seek_position(data->channel, -1*(gint64)(written_buf), G_SEEK_CUR, &gerror); - if (fsetpos(data->file, &tail) != 0) { - gaim_debug_error("log", "Could not return logfile strem position after tail write."); - } - } - } + //gaim_debug_error("log", "Could not return logfile stream position after tail write."); - g_free(date); - fflush(data->file); + iostat = g_io_channel_flush(data->channel, &gerror); + return written; } @@ -1122,16 +1128,23 @@ { GaimLogCommonLoggerData *data = log->logger_data; if (data) { - if (data->file) { - const char *date = gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL); - fprintf(data->file, "\t<event time=\"%s\" type=\"logEnd\" />\n", date); - fprintf(data->file, "</chat>\n"); + if (data->channel) { + char writebuf[256]; + GIOStatus iostat; + GError *gerror = NULL; - fclose(data->file); - } - g_free(data->path); + g_snprintf(writebuf, sizeof(writebuf), + "\t<event time=\"%s\" type=\"logEnd\" />\n" + "</chat>\n", + gaim_utf8_strftime("%Y-%m-%d %H:%M:%S%z", NULL)); - g_slice_free(GaimLogCommonLoggerData, data); + iostat = g_io_channel_write_chars(data->channel, writebuf, -1, NULL, &gerror); + + iostat = g_io_channel_shutdown(data->channel, TRUE, &gerror); // this may cause hanging + } + g_free(data->path); + + g_slice_free(GaimLogCommonLoggerData, data); } } Modified: branches/soc-2006-file-loggers/src/log.h =================================================================== --- branches/soc-2006-file-loggers/src/log.h 2006-07-04 03:50:59 UTC (rev 16419) +++ branches/soc-2006-file-loggers/src/log.h 2006-07-04 05:17:07 UTC (rev 16420) @@ -138,6 +138,7 @@ struct _GaimLogCommonLoggerData { char *path; FILE *file; + GIOChannel *channel; void *extra_data; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-04 03:51:09
|
Revision: 16419 Author: sadrul Date: 2006-07-03 20:50:59 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16419&view=rev Log Message: ----------- I am not handling mouse-events yet. So disable reporting the events. Modified Paths: -------------- trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-04 01:32:39 UTC (rev 16418) +++ trunk/console/libgnt/gntmain.c 2006-07-04 03:50:59 UTC (rev 16419) @@ -437,7 +437,9 @@ wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); noecho(); refresh(); +#if MAYBE_SOMEDAY mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL); +#endif wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); werase(stdscr); wrefresh(stdscr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |