comparison plugins/timestamp.c @ 13104:e1e5462b7d81

[gaim-migrate @ 15466] Rework lots of date parsing. I either introduced a whole lot of bugs, or I've made sure all dates are localized properly now. Only time will tell which it is... ;) committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 02 Feb 2006 19:50:51 +0000
parents 71299d63801d
children f09c6e8df82c
comparison
equal deleted inserted replaced
13103:a6811e213977 13104:e1e5462b7d81
43 do_timestamp(gpointer data) 43 do_timestamp(gpointer data)
44 { 44 {
45 GaimConversation *c = (GaimConversation *)data; 45 GaimConversation *c = (GaimConversation *)data;
46 GaimGtkConversation *conv = GAIM_GTK_CONVERSATION(c); 46 GaimGtkConversation *conv = GAIM_GTK_CONVERSATION(c);
47 GtkTextIter iter; 47 GtkTextIter iter;
48 char mdate[7]; 48 const char *mdate;
49 int is_conversation_active; 49 int is_conversation_active;
50 time_t tim = time(NULL); 50 time_t tim = time(NULL);
51 51
52 if (!g_list_find(gaim_get_conversations(), c)) 52 if (!g_list_find(gaim_get_conversations(), c))
53 return FALSE; 53 return FALSE;
61 gboolean scroll = TRUE; 61 gboolean scroll = TRUE;
62 GtkWidget *imhtml = conv->imhtml; 62 GtkWidget *imhtml = conv->imhtml;
63 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml)); 63 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml));
64 gtk_text_buffer_get_end_iter(buffer, &iter); 64 gtk_text_buffer_get_end_iter(buffer, &iter);
65 gaim_conversation_set_data(c, "timestamp-conv-active", GINT_TO_POINTER(FALSE)); 65 gaim_conversation_set_data(c, "timestamp-conv-active", GINT_TO_POINTER(FALSE));
66 strftime(mdate, sizeof(mdate), "\n%H:%M", localtime(&tim)); 66 mdate = gaim_utf8_strftime("\n%H:%M", localtime(&tim));
67 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect); 67 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW(imhtml), &rect);
68 gtk_text_view_get_line_yrange(GTK_TEXT_VIEW(imhtml), &iter, &y, &height); 68 gtk_text_view_get_line_yrange(GTK_TEXT_VIEW(imhtml), &iter, &y, &height);
69 if(((y + height) - (rect.y + rect.height)) > height 69 if(((y + height) - (rect.y + rect.height)) > height
70 && gtk_text_buffer_get_char_count(buffer)){ 70 && gtk_text_buffer_get_char_count(buffer)){
71 scroll = FALSE; 71 scroll = FALSE;