Mercurial > pidgin
annotate plugins/notify.c @ 395:9a436c1d128d
[gaim-migrate @ 405]
whoops
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 12 Jun 2000 13:23:53 +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 } |