comparison pidgin/gtkconv.c @ 32716:4f8626d4ef63

propagate from branch 'im.pidgin.pidgin' (head deb06ab6aa118efb674f1a8434ff529e67b28809) to branch 'im.pidgin.cpw.qulogic.gtk3' (head 34c3103eabae4a4c23439048d383f73c94dfd23e)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 23 Feb 2012 08:13:23 +0000
parents 7df79e0d1150 e946a9998052
children 194f66d5089a
comparison
equal deleted inserted replaced
32715:4ae0c82b158d 32716:4f8626d4ef63
5795 5795
5796 convnode = get_conversation_blist_node(conv); 5796 convnode = get_conversation_blist_node(conv);
5797 if (convnode == NULL || !purple_blist_node_get_bool(convnode, "gtk-mute-sound")) 5797 if (convnode == NULL || !purple_blist_node_get_bool(convnode, "gtk-mute-sound"))
5798 gtkconv->make_sound = TRUE; 5798 gtkconv->make_sound = TRUE;
5799 5799
5800 if (convnode != NULL) { 5800 if (convnode != NULL && purple_blist_node_has_setting(convnode, "enable-logging")) {
5801 gboolean logging = purple_blist_node_get_bool(convnode, "enable-logging"); 5801 gboolean logging = purple_blist_node_get_bool(convnode, "enable-logging");
5802 purple_conversation_set_logging(conv, logging); 5802 purple_conversation_set_logging(conv, logging);
5803 } 5803 }
5804 5804
5805 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")) 5805 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar"))
8255 /* Adds some message history to the gtkconv. This happens in a idle-callback. */ 8255 /* Adds some message history to the gtkconv. This happens in a idle-callback. */
8256 static gboolean 8256 static gboolean
8257 add_message_history_to_gtkconv(gpointer data) 8257 add_message_history_to_gtkconv(gpointer data)
8258 { 8258 {
8259 PidginConversation *gtkconv = data; 8259 PidginConversation *gtkconv = data;
8260 GtkWebView *webview = GTK_WEBVIEW(gtkconv->webview);
8260 int count = 0; 8261 int count = 0;
8261 int timer = gtkconv->attach.timer; 8262 int timer = gtkconv->attach.timer;
8262 time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time")); 8263 time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time"));
8263 gboolean im = (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_IM); 8264 gboolean im = (purple_conversation_get_type(gtkconv->active_conv) == PURPLE_CONV_TYPE_IM);
8264 8265
8265 gtkconv->attach.timer = 0; 8266 gtkconv->attach.timer = 0;
8266 while (gtkconv->attach.current && count < 100) { /* XXX: 100 is a random value here */ 8267 while (gtkconv->attach.current && count < 100) { /* XXX: 100 is a random value here */
8267 PurpleConvMessage *msg = gtkconv->attach.current->data; 8268 PurpleConvMessage *msg = gtkconv->attach.current->data;
8268 if (!im && when && when < purple_conversation_message_get_timestamp(msg)) { 8269 if (!im && when && when < purple_conversation_message_get_timestamp(msg)) {
8269 gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<BR><HR>"); 8270 gtk_webview_append_html(webview, "<BR><HR>");
8271 gtk_webview_scroll_to_end(webview, TRUE);
8270 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL); 8272 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
8271 } 8273 }
8272 pidgin_conv_write_conv( 8274 pidgin_conv_write_conv(
8273 purple_conversation_message_get_conv(msg), 8275 purple_conversation_message_get_conv(msg),
8274 purple_conversation_message_get_sender(msg), 8276 purple_conversation_message_get_sender(msg),
8311 purple_conversation_message_get_alias(msg), 8313 purple_conversation_message_get_alias(msg),
8312 purple_conversation_message_get_message(msg), 8314 purple_conversation_message_get_message(msg),
8313 purple_conversation_message_get_flags(msg), 8315 purple_conversation_message_get_flags(msg),
8314 purple_conversation_message_get_timestamp(msg)); 8316 purple_conversation_message_get_timestamp(msg));
8315 } 8317 }
8316 gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<BR><HR>"); 8318 gtk_webview_append_html(webview, "<BR><HR>");
8319 gtk_webview_scroll_to_end(webview, TRUE);
8317 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL); 8320 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
8318 } 8321 }
8319 8322
8320 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL); 8323 g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
8321 purple_signal_emit(pidgin_conversations_get_handle(), 8324 purple_signal_emit(pidgin_conversations_get_handle(),