annotate plugins/notify.c @ 780:c714def9cebb

[gaim-migrate @ 790] You may be a geek if... You've ever used a computer on Friday, Saturday and Sunday of the same weekend. You find yourself interrupting computer store salesman to correct something he said. The first thing you notice when walking in a business is their computer system. ...and offer advice on how you would change it. You've ever mounted a magnetic tape reel. You own any shareware. You know more IP addresses than phone numbers. You've ever accidentally dialed an IP address. Your friends use you as tech support. You've ever named a computer. You have your local computer store on speed dial. You can't carry on a conversation without talking about computers. Co-workers have to E-mail you about the fire alarm to get you out of the building. You've ever found "stray" diskettes when doing laundry. Your computer has it's own phone line - but your teenager doesn't. You check the national weather service web page for current weather conditions (rather than look out the window). You know more URLs than street addresses. Your pet has a web page. You get really excited when Yahoo adds your link. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 29 Aug 2000 03:59:01 +0000
parents 18e147714c4b
children 91b7377e7b45
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
191
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 #define GAIM_PLUGINS
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 #include "gaim.h"
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 #include <gtk/gtk.h>
192
e9ca9146ebf1 [gaim-migrate @ 202]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 191
diff changeset
5 #include <string.h>
191
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 void *handle;
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 void received_im(char **who, char **what, void *m) {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 char buf[256];
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 struct conversation *cnv = find_conversation(*who);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 GtkWindow *win;
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 if (cnv == NULL)
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 cnv = new_conversation(*who);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 win = (GtkWindow *)cnv->window;
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 g_snprintf(buf, sizeof(buf), "%s", win->title);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 if (!strstr(buf, "(*) ")) {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 g_snprintf(buf, sizeof(buf), "(*) %s", win->title);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 gtk_window_set_title(win, buf);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 void sent_im(char *who, char **what, void *m) {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 char buf[256];
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 struct conversation *c = find_conversation(who);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 GtkWindow *win = (GtkWindow *)c->window;
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 g_snprintf(buf, sizeof(buf), "%s", win->title);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 if (strstr(buf, "(*) ")) {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 g_snprintf(buf, sizeof(buf), "%s", &win->title[4]);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 gtk_window_set_title(win, buf);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 void gaim_plugin_init(void *hndl) {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 handle = hndl;
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 gaim_signal_connect(handle, event_im_recv, received_im, NULL);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 gaim_signal_connect(handle, event_im_send, sent_im, NULL);
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 char *name() {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 return "Visual Notification";
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 }
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 char *description() {
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 return "Puts an asterisk in the title bar of all conversations"
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 " where you have not responded to a message yet.";
948100a8cb23 [gaim-migrate @ 201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 }