| 330 target = ".system"; |
330 target = ".system"; |
| 331 } else { |
331 } else { |
| 332 target = purple_escape_filename(purple_normalize(account, name)); |
332 target = purple_escape_filename(purple_normalize(account, name)); |
| 333 } |
333 } |
| 334 |
334 |
| 335 dir = g_build_filename(purple_user_dir(), "logs", protocol_name, acct_name, target, NULL); |
335 dir = g_build_filename(purple_data_dir(), "logs", protocol_name, acct_name, target, NULL); |
| 336 |
336 |
| 337 g_free(acct_name); |
337 g_free(acct_name); |
| 338 |
338 |
| 339 return dir; |
339 return dir; |
| 340 } |
340 } |
| 1008 |
1008 |
| 1009 /* This will build log sets for all loggers that use the common logger |
1009 /* This will build log sets for all loggers that use the common logger |
| 1010 * functions because they use the same directory structure. */ |
1010 * functions because they use the same directory structure. */ |
| 1011 static void log_get_log_sets_common(GHashTable *sets) |
1011 static void log_get_log_sets_common(GHashTable *sets) |
| 1012 { |
1012 { |
| 1013 gchar *log_path = g_build_filename(purple_user_dir(), "logs", NULL); |
1013 gchar *log_path = g_build_filename(purple_data_dir(), "logs", NULL); |
| 1014 GDir *log_dir = g_dir_open(log_path, 0, NULL); |
1014 GDir *log_dir = g_dir_open(log_path, 0, NULL); |
| 1015 const gchar *protocol; |
1015 const gchar *protocol; |
| 1016 |
1016 |
| 1017 if (log_dir == NULL) { |
1017 if (log_dir == NULL) { |
| 1018 g_free(log_path); |
1018 g_free(log_path); |
| 1524 }; |
1524 }; |
| 1525 |
1525 |
| 1526 static GList *old_logger_list(PurpleLogType type, const char *sn, PurpleAccount *account) |
1526 static GList *old_logger_list(PurpleLogType type, const char *sn, PurpleAccount *account) |
| 1527 { |
1527 { |
| 1528 char *logfile = g_strdup_printf("%s.log", purple_normalize(account, sn)); |
1528 char *logfile = g_strdup_printf("%s.log", purple_normalize(account, sn)); |
| 1529 char *pathstr = g_build_filename(purple_user_dir(), "logs", logfile, NULL); |
1529 char *pathstr = g_build_filename(purple_data_dir(), "logs", logfile, NULL); |
| 1530 PurpleStringref *pathref = purple_stringref_new(pathstr); |
1530 PurpleStringref *pathref = purple_stringref_new(pathstr); |
| 1531 GStatBuf st; |
1531 GStatBuf st; |
| 1532 time_t log_last_modified; |
1532 time_t log_last_modified; |
| 1533 FILE *index; |
1533 FILE *index; |
| 1534 FILE *file; |
1534 FILE *file; |
| 1786 } |
1786 } |
| 1787 |
1787 |
| 1788 static int old_logger_total_size(PurpleLogType type, const char *name, PurpleAccount *account) |
1788 static int old_logger_total_size(PurpleLogType type, const char *name, PurpleAccount *account) |
| 1789 { |
1789 { |
| 1790 char *logfile = g_strdup_printf("%s.log", purple_normalize(account, name)); |
1790 char *logfile = g_strdup_printf("%s.log", purple_normalize(account, name)); |
| 1791 char *pathstr = g_build_filename(purple_user_dir(), "logs", logfile, NULL); |
1791 char *pathstr = g_build_filename(purple_data_dir(), "logs", logfile, NULL); |
| 1792 int size; |
1792 int size; |
| 1793 GStatBuf st; |
1793 GStatBuf st; |
| 1794 |
1794 |
| 1795 if (g_stat(pathstr, &st)) |
1795 if (g_stat(pathstr, &st)) |
| 1796 size = 0; |
1796 size = 0; |
| 1838 return data ? data->length : 0; |
1838 return data ? data->length : 0; |
| 1839 } |
1839 } |
| 1840 |
1840 |
| 1841 static void old_logger_get_log_sets(PurpleLogSetCallback cb, GHashTable *sets) |
1841 static void old_logger_get_log_sets(PurpleLogSetCallback cb, GHashTable *sets) |
| 1842 { |
1842 { |
| 1843 char *log_path = g_build_filename(purple_user_dir(), "logs", NULL); |
1843 char *log_path = g_build_filename(purple_data_dir(), "logs", NULL); |
| 1844 GDir *log_dir = g_dir_open(log_path, 0, NULL); |
1844 GDir *log_dir = g_dir_open(log_path, 0, NULL); |
| 1845 gchar *name; |
1845 gchar *name; |
| 1846 PurpleBlistNode *gnode, *cnode, *bnode; |
1846 PurpleBlistNode *gnode, *cnode, *bnode; |
| 1847 |
1847 |
| 1848 g_free(log_path); |
1848 g_free(log_path); |