Mercurial > pidgin
comparison src/log.c @ 13513:43d123a4b4d7
[gaim-migrate @ 15889]
Really compile.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Tue, 14 Mar 2006 14:43:41 +0000 |
parents | 7608c01ebe61 |
children | d6dd68a8be06 |
comparison
equal
deleted
inserted
replaced
13512:7608c01ebe61 | 13513:43d123a4b4d7 |
---|---|
1024 static gsize html_logger_write(GaimLog *log, GaimMessageFlags type, | 1024 static gsize html_logger_write(GaimLog *log, GaimMessageFlags type, |
1025 const char *from, time_t time, const char *message) | 1025 const char *from, time_t time, const char *message) |
1026 { | 1026 { |
1027 char *msg_fixed; | 1027 char *msg_fixed; |
1028 char *date; | 1028 char *date; |
1029 char *header; | |
1029 GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); | 1030 GaimPlugin *plugin = gaim_find_prpl(gaim_account_get_protocol_id(log->account)); |
1030 GaimLogCommonLoggerData *data = log->logger_data; | 1031 GaimLogCommonLoggerData *data = log->logger_data; |
1031 gsize written = 0; | 1032 gsize written = 0; |
1032 | 1033 |
1033 if(!data) { | 1034 if(!data) { |
1046 | 1047 |
1047 written += fprintf(data->file, "<html><head>"); | 1048 written += fprintf(data->file, "<html><head>"); |
1048 written += fprintf(data->file, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"); | 1049 written += fprintf(data->file, "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"); |
1049 written += fprintf(data->file, "<title>"); | 1050 written += fprintf(data->file, "<title>"); |
1050 if (log->type == GAIM_LOG_SYSTEM) | 1051 if (log->type == GAIM_LOG_SYSTEM) |
1051 written += fprintf(data->file, "System log for account %s (%s) connected at %s", | 1052 header = g_strdup_printf("System log for account %s (%s) connected at %s", |
1052 gaim_account_get_username(log->account), prpl, date); | 1053 gaim_account_get_username(log->account), prpl, date); |
1053 else | 1054 else |
1054 written += fprintf(data->file, "Conversation with %s at %s on %s (%s)", | 1055 header = g_strdup_printf("Conversation with %s at %s on %s (%s)", |
1055 log->name, date, gaim_account_get_username(log->account), prpl); | 1056 log->name, date, gaim_account_get_username(log->account), prpl); |
1056 | 1057 |
1058 written += fprintf(data->file, "%s", header); | |
1057 written += fprintf(data->file, "</title></head><body>"); | 1059 written += fprintf(data->file, "</title></head><body>"); |
1058 written += fprintf(data->file, "<h3>%s</h3>\n", header); | 1060 written += fprintf(data->file, "<h3>%s</h3>\n", header); |
1061 g_free(header); | |
1059 } | 1062 } |
1060 | 1063 |
1061 /* if we can't write to the file, give up before we hurt ourselves */ | 1064 /* if we can't write to the file, give up before we hurt ourselves */ |
1062 if(!data->file) | 1065 if(!data->file) |
1063 return 0; | 1066 return 0; |