Mercurial > pidgin
annotate plugins/notify.c @ 257:a93e273ca1d6
[gaim-migrate @ 267]
No one actually uses this, do they.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 24 May 2000 07:25:33 +0000 |
parents | e9ca9146ebf1 |
children | 18e147714c4b |
rev | line source |
---|---|
191 | 1 #define GAIM_PLUGINS |
2 #include "gaim.h" | |
3 | |
4 #include <gtk/gtk.h> | |
192
e9ca9146ebf1
[gaim-migrate @ 202]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
191
diff
changeset
|
5 #include <string.h> |
191 | 6 |
7 void *handle; | |
8 | |
9 void received_im(char **who, char **what, void *m) { | |
10 char buf[256]; | |
11 struct conversation *cnv = find_conversation(*who); | |
12 GtkWindow *win; | |
13 | |
192
e9ca9146ebf1
[gaim-migrate @ 202]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
191
diff
changeset
|
14 if (!strcmp(*what, LAGOMETER_STR)) |
e9ca9146ebf1
[gaim-migrate @ 202]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
191
diff
changeset
|
15 return; |
e9ca9146ebf1
[gaim-migrate @ 202]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
191
diff
changeset
|
16 |
191 | 17 if (cnv == NULL) |
18 cnv = new_conversation(*who); | |
19 | |
20 win = (GtkWindow *)cnv->window; | |
21 | |
22 g_snprintf(buf, sizeof(buf), "%s", win->title); | |
23 if (!strstr(buf, "(*) ")) { | |
24 g_snprintf(buf, sizeof(buf), "(*) %s", win->title); | |
25 gtk_window_set_title(win, buf); | |
26 } | |
27 } | |
28 | |
29 void sent_im(char *who, char **what, void *m) { | |
30 char buf[256]; | |
31 struct conversation *c = find_conversation(who); | |
32 GtkWindow *win = (GtkWindow *)c->window; | |
33 | |
34 g_snprintf(buf, sizeof(buf), "%s", win->title); | |
35 if (strstr(buf, "(*) ")) { | |
36 g_snprintf(buf, sizeof(buf), "%s", &win->title[4]); | |
37 gtk_window_set_title(win, buf); | |
38 } | |
39 } | |
40 | |
41 void gaim_plugin_init(void *hndl) { | |
42 handle = hndl; | |
43 | |
44 gaim_signal_connect(handle, event_im_recv, received_im, NULL); | |
45 gaim_signal_connect(handle, event_im_send, sent_im, NULL); | |
46 } | |
47 | |
48 char *name() { | |
49 return "Visual Notification"; | |
50 } | |
51 | |
52 char *description() { | |
53 return "Puts an asterisk in the title bar of all conversations" | |
54 " where you have not responded to a message yet."; | |
55 } |