im.pidgin.pidgin: 727439d778b7d7f40aa0230cb9be26765e8d50a9

datallah at pidgin.im datallah at pidgin.im
Tue Nov 27 21:20:49 EST 2007


-----------------------------------------------------------------
Revision: 727439d778b7d7f40aa0230cb9be26765e8d50a9
Ancestor: 9e52f5f3fa15ac341c185f72558447f3ff263337
Author: datallah at pidgin.im
Date: 2007-11-28T02:14:29
Branch: im.pidgin.pidgin

Modified files:
        pidgin/plugins/timestamp.c

ChangeLog: 

Fix crashing in the Timestamp plugin. Fixes #4087.

-------------- next part --------------
============================================================
--- pidgin/plugins/timestamp.c	327c567426f9bac36e17fe26f032d90c9bcdc2c7
+++ pidgin/plugins/timestamp.c	2f1c0759e10b2f1f43897930d2913c3184d39cf4
@@ -49,11 +49,17 @@ timestamp_display(PurpleConversation *co
 	const char *mdate;
 	int y, height;
 	GdkRectangle rect;
-	
+
 	/* display timestamp */
 	mdate = purple_utf8_strftime(then == 0 ? "%H:%M" : "\n%H:%M",
 		localtime(&now));
 	gtk_text_buffer_get_end_iter(buffer, &iter);
+
+	if (gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(buffer), "TIMESTAMP") == NULL)
+		gtk_text_buffer_create_tag(buffer, "TIMESTAMP",
+			"foreground", "#888888", "justification", GTK_JUSTIFY_CENTER,
+			"weight", PANGO_WEIGHT_BOLD, NULL);
+
 	gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, mdate,
 		strlen(mdate), "TIMESTAMP", NULL);
 
@@ -95,17 +101,9 @@ timestamp_new_convo(PurpleConversation *
 static void
 timestamp_new_convo(PurpleConversation *conv)
 {
-	PidginConversation *gtk_conv = PIDGIN_CONVERSATION(conv);
-	GtkTextBuffer *buffer;
-
 	if (!g_list_find(purple_get_conversations(), conv))
 		return;
 
-	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtk_conv->imhtml));
-	gtk_text_buffer_create_tag(buffer, "TIMESTAMP",
-		"foreground", "#888888", "justification", GTK_JUSTIFY_CENTER,
-		"weight", PANGO_WEIGHT_BOLD, NULL);
-
 	purple_conversation_set_data(conv, "timestamp-last", GINT_TO_POINTER(0));
 }
 


More information about the Commits mailing list