Mercurial > pidgin
comparison plugins/filectl.c @ 1047:ece2d1543b20
[gaim-migrate @ 1057]
Plugins now use GModule. Protocol plugins can be dynamically updated.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 01 Nov 2000 22:30:36 +0000 |
parents | bb22fb4a7d39 |
children | 9ab820049ede |
comparison
equal
deleted
inserted
replaced
1046:4593605da0e2 | 1047:ece2d1543b20 |
---|---|
14 static time_t mtime; | 14 static time_t mtime; |
15 | 15 |
16 static void init_file(); | 16 static void init_file(); |
17 static void check_file(); | 17 static void check_file(); |
18 | 18 |
19 extern void dologin(GtkWidget *, GtkWidget *); | |
20 extern void do_quit(); | 19 extern void do_quit(); |
21 | 20 |
22 /* parse char * as if were word array */ | 21 /* parse char * as if were word array */ |
23 char *getarg(char *, int, int); | 22 char *getarg(char *, int, int); |
24 | 23 |
43 if (!blist) { | 42 if (!blist) { |
44 show_login(); | 43 show_login(); |
45 dologin(NULL, NULL); | 44 dologin(NULL, NULL); |
46 } | 45 } |
47 } else if (!strncasecmp(command, "signoff", 7)) { | 46 } else if (!strncasecmp(command, "signoff", 7)) { |
48 signoff(); | 47 struct gaim_connection *gc = NULL; |
48 arg1 = getarg(buffer, 1, 1); | |
49 if (arg1) gc = find_gaim_conn_by_name(arg1); | |
50 if (gc) signoff(gc); | |
51 else signoff_all(NULL, NULL); | |
49 } else if (!strncasecmp(command, "send", 4)) { | 52 } else if (!strncasecmp(command, "send", 4)) { |
50 struct conversation *c; | 53 struct conversation *c; |
51 arg1 = getarg(buffer, 1, 0); | 54 arg1 = getarg(buffer, 1, 0); |
52 arg2 = getarg(buffer, 2, 1); | 55 arg2 = getarg(buffer, 2, 1); |
53 c = find_conversation(arg1); | 56 c = find_conversation(arg1); |
54 if (!c) c = new_conversation(arg1); | 57 if (!c) c = new_conversation(arg1); |
55 write_to_conv(c, arg2, WFLAG_SEND, NULL); | 58 write_to_conv(c, arg2, WFLAG_SEND, NULL); |
56 serv_send_im(arg1, arg2, 0); | 59 serv_send_im(c->gc, arg1, arg2, 0); |
57 free(arg1); | 60 free(arg1); |
58 free(arg2); | 61 free(arg2); |
59 } else if (!strncasecmp(command, "away", 4)) { | 62 } else if (!strncasecmp(command, "away", 4)) { |
60 struct away_message a; | 63 struct away_message a; |
61 arg1 = getarg(buffer, 1, 1); | 64 arg1 = getarg(buffer, 1, 1); |
76 if (stat (filename, &finfo) != 0) | 79 if (stat (filename, &finfo) != 0) |
77 return; | 80 return; |
78 mtime = finfo.st_mtime; | 81 mtime = finfo.st_mtime; |
79 } | 82 } |
80 | 83 |
81 void gaim_plugin_init(void *h) { | 84 char *gaim_plugin_init(GModule *h) { |
82 handle = h; | 85 handle = h; |
83 init_file(); | 86 init_file(); |
84 check = gtk_timeout_add(5000, (GtkFunction)check_file, NULL); | 87 check = gtk_timeout_add(5000, (GtkFunction)check_file, NULL); |
85 } | 88 } |
86 | 89 |