| 290 if(logger->list) { |
290 if(logger->list) { |
| 291 GList *logs = (logger->list)(type, name, account); |
291 GList *logs = (logger->list)(type, name, account); |
| 292 |
292 |
| 293 while (logs) { |
293 while (logs) { |
| 294 PurpleLog *log = (PurpleLog*)(logs->data); |
294 PurpleLog *log = (PurpleLog*)(logs->data); |
| |
295 if (!log) { |
| |
296 g_warn_if_reached(); |
| |
297 continue; |
| |
298 } |
| 295 /* Activity score counts bytes in the log, exponentially |
299 /* Activity score counts bytes in the log, exponentially |
| 296 decayed with a half-life of 14 days. */ |
300 decayed with a half-life of 14 days. */ |
| 297 score_double += purple_log_get_size(log) * |
301 score_double += purple_log_get_size(log) * |
| 298 pow(0.5, difftime(now, log->time)/1209600.0); |
302 pow(0.5, difftime(now, log->time)/1209600.0); |
| 299 purple_log_free(log); |
303 purple_log_free(log); |
| 1577 purple_log_common_writer(log, ".txt"); |
1583 purple_log_common_writer(log, ".txt"); |
| 1578 |
1584 |
| 1579 data = log->logger_data; |
1585 data = log->logger_data; |
| 1580 |
1586 |
| 1581 /* if we can't write to the file, give up before we hurt ourselves */ |
1587 /* if we can't write to the file, give up before we hurt ourselves */ |
| 1582 if(!data->file) |
1588 if(!data || !data->file) |
| 1583 return 0; |
1589 return 0; |
| 1584 |
1590 |
| 1585 if (log->type == PURPLE_LOG_SYSTEM) |
1591 if (log->type == PURPLE_LOG_SYSTEM) |
| 1586 written += fprintf(data->file, "System log for account %s (%s) connected at %s\n", |
1592 written += fprintf(data->file, "System log for account %s (%s) connected at %s\n", |
| 1587 purple_account_get_username(log->account), prpl, |
1593 purple_account_get_username(log->account), prpl, |