pidgin/purple-plugin-pack

8aaff0095557
Parents 4f8f5a18fb94
Children a8e2b020cfc7
Borrow some code from Pidgin's history plugin to make this history plugin
contact-aware.
--- a/enhancedhist/enhancedhist.c Sun Aug 03 08:13:39 2008 -0400
+++ b/enhancedhist/enhancedhist.c Sun Aug 03 08:37:24 2008 -0400
@@ -127,8 +127,21 @@
* particular log type disabled, the logs file doesnt not get specified */
convtype = purple_conversation_get_type(c);
if (convtype == PURPLE_CONV_TYPE_IM && PREF_IM_VAL) {
- logs = purple_log_get_logs(PURPLE_LOG_IM,
- purple_conversation_get_name(c), purple_conversation_get_account(c));
+ for(cur = buddies; cur; cur = cur->next) {
+ PurpleBlistNode *node = cur->data;
+
+ if(node && (node->prev || node->next)) {
+ PurpleBlistNode *node2;
+
+ for(node2 = node->parent->child; node2; node2 = node2->next) {
+ logs = g_list_concat(purple_log_get_logs(PURPLE_LOG_IM,
+ purple_buddy_get_name((PurpleBuddy *)node2),
+ purple_buddy_get_account((PurpleBuddy *)node2)), logs);
+ }
+
+ break;
+ }
+ }
} else if (convtype == PURPLE_CONV_TYPE_CHAT && PREF_CHAT_VAL) {
logs = purple_log_get_logs(PURPLE_LOG_CHAT,
purple_conversation_get_name(c), purple_conversation_get_account(c));
@@ -212,8 +225,7 @@
gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),
purple_account_get_protocol_name(((PurpleLog*)logs->data)->account));
- if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(
- GTK_TEXT_VIEW(gtkconv->imhtml))))
+ if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml))))
{
gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", options);
}