Mercurial > pidgin
view plugins/notify.c @ 2349:60c716c32c40
[gaim-migrate @ 2362]
(Names changed to protect the innocent.)
blue:~/gaim/app/src $ ls -l ~/.gaim/logs/mid.log
-rw-r--r-- 1 eric eric 607043 Sep 20 03:28 /home/eric/.gaim/logs/mid.log
Previously on my 1.4GHz Athlon, displaying this 600k log file in the Log Viewer took 42 seconds:
time start: 1001157353
time end : 1001157395
Now, with the new smiley checker, it takes 23:
time start: 1001157199
time end : 1001157222
That's still horrible, but it's only a little more than half the time it previously took.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 22 Sep 2001 11:22:59 +0000 |
parents | bd9d403fb15b |
children | 3cd2fbddf95a |
line wrap: on
line source
#define GAIM_PLUGINS #include "gaim.h" #include <gtk/gtk.h> #include <string.h> void *handle; void received_im(struct gaim_connection *gc, char **who, char **what, void *m) { char buf[256]; struct conversation *cnv = find_conversation(*who); GtkWindow *win; char *me = g_strdup(normalize(gc->username)); if (!strcmp(me, normalize(*who))) { g_free(me); return; } g_free(me); if (cnv == NULL) { if (away_options & OPT_AWAY_QUEUE) return; cnv = new_conversation(*who); } win = (GtkWindow *)cnv->window; g_snprintf(buf, sizeof(buf), "%s", win->title); if (!strstr(buf, "(*) ")) { g_snprintf(buf, sizeof(buf), "(*) %s", win->title); gtk_window_set_title(win, buf); } } void sent_im(struct gaim_connection *gc, char *who, char **what, void *m) { char buf[256]; struct conversation *c = find_conversation(who); GtkWindow *win = (GtkWindow *)c->window; g_snprintf(buf, sizeof(buf), "%s", win->title); if (strstr(buf, "(*) ")) { g_snprintf(buf, sizeof(buf), "%s", &win->title[4]); gtk_window_set_title(win, buf); } } char *gaim_plugin_init(GModule *hndl) { handle = hndl; gaim_signal_connect(handle, event_im_recv, received_im, NULL); gaim_signal_connect(handle, event_im_send, sent_im, NULL); return NULL; } char *name() { return "Visual Notification"; } char *description() { return "Puts an asterisk in the title bar of all conversations" " where you have not responded to a message yet."; }