Mercurial > pidgin
view plugins/history.c @ 4968:804b25d09a5b
[gaim-migrate @ 5302]
Index: buddy.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/buddy.c,v
retrieving revision 1.484
retrieving revision 1.485
diff -u -d -r1.484 -r1.485
--- buddy.c?????2 Apr 2003 06:32:53 -0000???????1.484
+++ buddy.c?????2 Apr 2003 23:38:30 -0000???????1.485
@@ -1137,7 +1137,7 @@
?
????????gtkblist->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
????????gtk_window_set_role(GTK_WINDOW(gtkblist->window), "buddy_list");
-???????gtk_window_set_title(GTK_WINDOW(gtkblist->window), _("Biatches List"));
+???????gtk_window_set_title(GTK_WINDOW(gtkblist->window), _("Buddy List"));
????????gtk_widget_realize(gtkblist->window);
?
????????gtkblist->vbox = gtk_vbox_new(FALSE, 0);
really
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Thu, 03 Apr 2003 04:23:30 +0000 |
parents | 5fb47ec9bfe4 |
children | e245e686f62f |
line wrap: on
line source
/* Puts last 4k of log in new conversations a la Everybuddy (and then * stolen by Trillian "Pro") */ #include "config.h" #ifndef GAIM_PLUGINS #define GAIM_PLUGINS #endif #include "gaim.h" #include "gtkimhtml.h" #include <sys/stat.h> #include <unistd.h> #include <string.h> #define HISTORY_SIZE (4 * 1024) GModule *handle; void historize (char *name, void *data) { struct gaim_conversation *c = gaim_find_conversation(name); struct gaim_gtk_conversation *gtkconv; struct stat st; FILE *fd; char *userdir = g_strdup(gaim_user_dir()); char *logfile = g_strdup_printf("%s.log", normalize(name)); char *path = g_build_filename(userdir, "logs", logfile, NULL); char buf[HISTORY_SIZE+1]; char *tmp; int size; GtkIMHtmlOptions options = GTK_IMHTML_NO_COLOURS; if (stat(path, &st) || S_ISDIR(st.st_mode) || st.st_size == 0 || !(fd = fopen(path, "r"))) { g_free(userdir); g_free(logfile); g_free(path); return; } fseek(fd, st.st_size > HISTORY_SIZE ? st.st_size - HISTORY_SIZE : 0, SEEK_SET); size = fread(buf, 1, HISTORY_SIZE, fd); tmp = buf; tmp[size] = 0; /* start the history at a newline */ while (*tmp && *tmp != '\n') tmp++; if (*tmp) tmp++; if(*tmp == '<') options |= GTK_IMHTML_NO_NEWLINE; gtkconv = GAIM_GTK_CONVERSATION(c); gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), tmp, strlen(tmp), options); g_free(userdir); g_free(logfile); g_free(path); } char *gaim_plugin_init(GModule *h) { handle = h; gaim_signal_connect(handle, event_new_conversation, historize, NULL); return NULL; } struct gaim_plugin_description desc; struct gaim_plugin_description *gaim_plugin_desc() { desc.api_version = PLUGIN_API_VERSION; desc.name = g_strdup(_("History")); desc.version = g_strdup(VERSION); desc.description = g_strdup(_("Shows recently logged conversations in new conversations ")); desc.authors = g_strdup("Sean Egan <bj91704@binghamton.edu>"); desc.url = g_strdup(WEBSITE); return &desc; }