comparison plugins/history.c @ 5598:8b24e4d1e082

[gaim-migrate @ 6002] (10:36:12) Robot101: fixes three things: (10:36:33) Robot101: linkifies text that's inserted by the history plugin, if you have that option enabled for conversations in general (10:37:02) Robot101: validates the UTF-8 in incoming server-side aliases, so trillian can't screw us over (10:37:38) Robot101: changes the wording in the iconaway plugin so it no longer claims to minimise the away window, which for the moment is a dialog and isn't meant to be minimised committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 31 May 2003 14:38:03 +0000
parents fefad67de2c7
children 340cb17d3e37
comparison
equal deleted inserted replaced
5597:7805a9a2c6ba 5598:8b24e4d1e082
22 FILE *fd; 22 FILE *fd;
23 char *userdir = g_strdup(gaim_user_dir()); 23 char *userdir = g_strdup(gaim_user_dir());
24 char *logfile = g_strdup_printf("%s.log", normalize(name)); 24 char *logfile = g_strdup_printf("%s.log", normalize(name));
25 char *path = g_build_filename(userdir, "logs", logfile, NULL); 25 char *path = g_build_filename(userdir, "logs", logfile, NULL);
26 char buf[HISTORY_SIZE+1]; 26 char buf[HISTORY_SIZE+1];
27 char *tmp; 27 char *tmp, *tmp2;
28 int size; 28 int size;
29 GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS; 29 GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS;
30 30
31 if (stat(path, &st) || S_ISDIR(st.st_mode) || st.st_size == 0 || 31 if (stat(path, &st) || S_ISDIR(st.st_mode) || st.st_size == 0 ||
32 !(fd = fopen(path, "r"))) { 32 !(fd = fopen(path, "r"))) {
48 if (*tmp) tmp++; 48 if (*tmp) tmp++;
49 49
50 if(*tmp == '<') 50 if(*tmp == '<')
51 options |= GTK_IMHTML_NO_NEWLINE; 51 options |= GTK_IMHTML_NO_NEWLINE;
52 52
53 if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_urls_as_links")) { tmp2 = linkify_text(tmp);
54 else
55 tmp2 = g_strdup(tmp);
56
53 gtkconv = GAIM_GTK_CONVERSATION(c); 57 gtkconv = GAIM_GTK_CONVERSATION(c);
54 58
55 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), tmp, strlen(tmp), options); 59 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), tmp2, strlen(tmp2), options);
56 60
61 g_free(tmp2);
57 g_free(userdir); 62 g_free(userdir);
58 g_free(logfile); 63 g_free(logfile);
59 g_free(path); 64 g_free(path);
60 } 65 }
61 66