--- a/src/log.c Sat Feb 05 13:41:17 2005 -0500
+++ b/src/log.c Sat Feb 05 16:57:34 2005 -0500
@@ -173,16 +173,24 @@
-static char* gaim_log_get_log_dir(GaimLogType type, const char *name, GaimAccount *account) {
- char *acct_name = g_strdup(gaim_escape_filename(gaim_normalize(account,
- gaim_account_get_username(account))));
+gaim_log_get_log_dir(GaimLogType type, const char *name, GaimAccount *account) + GaimPluginProtocolInfo *prpl_info; - /* does this seem like a bad way to get this component of the path to anyone else? --Nathan */
- const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO(
- gaim_find_prpl(gaim_account_get_protocol_id(account))
- )->list_icon(account, NULL);
+ prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + prpl_name = prpl_info->list_icon(account, NULL); + acct_name = g_strdup(gaim_escape_filename(gaim_normalize(account, + gaim_account_get_username(account)))); if (type == GAIM_LOG_CHAT) {
char *temp = g_strdup_printf("%s.chat", gaim_normalize(account, name));
@@ -194,10 +202,10 @@
target = gaim_escape_filename(gaim_normalize(account, name));
- dir = g_build_filename(gaim_user_dir(), "logs", prpl, acct_name, target, NULL);
+ dir = g_build_filename(gaim_user_dir(), "logs", prpl_name, acct_name, target, NULL); @@ -367,8 +375,11 @@
char *dir, *filename, *path;
dir = gaim_log_get_log_dir(log->type, log->name, log->account);
gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);
strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S", localtime(&log->time));
@@ -389,7 +400,7 @@
static GList *log_lister_common(GaimLogType type, const char *name, GaimAccount *account, const char *ext, GaimLogLogger *logger)
@@ -403,6 +414,8 @@
path = gaim_log_get_log_dir(type, name, account);
if (!(dir = g_dir_open(path, 0, NULL))) {
@@ -458,6 +471,7 @@
/* 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
@@ -465,6 +479,10 @@
char *dir = gaim_log_get_log_dir(log->type, log->name, log->account);
strftime(date, sizeof(date), "%Y-%m-%d.%H%M%S.xml", localtime(&log->time));
gaim_build_dir (dir, S_IRUSR | S_IWUSR | S_IXUSR);