Mercurial > pidgin
annotate plugins/iconaway.c @ 3752:b32474e522fa
[gaim-migrate @ 3890]
From: "William T. Mahan" <wtm2@duke.edu>
This patch, against CVS HEAD, fixes three bugs in Oscar File Transfer
support. I can split it up further if desired.
* Send a null checksum when initiating a file transfer, which fixes
"files don't match" warnings produced by some versions of WinAIM; add
a compile-time option to actually compute the checksum, which is
slow but necessary when sending to some Mac clients.
* Don't allow sending files to oneself, because it causes all kinds of
subtle problems and it's not useful.
* Don't crash when there is an error writing to the output file when
receiving.
From: "William T. Mahan" <wtm2@duke.edu>
This patch 2 of 3, which applies on top of the first, adds support for
reverse connections for Oscar File Transfer, the lack of which has
been the biggest complaint so far. Reverse connections are used by
newer AIM clients when there is difficulty verifying the IP of the
sender.
From: "William T. Mahan" <wtm2@duke.edu>
This patch 3 of 3, which applies on top of the first 2, removes the
alarm() and sigaction() calls that were added by my original FT patch
to detect transfer timeouts. Besides apparently not working on
Windows, they involved a lot of ugly code to handle a special case.
My new approach is to add destructors that can called when SNACs are
freed; a timeout is detected when a request SNAC is cleaned up before
the transfer is accepted. Although this touches several files, it is
more generic than the old method. I tried to implement this in an
unintrusive manner, so that there is little preformance penalty for
SNACs that do not use destructors.
My first two patches should work fine without this. If there are any
objections to the third patch, I ask that the first two patches be
applied, in which case I will set up a SourceForge page for this one.
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 19 Oct 2002 05:22:30 +0000 |
parents | 9682c0e022c6 |
children | 74d27aa5b686 |
rev | line source |
---|---|
3630 | 1 #define GAIM_PLUGINS |
133 | 2 #include "gaim.h" |
3 | |
3472 | 4 #include <gtk/gtk.h> |
133 | 5 |
3630 | 6 #ifdef _WIN32 |
7 #include "win32dep.h" | |
8 #endif | |
9 | |
133 | 10 void *handle; |
11 | |
3630 | 12 G_MODULE_IMPORT GtkWidget *imaway; |
13 G_MODULE_IMPORT GtkWidget *blist; | |
14 G_MODULE_IMPORT GtkWidget *all_chats; | |
15 G_MODULE_IMPORT GtkWidget *all_convos; | |
133 | 16 |
147
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
17 #ifdef USE_APPLET |
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
18 extern void applet_destroy_buddy(); |
ec301cfcaebf
[gaim-migrate @ 157]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
138
diff
changeset
|
19 #endif |
133 | 20 |
1404
96e93119268d
[gaim-migrate @ 1414]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
21 void iconify_windows(struct gaim_connection *gc, char *state, char *message, void *data) { |
2395
c014fd611443
[gaim-migrate @ 2408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2098
diff
changeset
|
22 if (!imaway || !gc->away) |
1406
cabde2947ba4
[gaim-migrate @ 1416]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1405
diff
changeset
|
23 return; |
3472 | 24 gtk_window_iconify(GTK_WINDOW(imaway)); |
3188 | 25 hide_buddy_list(); |
1779
0da2a831c0ae
[gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1406
diff
changeset
|
26 if (all_convos) |
3472 | 27 gtk_window_iconify(GTK_WINDOW(all_convos)); |
1779
0da2a831c0ae
[gaim-migrate @ 1789]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1406
diff
changeset
|
28 if (all_chats) |
3472 | 29 gtk_window_iconify(GTK_WINDOW(all_chats)); |
133 | 30 } |
31 | |
3630 | 32 /* |
33 * EXPORTED FUNCTIONS | |
34 */ | |
35 | |
36 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) { | |
133 | 37 handle = h; |
38 | |
39 gaim_signal_connect(handle, event_away, iconify_windows, NULL); | |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
40 |
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
147
diff
changeset
|
41 return NULL; |
133 | 42 } |
43 | |
3551 | 44 struct gaim_plugin_description desc; |
3630 | 45 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { |
3551 | 46 desc.api_version = PLUGIN_API_VERSION; |
47 desc.name = g_strdup("Iconify on away"); | |
48 desc.version = g_strdup(VERSION); | |
3564 | 49 desc.description = g_strdup("Iconifies the away box and the buddy list when you go away."); |
3551 | 50 desc.authors = g_strdup("Eric Warmenhoven <eric@warmenhoven.org>"); |
51 desc.url = g_strdup(WEBSITE); | |
52 return &desc; | |
53 } | |
54 | |
3630 | 55 G_MODULE_EXPORT char *name() { |
133 | 56 return "Iconify On Away"; |
57 } | |
58 | |
3630 | 59 G_MODULE_EXPORT char *description() { |
133 | 60 return "Iconifies the away box and the buddy list when you go away."; |
61 } |