Mercurial > pidgin.yaz
comparison src/conversation.c @ 10849:c203cd637f95
[gaim-migrate @ 12521]
sf patch #1185449, from Richard Laager
"As the comment in gtkconv.c says, saving a duplicate copy
of the entire conversation is completely bogus. Saving a
copy of a conversation is a UI thing (if the UI is only showing
the last five messages, for example, that's all the user
would expect to be saved). Therefore, there's no problem
having the UI save its own buffer. The GTK+ UI is already
doing this with the imhtml object. This patch removes the
history from GaimConversation and uses the buffer in the
imhtml object when saving a conversation.
It also adds <html>, <head>, <title>, and <body> tags to
the file to make it a bit more valid.
This patch is extremely likely to break plugins because it
changes the size of the GaimConversation struct. As such,
if this is committed, I recommend the developers recompile
non-default plugins. This broke Gaim-Encryption for me,
hence the warning."
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 19 Apr 2005 04:21:39 +0000 |
parents | 53e7884c549a |
children | 83a79d69160c |
comparison
equal
deleted
inserted
replaced
10848:98de05966d6d | 10849:c203cd637f95 |
---|---|
693 conv->type = type; | 693 conv->type = type; |
694 conv->account = account; | 694 conv->account = account; |
695 conv->name = g_strdup(name); | 695 conv->name = g_strdup(name); |
696 conv->title = g_strdup(name); | 696 conv->title = g_strdup(name); |
697 conv->send_history = g_list_append(NULL, NULL); | 697 conv->send_history = g_list_append(NULL, NULL); |
698 conv->history = g_string_new(""); | |
699 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, | 698 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal, |
700 g_free, NULL); | 699 g_free, NULL); |
701 conv->log = gaim_log_new(type == GAIM_CONV_CHAT ? GAIM_LOG_CHAT : | 700 conv->log = gaim_log_new(type == GAIM_CONV_CHAT ? GAIM_LOG_CHAT : |
702 GAIM_LOG_IM, conv->name, account, | 701 GAIM_LOG_IM, conv->name, account, |
703 time(NULL)); | 702 time(NULL)); |
875 node->data = NULL; | 874 node->data = NULL; |
876 } | 875 } |
877 | 876 |
878 g_list_free(g_list_first(conv->send_history)); | 877 g_list_free(g_list_first(conv->send_history)); |
879 | 878 |
880 if (conv->history != NULL) | |
881 g_string_free(conv->history, TRUE); | |
882 conv->history = NULL; | |
883 | |
884 conversations = g_list_remove(conversations, conv); | 879 conversations = g_list_remove(conversations, conv); |
885 | 880 |
886 if (conv->type == GAIM_CONV_IM) { | 881 if (conv->type == GAIM_CONV_IM) { |
887 gaim_conv_im_stop_typing_timeout(conv->u.im); | 882 gaim_conv_im_stop_typing_timeout(conv->u.im); |
888 gaim_conv_im_stop_type_again_timeout(conv->u.im); | 883 gaim_conv_im_stop_type_again_timeout(conv->u.im); |
1172 gaim_conversation_get_send_history(const GaimConversation *conv) | 1167 gaim_conversation_get_send_history(const GaimConversation *conv) |
1173 { | 1168 { |
1174 g_return_val_if_fail(conv != NULL, NULL); | 1169 g_return_val_if_fail(conv != NULL, NULL); |
1175 | 1170 |
1176 return conv->send_history; | 1171 return conv->send_history; |
1177 } | |
1178 | |
1179 void | |
1180 gaim_conversation_set_history(GaimConversation *conv, GString *history) | |
1181 { | |
1182 g_return_if_fail(conv != NULL); | |
1183 | |
1184 conv->history = history; | |
1185 } | |
1186 | |
1187 GString * | |
1188 gaim_conversation_get_history(const GaimConversation *conv) | |
1189 { | |
1190 g_return_val_if_fail(conv != NULL, NULL); | |
1191 | |
1192 return conv->history; | |
1193 } | 1172 } |
1194 | 1173 |
1195 GaimConvWindow * | 1174 GaimConvWindow * |
1196 gaim_conversation_get_window(const GaimConversation *conv) | 1175 gaim_conversation_get_window(const GaimConversation *conv) |
1197 { | 1176 { |