Mercurial > pidgin
annotate plugins/notify.c @ 722:26e96119d5a5
[gaim-migrate @ 732]
more libfaim changes
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 18 Aug 2000 20:13:41 +0000 |
parents | 18e147714c4b |
children | 91b7377e7b45 |
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 | |
14 if (cnv == NULL) | |
15 cnv = new_conversation(*who); | |
16 | |
17 win = (GtkWindow *)cnv->window; | |
18 | |
19 g_snprintf(buf, sizeof(buf), "%s", win->title); | |
20 if (!strstr(buf, "(*) ")) { | |
21 g_snprintf(buf, sizeof(buf), "(*) %s", win->title); | |
22 gtk_window_set_title(win, buf); | |
23 } | |
24 } | |
25 | |
26 void sent_im(char *who, char **what, void *m) { | |
27 char buf[256]; | |
28 struct conversation *c = find_conversation(who); | |
29 GtkWindow *win = (GtkWindow *)c->window; | |
30 | |
31 g_snprintf(buf, sizeof(buf), "%s", win->title); | |
32 if (strstr(buf, "(*) ")) { | |
33 g_snprintf(buf, sizeof(buf), "%s", &win->title[4]); | |
34 gtk_window_set_title(win, buf); | |
35 } | |
36 } | |
37 | |
38 void gaim_plugin_init(void *hndl) { | |
39 handle = hndl; | |
40 | |
41 gaim_signal_connect(handle, event_im_recv, received_im, NULL); | |
42 gaim_signal_connect(handle, event_im_send, sent_im, NULL); | |
43 } | |
44 | |
45 char *name() { | |
46 return "Visual Notification"; | |
47 } | |
48 | |
49 char *description() { | |
50 return "Puts an asterisk in the title bar of all conversations" | |
51 " where you have not responded to a message yet."; | |
52 } |