Mercurial > pidgin
annotate src/proxy.h @ 12645:fc28451f5d96
[gaim-migrate @ 14983]
SF Patch #1314512 from Sadrul (who has a patch for everything)
"This patch introduces a flag for protocol plugins that
support offline messages (like Y!M and ICQ). This was
encouraged by the following conversation:
<sadrul> should offline buddies be listed/enabled in
the send-to menu?
<rekkanoryo> i would think only for protocols that
support offline messaging, if it's indicated that the
buddy is offline
-- <snip> --
<Bleeter> sadrul: personally, I'd like to see a
'supports offline' flag of some description
<Bleeter> one could then redirect (via plugins) through
email or alternative methods
<Bleeter> just a thought
<Paco-Paco> yeah, that sounds like a reasonble thing to have
This patch uses this flag to disable the buddies in the
send-to menu who are offline and the protocol doesn't
support offline messages."
I made this make the label insensitive instead of the whole menuitem. This
should address SimGuy's concerns about inconsistency (i.e. you could create a
conversation with someone via the buddy list that you couldn't create via the
Send To menu). I also hacked up some voodoo to show the label as sensitive when
moused-over, as that looks better (given the label-insensitive thing is itself a
hack). I think this works quite well.
BUG NOTE:
This makes more obvious an existing bug. The Send To menu isn't updated when
buddies sign on or off or change status (at least under some circumstances).
We need to fix that anyway, so I'm not going to let it hold up this commit.
Switching tabs will clear it up. I'm thinking we just might want to build the
contents of that menu when it is selected. That would save us a mess of
inefficient signal callbacks that update the Send To menus in open windows all
the time.
AIM NOTE:
This assumes that AIM can't offline message. That's not strictly true. You can
message invisible users on AIM. However, by design, we can't tell when a user
is invisible without resorting to dirty hackery. In practice, this isn't a
problem, as you can still select the AIM user from the menu. And really, how
often will you be choosing the Invisible contact, rather than the user going
Invisible in the middle of a conversation or IMing you while they're Invisible?
JABBER NOTE:
This assumes that Jabber can always offline message. This isn't strictly true.
Sadrul said:
I have updated Jabber according to this link which seems to
talk about how to determine the existence offline-message
support in a server:
http://www.jabber.org/jeps/jep-0013.html#discover
However, jabber.org doesn't seem to send the required
info. So I am not sure about it.
He later said:
I talked to Nathan and he said offline message support is
mostly assumed for most jabber servers. GTalk doesn't yet
support it, but they are working on it. So I have made
jabber to always return TRUE.
If there is truly no way to detect offline messaging capability, then this is
an acceptable solution. We could special case Google Talk because of its
popularity, and remove that later. It's probably not worth it though.
MSN NOTE:
This assumes that MSN can never offline message. That's effectively true, but
to be technically correct, MSN can offline message if there's already a
switchboard conversation open with a user. We could write an offline_message
function in the MSN prpl to detect that, but it'd be of limited usefulness,
especially given that under most circumstances (where this might matter), the
switchboard connection will be closed almost immediately.
CVS NOTE:
I'm writing to share a tragic little story.
I have a PC that I use for Gaim development. One day, I was writing a commit
message on it, when all of a suddent it went berserk. The screen started
flashing, and the whole commit message just disappeared. All of it. And it was
a good commit message! I had to cram and rewrite it really quickly. Needless to
say, my rushed commit message wasn't nearly as good, and I blame the PC for that.
Seriously, though, what kind of version control system loses your commit
message on a broken connection to the server? Stupid!
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Fri, 23 Dec 2005 19:26:04 +0000 |
| parents | fc464a0abccc |
| children | 403a97caf5c0 |
| rev | line source |
|---|---|
|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4634
diff
changeset
|
1 /** |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
2 * @file proxy.h Proxy API |
|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4634
diff
changeset
|
3 * @ingroup core |
|
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4634
diff
changeset
|
4 * |
| 1 | 5 * gaim |
| 6 * | |
| 8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 * source distribution. | |
| 1 | 10 * |
| 11 * This program is free software; you can redistribute it and/or modify | |
| 12 * it under the terms of the GNU General Public License as published by | |
| 13 * the Free Software Foundation; either version 2 of the License, or | |
| 14 * (at your option) any later version. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU General Public License | |
| 22 * along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 */ | |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
25 #ifndef _GAIM_PROXY_H_ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
26 #define _GAIM_PROXY_H_ |
| 1 | 27 |
|
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1881
diff
changeset
|
28 #include <glib.h> |
|
8273
f24172f53650
[gaim-migrate @ 8997]
Christian Hammond <chipx86@chipx86.com>
parents:
8262
diff
changeset
|
29 #include "eventloop.h" |
| 1 | 30 |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
31 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
32 * A type of proxy connection. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
33 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
34 typedef enum |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
35 { |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
36 GAIM_PROXY_USE_GLOBAL = -1, /**< Use the global proxy information. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
37 GAIM_PROXY_NONE = 0, /**< No proxy. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
38 GAIM_PROXY_HTTP, /**< HTTP proxy. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
39 GAIM_PROXY_SOCKS4, /**< SOCKS 4 proxy. */ |
| 6621 | 40 GAIM_PROXY_SOCKS5, /**< SOCKS 5 proxy. */ |
| 41 GAIM_PROXY_USE_ENVVAR /**< Use environmental settings. */ | |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
42 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
43 } GaimProxyType; |
| 1 | 44 |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
45 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
46 * Information on proxy settings. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
47 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
48 typedef struct |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
49 { |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
50 GaimProxyType type; /**< The proxy type. */ |
|
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1843
diff
changeset
|
51 |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
52 char *host; /**< The host. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
53 int port; /**< The port number. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
54 char *username; /**< The username. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
55 char *password; /**< The password. */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
56 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
57 } GaimProxyInfo; |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
58 |
|
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
59 |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
60 #include "account.h" |
|
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
61 |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
62 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 extern "C" { |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
64 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
65 |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
66 /**************************************************************************/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
67 /** @name Proxy structure API */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
68 /**************************************************************************/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
69 /*@{*/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
70 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
71 /** |
| 10087 | 72 * Get the handle for the proxy system. |
| 73 * | |
| 74 * @return the handle to the proxy system | |
| 75 */ | |
|
12323
fc464a0abccc
[gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents:
11428
diff
changeset
|
76 void *gaim_proxy_get_handle(void); |
| 10087 | 77 |
| 78 /** | |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
79 * Creates a proxy information structure. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
80 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
81 * @return The proxy information structure. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
82 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
83 GaimProxyInfo *gaim_proxy_info_new(void); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
84 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
85 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
86 * Destroys a proxy information structure. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
87 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
88 * @param info The proxy information structure to destroy. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
89 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
90 void gaim_proxy_info_destroy(GaimProxyInfo *info); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
91 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
92 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
93 * Sets the type of proxy. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
94 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
95 * @param info The proxy information. |
|
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
96 * @param type The proxy type. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
97 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
98 void gaim_proxy_info_set_type(GaimProxyInfo *info, GaimProxyType type); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
99 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
100 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
101 * Sets the proxy host. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
102 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
103 * @param info The proxy information. |
|
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
104 * @param host The host. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
105 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
106 void gaim_proxy_info_set_host(GaimProxyInfo *info, const char *host); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
107 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
108 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
109 * Sets the proxy port. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
110 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
111 * @param info The proxy information. |
|
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
112 * @param port The port. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
113 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
114 void gaim_proxy_info_set_port(GaimProxyInfo *info, int port); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
115 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
116 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
117 * Sets the proxy username. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
118 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
119 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
120 * @param username The username. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
121 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
122 void gaim_proxy_info_set_username(GaimProxyInfo *info, const char *username); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
123 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
124 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
125 * Sets the proxy password. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
126 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
127 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
128 * @param password The password. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
129 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
130 void gaim_proxy_info_set_password(GaimProxyInfo *info, const char *password); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
131 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
132 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
133 * Returns the proxy's type. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
134 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
135 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
136 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
137 * @return The type. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
138 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
139 GaimProxyType gaim_proxy_info_get_type(const GaimProxyInfo *info); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
140 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
141 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
142 * Returns the proxy's host. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
143 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
144 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
145 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
146 * @return The host. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
147 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
148 const char *gaim_proxy_info_get_host(const GaimProxyInfo *info); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
149 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
150 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
151 * Returns the proxy's port. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
152 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
153 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
154 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
155 * @return The port. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
156 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
157 int gaim_proxy_info_get_port(const GaimProxyInfo *info); |
|
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1881
diff
changeset
|
158 |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
159 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
160 * Returns the proxy's username. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
161 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
162 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
163 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
164 * @return The username. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
165 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
166 const char *gaim_proxy_info_get_username(const GaimProxyInfo *info); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
167 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
168 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
169 * Returns the proxy's password. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
170 * |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
171 * @param info The proxy information. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
172 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
173 * @return The password. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
174 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
175 const char *gaim_proxy_info_get_password(const GaimProxyInfo *info); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
176 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
177 /*@}*/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
178 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
179 /**************************************************************************/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
180 /** @name Global Proxy API */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
181 /**************************************************************************/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
182 /*@{*/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
183 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
184 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
185 * Returns gaim's global proxy information. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
186 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
187 * @return The global proxy information. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
188 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
189 GaimProxyInfo *gaim_global_proxy_get_info(void); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
190 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
191 /*@}*/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
192 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
193 /**************************************************************************/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
194 /** @name Proxy API */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
195 /**************************************************************************/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
196 /*@{*/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
197 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
198 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
199 * Initializes the proxy subsystem. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
200 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
201 void gaim_proxy_init(void); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
202 |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
203 /** |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
204 * Makes a connection to the specified host and port. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
205 * |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
206 * @param account The account making the connection. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
207 * @param host The destination host. |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
208 * @param port The destination port. |
|
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6621
diff
changeset
|
209 * @param func The input handler function. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
210 * @param data User-defined data. |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
211 * |
|
11211
03a244acce57
[gaim-migrate @ 13342]
Richard Laager <rlaager@wiktel.com>
parents:
10087
diff
changeset
|
212 * @return Zero indicates the connection is pending. Any other value indicates failure. |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
213 */ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
214 int gaim_proxy_connect(GaimAccount *account, const char *host, int port, |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
215 GaimInputFunction func, gpointer data); |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
216 |
| 8262 | 217 /** |
| 218 * Makes a connection through a SOCKS5 proxy. | |
| 219 * | |
| 220 * @param gpi The GaimProxyInfo specifying the proxy settings | |
| 221 * @param host The destination host. | |
| 222 * @param port The destination port. | |
| 223 * @param func The input handler function. | |
| 224 * @param data User-defined data. | |
| 225 * | |
|
11211
03a244acce57
[gaim-migrate @ 13342]
Richard Laager <rlaager@wiktel.com>
parents:
10087
diff
changeset
|
226 * @return Zero indicates the connection is pending. Any other value indicates failure. |
| 8262 | 227 */ |
| 228 int gaim_proxy_connect_socks5(GaimProxyInfo *gpi, const char *host, int port, | |
| 229 GaimInputFunction func, gpointer data); | |
| 230 | |
| 11428 | 231 typedef void (*dns_callback_t)(GSList *hosts, gpointer data, |
| 232 const char *error_message); | |
| 233 /** | |
| 234 * Do an async dns query | |
| 235 * | |
| 236 * @param hostname The hostname to resolve | |
| 237 * @param port A portnumber which is stored in the struct sockaddr | |
| 238 * @param callback Callback to call after resolving | |
| 239 * @param data Extra data for the callback function | |
| 240 * @return a GSList containing the size of followed by the struct sockaddr for any returned IP | |
| 241 */ | |
| 242 int gaim_gethostbyname_async(const char *hostname, int port, dns_callback_t callback, gpointer data); | |
| 243 | |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
244 /*@}*/ |
|
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
245 |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
246 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
247 } |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
248 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
249 |
|
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5572
diff
changeset
|
250 #endif /* _GAIM_PROXY_H_ */ |
