Mercurial > pidgin.yaz
annotate src/protocols/yahoo/yahoo.c @ 6573:cc41123c684a
[gaim-migrate @ 7095]
Bjoern Voigt writes:
"As far as I can see, you commited a patch, which adds support for "Get
User Info" on Yahoo and MSN. It's not my small Yahoo Get Info patch,
it's the bigger one, which parses Yahoo and MSN profile pages.
I prepared a patch for it, which adds i18n macros to this patch.
Please commit the attached patch i18n21.patch.
The patch works fine for Yahoo contacts with English language
preference. Unfortunately the patch doesn't work with contacts with
other language preferences. The problem is, that in Yahoo every user
can set up a language for his/her profile. So
http://profiles.yahoo.com/CONTACT can deliver English, German, French,
... pages, depending on CONTACT's preference. The yahoo_get_info()
functions doesn't handle this and it's not easy to handle this.
I have some ideas, how to fix this issue. I like to discuss this with
the author of the patch or in gaim-devel."
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Fri, 22 Aug 2003 20:06:18 +0000 |
parents | e34907332e46 |
children | a4622f1fb5a1 |
rev | line source |
---|---|
2681 | 1 /* |
2 * gaim | |
3 * | |
4 * Some code copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * libfaim code copyright 1998, 1999 Adam Fritzler <afritz@auk.cx> | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; either version 2 of the License, or | |
10 * (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, | |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 * GNU General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License | |
18 * along with this program; if not, write to the Free Software | |
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 * | |
21 */ | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
22 #include "internal.h" |
2681 | 23 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
24 #include "account.h" |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
25 #include "accountopt.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
26 #include "debug.h" |
2681 | 27 #include "multi.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
28 #include "notify.h" |
2681 | 29 #include "prpl.h" |
30 #include "proxy.h" | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
31 #include "request.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
32 #include "server.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
33 #include "util.h" |
6115
11bedb793a44
[gaim-migrate @ 6578]
Christian Hammond <chipx86@chipx86.com>
parents:
6069
diff
changeset
|
34 #include "html.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
35 |
6513 | 36 #include "yahoo.h" |
3147 | 37 #include "md5.h" |
2681 | 38 |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
39 /* XXX */ |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6321
diff
changeset
|
40 #include "gtkinternal.h" |
6546 | 41 #include "gaim.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
42 #include "ui.h" |
3630 | 43 |
5583 | 44 extern char *yahoo_crypt(const char *, const char *); |
2795
536bb833fdeb
[gaim-migrate @ 2808]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2786
diff
changeset
|
45 |
5493
3e8487580024
[gaim-migrate @ 5889]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
46 /* #define YAHOO_DEBUG */ |
2681 | 47 |
48 #define USEROPT_MAIL 0 | |
49 | |
3147 | 50 #define YAHOO_PAGER_HOST "scs.yahoo.com" |
2681 | 51 #define YAHOO_PAGER_PORT 5050 |
6514 | 52 #define YAHOO_PROFILE_URL "http://profiles.yahoo.com/" |
2681 | 53 |
3467 | 54 #define YAHOO_PROTO_VER 0x0900 |
55 | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
56 enum yahoo_service { /* these are easier to see in hex */ |
2681 | 57 YAHOO_SERVICE_LOGON = 1, |
58 YAHOO_SERVICE_LOGOFF, | |
59 YAHOO_SERVICE_ISAWAY, | |
60 YAHOO_SERVICE_ISBACK, | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
61 YAHOO_SERVICE_IDLE, /* 5 (placemarker) */ |
2681 | 62 YAHOO_SERVICE_MESSAGE, |
63 YAHOO_SERVICE_IDACT, | |
64 YAHOO_SERVICE_IDDEACT, | |
65 YAHOO_SERVICE_MAILSTAT, | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
66 YAHOO_SERVICE_USERSTAT, /* 0xa */ |
2681 | 67 YAHOO_SERVICE_NEWMAIL, |
68 YAHOO_SERVICE_CHATINVITE, | |
69 YAHOO_SERVICE_CALENDAR, | |
70 YAHOO_SERVICE_NEWPERSONALMAIL, | |
71 YAHOO_SERVICE_NEWCONTACT, | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
72 YAHOO_SERVICE_ADDIDENT, /* 0x10 */ |
2681 | 73 YAHOO_SERVICE_ADDIGNORE, |
74 YAHOO_SERVICE_PING, | |
75 YAHOO_SERVICE_GROUPRENAME, | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
76 YAHOO_SERVICE_SYSMESSAGE = 0x14, |
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
77 YAHOO_SERVICE_PASSTHROUGH2 = 0x16, |
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
78 YAHOO_SERVICE_CONFINVITE = 0x18, |
2681 | 79 YAHOO_SERVICE_CONFLOGON, |
80 YAHOO_SERVICE_CONFDECLINE, | |
81 YAHOO_SERVICE_CONFLOGOFF, | |
82 YAHOO_SERVICE_CONFADDINVITE, | |
83 YAHOO_SERVICE_CONFMSG, | |
84 YAHOO_SERVICE_CHATLOGON, | |
85 YAHOO_SERVICE_CHATLOGOFF, | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
86 YAHOO_SERVICE_CHATMSG = 0x20, |
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
87 YAHOO_SERVICE_GAMELOGON = 0x28, |
2786
318f846120e2
[gaim-migrate @ 2799]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2772
diff
changeset
|
88 YAHOO_SERVICE_GAMELOGOFF, |
318f846120e2
[gaim-migrate @ 2799]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2772
diff
changeset
|
89 YAHOO_SERVICE_GAMEMSG = 0x2a, |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
90 YAHOO_SERVICE_FILETRANSFER = 0x46, |
3019 | 91 YAHOO_SERVICE_NOTIFY = 0x4B, |
3147 | 92 YAHOO_SERVICE_AUTHRESP = 0x54, |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
93 YAHOO_SERVICE_LIST = 0x55, |
3147 | 94 YAHOO_SERVICE_AUTH = 0x57, |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
95 YAHOO_SERVICE_ADDBUDDY = 0x83, |
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
96 YAHOO_SERVICE_REMBUDDY = 0x84 |
2681 | 97 }; |
98 | |
99 enum yahoo_status { | |
2686
7b21c5446baf
[gaim-migrate @ 2699]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2683
diff
changeset
|
100 YAHOO_STATUS_AVAILABLE = 0, |
2681 | 101 YAHOO_STATUS_BRB, |
102 YAHOO_STATUS_BUSY, | |
103 YAHOO_STATUS_NOTATHOME, | |
104 YAHOO_STATUS_NOTATDESK, | |
105 YAHOO_STATUS_NOTINOFFICE, | |
106 YAHOO_STATUS_ONPHONE, | |
107 YAHOO_STATUS_ONVACATION, | |
108 YAHOO_STATUS_OUTTOLUNCH, | |
109 YAHOO_STATUS_STEPPEDOUT, | |
110 YAHOO_STATUS_INVISIBLE = 12, | |
111 YAHOO_STATUS_CUSTOM = 99, | |
112 YAHOO_STATUS_IDLE = 999, | |
2993 | 113 YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */ |
114 YAHOO_STATUS_TYPING = 0x16 | |
2681 | 115 }; |
3019 | 116 #define YAHOO_STATUS_GAME 0x2 /* Games don't fit into the regular status model */ |
2681 | 117 |
118 struct yahoo_data { | |
119 int fd; | |
120 guchar *rxqueue; | |
121 int rxlen; | |
122 GHashTable *hash; | |
3019 | 123 GHashTable *games; |
2681 | 124 int current_status; |
125 gboolean logged_in; | |
126 }; | |
127 | |
128 struct yahoo_pair { | |
129 int key; | |
130 char *value; | |
131 }; | |
132 | |
133 struct yahoo_packet { | |
134 guint16 service; | |
135 guint32 status; | |
136 guint32 id; | |
137 GSList *hash; | |
138 }; | |
139 | |
140 #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4) | |
141 | |
142 static struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id) | |
143 { | |
144 struct yahoo_packet *pkt = g_new0(struct yahoo_packet, 1); | |
145 | |
146 pkt->service = service; | |
147 pkt->status = status; | |
148 pkt->id = id; | |
149 | |
150 return pkt; | |
151 } | |
152 | |
3466 | 153 static void yahoo_packet_hash(struct yahoo_packet *pkt, int key, const char *value) |
2681 | 154 { |
155 struct yahoo_pair *pair = g_new0(struct yahoo_pair, 1); | |
156 pair->key = key; | |
157 pair->value = g_strdup(value); | |
158 pkt->hash = g_slist_append(pkt->hash, pair); | |
159 } | |
160 | |
161 static int yahoo_packet_length(struct yahoo_packet *pkt) | |
162 { | |
163 GSList *l; | |
164 | |
165 int len = 0; | |
166 | |
167 l = pkt->hash; | |
168 while (l) { | |
169 struct yahoo_pair *pair = l->data; | |
170 int tmp = pair->key; | |
171 do { | |
172 tmp /= 10; | |
173 len++; | |
174 } while (tmp); | |
175 len += 2; | |
176 len += strlen(pair->value); | |
177 len += 2; | |
178 l = l->next; | |
179 } | |
180 | |
181 return len; | |
182 } | |
183 | |
184 /* sometimes i wish prpls could #include things from other prpls. then i could just | |
185 * use the routines from libfaim and not have to admit to knowing how they work. */ | |
186 #define yahoo_put16(buf, data) ( \ | |
187 (*(buf) = (u_char)((data)>>8)&0xff), \ | |
188 (*((buf)+1) = (u_char)(data)&0xff), \ | |
189 2) | |
190 #define yahoo_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff)) | |
191 #define yahoo_put32(buf, data) ( \ | |
192 (*((buf)) = (u_char)((data)>>24)&0xff), \ | |
193 (*((buf)+1) = (u_char)((data)>>16)&0xff), \ | |
194 (*((buf)+2) = (u_char)((data)>>8)&0xff), \ | |
195 (*((buf)+3) = (u_char)(data)&0xff), \ | |
196 4) | |
197 #define yahoo_get32(buf) ((((*(buf))<<24)&0xff000000) + \ | |
198 (((*((buf)+1))<<16)&0x00ff0000) + \ | |
199 (((*((buf)+2))<< 8)&0x0000ff00) + \ | |
200 (((*((buf)+3) )&0x000000ff))) | |
201 | |
202 static void yahoo_packet_read(struct yahoo_packet *pkt, guchar *data, int len) | |
203 { | |
204 int pos = 0; | |
205 | |
206 while (pos + 1 < len) { | |
2724
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
207 char key[64], *value = NULL; |
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
208 int accept; |
2681 | 209 int x; |
210 | |
211 struct yahoo_pair *pair = g_new0(struct yahoo_pair, 1); | |
212 | |
213 x = 0; | |
214 while (pos + 1 < len) { | |
215 if (data[pos] == 0xc0 && data[pos + 1] == 0x80) | |
216 break; | |
217 key[x++] = data[pos++]; | |
218 } | |
219 key[x] = 0; | |
220 pos += 2; | |
221 pair->key = strtol(key, NULL, 10); | |
2724
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
222 accept = x; /* if x is 0 there was no key, so don't accept it */ |
2681 | 223 |
3996
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
224 if (len - pos + 1 <= 0) { |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
225 /* Truncated. Garbage or something. */ |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
226 accept = 0; |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
227 } |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
228 |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
229 if (accept) { |
2724
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
230 value = g_malloc(len - pos + 1); |
3996
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
231 x = 0; |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
232 while (pos + 1 < len) { |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
233 if (data[pos] == 0xc0 && data[pos + 1] == 0x80) |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
234 break; |
2724
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
235 value[x++] = data[pos++]; |
3996
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
236 } |
2724
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
237 value[x] = 0; |
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
238 pair->value = g_strdup(value); |
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
239 g_free(value); |
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
240 pkt->hash = g_slist_append(pkt->hash, pair); |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
241 gaim_debug(GAIM_DEBUG_MISC, "yahoo", |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
242 "Key: %d \tValue: %s\n", pair->key, pair->value); |
2724
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
243 } else { |
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
244 g_free(pair); |
7f3f4aa114ad
[gaim-migrate @ 2737]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2723
diff
changeset
|
245 } |
3996
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
246 pos += 2; |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
247 |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
248 /* Skip over garbage we've noticed in the mail notifications */ |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
249 if (data[0] == '9' && data[pos] == 0x01) |
3fdfe7872118
[gaim-migrate @ 4191]
Christian Hammond <chipx86@chipx86.com>
parents:
3768
diff
changeset
|
250 pos++; |
2681 | 251 } |
252 } | |
253 | |
254 static void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data) | |
255 { | |
256 GSList *l = pkt->hash; | |
257 int pos = 0; | |
258 | |
259 while (l) { | |
260 struct yahoo_pair *pair = l->data; | |
261 guchar buf[100]; | |
262 | |
263 g_snprintf(buf, sizeof(buf), "%d", pair->key); | |
264 strcpy(data + pos, buf); | |
265 pos += strlen(buf); | |
266 data[pos++] = 0xc0; | |
267 data[pos++] = 0x80; | |
268 | |
269 strcpy(data + pos, pair->value); | |
270 pos += strlen(pair->value); | |
271 data[pos++] = 0xc0; | |
272 data[pos++] = 0x80; | |
273 | |
274 l = l->next; | |
275 } | |
276 } | |
277 | |
278 static void yahoo_packet_dump(guchar *data, int len) | |
279 { | |
280 #ifdef YAHOO_DEBUG | |
281 int i; | |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
282 |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
283 gaim_debug(GAIM_DEBUG_MISC, "yahoo", ""); |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
284 |
2681 | 285 for (i = 0; i + 1 < len; i += 2) { |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
286 if ((i % 16 == 0) && i) { |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
287 gaim_debug(GAIM_DEBUG_MISC, NULL, "\n"); |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
288 gaim_debug(GAIM_DEBUG_MISC, "yahoo", ""); |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
289 } |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
290 |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
291 gaim_debug(GAIM_DEBUG_MISC, NULL, "%02x%02x ", data[i], data[i + 1]); |
2681 | 292 } |
293 if (i < len) | |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
294 gaim_debug(GAIM_DEBUG_MISC, NULL, "%02x", data[i]); |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
295 |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
296 gaim_debug(GAIM_DEBUG_MISC, NULL, "\n"); |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
297 gaim_debug(GAIM_DEBUG_MISC, "yahoo", ""); |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
298 |
2681 | 299 for (i = 0; i < len; i++) { |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
300 if ((i % 16 == 0) && i) { |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
301 gaim_debug(GAIM_DEBUG_MISC, NULL, "\n"); |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
302 gaim_debug(GAIM_DEBUG_MISC, "yahoo", ""); |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
303 } |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
304 |
2681 | 305 if (isprint(data[i])) |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
306 gaim_debug(GAIM_DEBUG_MISC, NULL, "%c ", data[i]); |
2681 | 307 else |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
308 gaim_debug(GAIM_DEBUG_MISC, NULL, ". "); |
2681 | 309 } |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
310 |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
311 gaim_debug(GAIM_DEBUG_MISC, NULL, "\n"); |
2681 | 312 #endif |
313 } | |
314 | |
315 static int yahoo_send_packet(struct yahoo_data *yd, struct yahoo_packet *pkt) | |
316 { | |
317 int pktlen = yahoo_packet_length(pkt); | |
318 int len = YAHOO_PACKET_HDRLEN + pktlen; | |
319 int ret; | |
320 | |
321 guchar *data; | |
322 int pos = 0; | |
323 | |
324 if (yd->fd < 0) | |
325 return -1; | |
326 | |
327 data = g_malloc0(len + 1); | |
328 | |
329 memcpy(data + pos, "YMSG", 4); pos += 4; | |
3467 | 330 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER); |
2681 | 331 pos += yahoo_put16(data + pos, 0x0000); |
332 pos += yahoo_put16(data + pos, pktlen); | |
333 pos += yahoo_put16(data + pos, pkt->service); | |
334 pos += yahoo_put32(data + pos, pkt->status); | |
335 pos += yahoo_put32(data + pos, pkt->id); | |
336 | |
337 yahoo_packet_write(pkt, data + pos); | |
338 | |
339 yahoo_packet_dump(data, len); | |
340 ret = write(yd->fd, data, len); | |
341 g_free(data); | |
342 | |
343 return ret; | |
344 } | |
345 | |
346 static void yahoo_packet_free(struct yahoo_packet *pkt) | |
347 { | |
348 while (pkt->hash) { | |
349 struct yahoo_pair *pair = pkt->hash->data; | |
350 g_free(pair->value); | |
351 g_free(pair); | |
352 pkt->hash = g_slist_remove(pkt->hash, pair); | |
353 } | |
354 g_free(pkt); | |
355 } | |
356 | |
5583 | 357 static void yahoo_process_status(GaimConnection *gc, struct yahoo_packet *pkt) |
2681 | 358 { |
359 struct yahoo_data *yd = gc->proto_data; | |
360 GSList *l = pkt->hash; | |
361 char *name = NULL; | |
362 int state = 0; | |
3019 | 363 int gamestate = 0; |
2681 | 364 char *msg = NULL; |
3019 | 365 |
2681 | 366 while (l) { |
367 struct yahoo_pair *pair = l->data; | |
368 | |
369 switch (pair->key) { | |
370 case 0: /* we won't actually do anything with this */ | |
371 break; | |
372 case 1: /* we don't get the full buddy list here. */ | |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
373 if (!yd->logged_in) { |
5583 | 374 gaim_connection_set_state(gc, GAIM_CONNECTED); |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
375 serv_finish_login(gc); |
5583 | 376 gaim_connection_set_display_name(gc, pair->value); |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
377 yd->logged_in = TRUE; |
2681 | 378 |
3147 | 379 /* this requests the list. i have a feeling that this is very evil |
380 * | |
381 * scs.yahoo.com sends you the list before this packet without it being | |
382 * requested | |
383 * | |
384 * do_import(gc, NULL); | |
385 * newpkt = yahoo_packet_new(YAHOO_SERVICE_LIST, YAHOO_STATUS_OFFLINE, 0); | |
386 * yahoo_send_packet(yd, newpkt); | |
387 * yahoo_packet_free(newpkt); | |
388 */ | |
389 | |
390 } | |
2681 | 391 break; |
392 case 8: /* how many online buddies we have */ | |
393 break; | |
394 case 7: /* the current buddy */ | |
395 name = pair->value; | |
396 break; | |
397 case 10: /* state */ | |
398 state = strtol(pair->value, NULL, 10); | |
399 break; | |
400 case 19: /* custom message */ | |
401 msg = pair->value; | |
402 break; | |
403 case 11: /* i didn't know what this was in the old protocol either */ | |
404 break; | |
405 case 17: /* in chat? */ | |
406 break; | |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
407 case 13: /* in pager? */ |
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
408 if (pkt->service == YAHOO_SERVICE_LOGOFF || |
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
409 strtol(pair->value, NULL, 10) == 0) { |
4732 | 410 serv_got_update(gc, name, 0, 0, 0, 0, 0); |
2807
f01e6a425136
[gaim-migrate @ 2820]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2805
diff
changeset
|
411 break; |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
412 } |
3019 | 413 if (g_hash_table_lookup(yd->games, name)) |
414 gamestate = YAHOO_STATUS_GAME; | |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
415 if (state == YAHOO_STATUS_CUSTOM) { |
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
416 gpointer val = g_hash_table_lookup(yd->hash, name); |
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
417 if (val) { |
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
418 g_free(val); |
2873
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
419 g_hash_table_insert(yd->hash, name, |
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
420 msg ? g_strdup(msg) : g_malloc0(1)); |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
421 } else |
2873
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
422 g_hash_table_insert(yd->hash, g_strdup(name), |
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
423 msg ? g_strdup(msg) : g_malloc0(1)); |
2771
450f4f9d2f23
[gaim-migrate @ 2784]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2741
diff
changeset
|
424 } |
4777 | 425 if (state == YAHOO_STATUS_AVAILABLE) |
426 serv_got_update(gc, name, 1, 0, 0, 0, gamestate); | |
5002 | 427 else if (state == YAHOO_STATUS_IDLE) |
428 serv_got_update(gc, name, 1, 0, 0, -1, (state << 2) | UC_UNAVAILABLE | gamestate); | |
4777 | 429 else |
430 serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE | gamestate); | |
2771
450f4f9d2f23
[gaim-migrate @ 2784]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2741
diff
changeset
|
431 break; |
2805
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
432 case 60: /* no clue */ |
9b3c7d2a6e9a
[gaim-migrate @ 2818]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2795
diff
changeset
|
433 break; |
2979 | 434 case 16: /* Custom error message */ |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5367
diff
changeset
|
435 gaim_notify_error(gc, NULL, pair->value, NULL); |
2951 | 436 break; |
2681 | 437 default: |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
438 gaim_debug(GAIM_DEBUG_ERROR, "yahoo", |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
439 "Unknown status key %d\n", pair->key); |
2681 | 440 break; |
441 } | |
442 | |
443 l = l->next; | |
444 } | |
445 } | |
446 | |
5583 | 447 static void yahoo_process_list(GaimConnection *gc, struct yahoo_packet *pkt) |
2681 | 448 { |
449 GSList *l = pkt->hash; | |
450 gboolean export = FALSE; | |
4775 | 451 struct buddy *b; |
452 struct group *g; | |
2681 | 453 |
454 while (l) { | |
455 char **lines; | |
456 char **split; | |
457 char **buddies; | |
458 char **tmp, **bud; | |
459 | |
460 struct yahoo_pair *pair = l->data; | |
461 l = l->next; | |
462 | |
463 if (pair->key != 87) | |
464 continue; | |
465 | |
466 lines = g_strsplit(pair->value, "\n", -1); | |
467 for (tmp = lines; *tmp; tmp++) { | |
468 split = g_strsplit(*tmp, ":", 2); | |
2697
7759f914a009
[gaim-migrate @ 2710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
469 if (!split) |
7759f914a009
[gaim-migrate @ 2710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
470 continue; |
2702
94b4271b9567
[gaim-migrate @ 2715]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2697
diff
changeset
|
471 if (!split[0] || !split[1]) { |
2697
7759f914a009
[gaim-migrate @ 2710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
472 g_strfreev(split); |
7759f914a009
[gaim-migrate @ 2710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
473 continue; |
7759f914a009
[gaim-migrate @ 2710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
474 } |
2681 | 475 buddies = g_strsplit(split[1], ",", -1); |
2697
7759f914a009
[gaim-migrate @ 2710]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
476 for (bud = buddies; bud && *bud; bud++) |
4775 | 477 if (!(b = gaim_find_buddy(gc->account, *bud))) { |
478 if (!(g = gaim_find_group(split[0]))) { | |
479 g = gaim_group_new(split[0]); | |
480 gaim_blist_add_group(g, NULL); | |
481 } | |
482 b = gaim_buddy_new(gc->account, *bud, NULL); | |
483 gaim_blist_add_buddy(b, g, NULL); | |
2681 | 484 export = TRUE; |
485 } | |
486 g_strfreev(buddies); | |
487 g_strfreev(split); | |
488 } | |
489 g_strfreev(lines); | |
490 } | |
491 | |
492 if (export) | |
4349 | 493 gaim_blist_save(); |
2681 | 494 } |
495 | |
5583 | 496 static void yahoo_process_notify(GaimConnection *gc, struct yahoo_packet *pkt) |
2993 | 497 { |
498 char *msg = NULL; | |
499 char *from = NULL; | |
3019 | 500 char *stat = NULL; |
501 char *game = NULL; | |
2993 | 502 GSList *l = pkt->hash; |
3019 | 503 struct yahoo_data *yd = (struct yahoo_data*) gc->proto_data; |
2993 | 504 while (l) { |
505 struct yahoo_pair *pair = l->data; | |
506 if (pair->key == 4) | |
507 from = pair->value; | |
508 if (pair->key == 49) | |
509 msg = pair->value; | |
3001 | 510 if (pair->key == 13) |
3019 | 511 stat = pair->value; |
512 if (pair->key == 14) | |
513 game = pair->value; | |
2993 | 514 l = l->next; |
515 } | |
3640 | 516 |
517 if (!msg) | |
518 return; | |
3019 | 519 |
4793 | 520 if (!g_ascii_strncasecmp(msg, "TYPING", strlen("TYPING"))) { |
3019 | 521 if (*stat == '1') |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
522 serv_got_typing(gc, from, 0, GAIM_TYPING); |
3019 | 523 else |
524 serv_got_typing_stopped(gc, from); | |
4793 | 525 } else if (!g_ascii_strncasecmp(msg, "GAME", strlen("GAME"))) { |
4687 | 526 struct buddy *bud = gaim_find_buddy(gc->account, from); |
3019 | 527 void *free1=NULL, *free2=NULL; |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
528 if (!bud) { |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
529 gaim_debug(GAIM_DEBUG_WARNING, "yahoo", |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
530 "%s is playing a game, and doesn't want " |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
531 "you to know.\n", from); |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
532 } |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
533 |
3019 | 534 if (*stat == '1') { |
535 if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) { | |
536 g_free(free1); | |
537 g_free(free2); | |
538 } | |
539 g_hash_table_insert (yd->games, g_strdup(from), g_strdup(game)); | |
3020 | 540 if (bud) |
4732 | 541 serv_got_update(gc, from, 1, 0, 0, 0, bud->uc | YAHOO_STATUS_GAME); |
3019 | 542 } else { |
543 if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) { | |
544 g_free(free1); | |
545 g_free(free2); | |
546 g_hash_table_remove (yd->games, from); | |
547 } | |
3020 | 548 if (bud) |
4732 | 549 serv_got_update(gc, from, 1, 0, 0, 0, bud->uc & ~YAHOO_STATUS_GAME); |
3019 | 550 } |
551 } | |
2993 | 552 } |
553 | |
5583 | 554 static void yahoo_process_message(GaimConnection *gc, struct yahoo_packet *pkt) |
2681 | 555 { |
556 char *msg = NULL; | |
557 char *from = NULL; | |
558 time_t tm = time(NULL); | |
559 GSList *l = pkt->hash; | |
560 | |
3021 | 561 if (pkt->status <= 1 || pkt->status == 5) { |
6069 | 562 while (l) { |
563 struct yahoo_pair *pair = l->data; | |
564 if (pair->key == 4) | |
565 from = pair->value; | |
566 if (pair->key == 15) | |
567 tm = strtol(pair->value, NULL, 10); | |
568 if (pair->key == 14) { | |
569 char *m; | |
570 | |
571 msg = pair->value; | |
572 | |
573 strip_linefeed(msg); | |
6513 | 574 m = yahoo_codes_to_html(msg); |
575 serv_got_im(gc, from, m, 0, tm, -1); | |
576 g_free(m); | |
6069 | 577 |
578 tm = time(NULL); | |
2715
e901fd3ebbad
[gaim-migrate @ 2728]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2708
diff
changeset
|
579 } |
6069 | 580 l = l->next; |
2715
e901fd3ebbad
[gaim-migrate @ 2728]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2708
diff
changeset
|
581 } |
2681 | 582 } else if (pkt->status == 2) { |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5367
diff
changeset
|
583 gaim_notify_error(gc, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5367
diff
changeset
|
584 _("Your Yahoo! message did not get sent."), NULL); |
2681 | 585 } |
586 } | |
587 | |
588 | |
5583 | 589 static void yahoo_process_contact(GaimConnection *gc, struct yahoo_packet *pkt) |
2681 | 590 { |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
591 struct yahoo_data *yd = gc->proto_data; |
2681 | 592 char *id = NULL; |
593 char *who = NULL; | |
594 char *msg = NULL; | |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
595 char *name = NULL; |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
596 int state = YAHOO_STATUS_AVAILABLE; |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
597 int online = FALSE; |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
598 |
2681 | 599 GSList *l = pkt->hash; |
600 | |
601 while (l) { | |
602 struct yahoo_pair *pair = l->data; | |
603 if (pair->key == 1) | |
604 id = pair->value; | |
605 else if (pair->key == 3) | |
606 who = pair->value; | |
607 else if (pair->key == 14) | |
608 msg = pair->value; | |
5002 | 609 else if (pair->key == 7) |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
610 name = pair->value; |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
611 else if (pair->key == 10) |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
612 state = strtol(pair->value, NULL, 10); |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
613 else if (pair->key == 13) |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
614 online = strtol(pair->value, NULL, 10); |
2681 | 615 l = l->next; |
616 } | |
617 | |
2682
db2b0b733732
[gaim-migrate @ 2695]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2681
diff
changeset
|
618 if (id) |
db2b0b733732
[gaim-migrate @ 2695]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2681
diff
changeset
|
619 show_got_added(gc, id, who, NULL, msg); |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
620 if (name) { |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
621 if (state == YAHOO_STATUS_AVAILABLE) |
4732 | 622 serv_got_update(gc, name, 1, 0, 0, 0, 0); |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
623 else if (state == YAHOO_STATUS_IDLE) |
5002 | 624 serv_got_update(gc, name, 1, 0, 0, -1, (state << 2)); |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
625 else |
4732 | 626 serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE); |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
627 if (state == YAHOO_STATUS_CUSTOM) { |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
628 gpointer val = g_hash_table_lookup(yd->hash, name); |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
629 if (val) { |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
630 g_free(val); |
2873
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
631 g_hash_table_insert(yd->hash, name, |
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
632 msg ? g_strdup(msg) : g_malloc0(1)); |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
633 } else |
2873
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
634 g_hash_table_insert(yd->hash, g_strdup(name), |
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
635 msg ? g_strdup(msg) : g_malloc0(1)); |
2683
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
636 } |
4836eae8dd8c
[gaim-migrate @ 2696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2682
diff
changeset
|
637 } |
2681 | 638 } |
639 | |
5583 | 640 static void yahoo_process_mail(GaimConnection *gc, struct yahoo_packet *pkt) |
2681 | 641 { |
5583 | 642 GaimAccount *account = gaim_connection_get_account(gc); |
2681 | 643 char *who = NULL; |
644 char *email = NULL; | |
645 char *subj = NULL; | |
646 int count = 0; | |
647 GSList *l = pkt->hash; | |
648 | |
5583 | 649 if (!gaim_account_get_check_mail(account)) |
5521
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
650 return; |
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
651 |
2681 | 652 while (l) { |
653 struct yahoo_pair *pair = l->data; | |
654 if (pair->key == 9) | |
655 count = strtol(pair->value, NULL, 10); | |
656 else if (pair->key == 43) | |
657 who = pair->value; | |
658 else if (pair->key == 42) | |
659 email = pair->value; | |
660 else if (pair->key == 18) | |
661 subj = pair->value; | |
662 l = l->next; | |
663 } | |
664 | |
4001 | 665 if (who && subj && email && *email) { |
2850
cbe6a1e63a72
[gaim-migrate @ 2863]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2813
diff
changeset
|
666 char *from = g_strdup_printf("%s (%s)", who, email); |
5521
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
667 |
5583 | 668 gaim_notify_email(gc, subj, from, gaim_account_get_username(account), |
5521
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
669 "http://mail.yahoo.com/", NULL, NULL); |
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
670 |
2850
cbe6a1e63a72
[gaim-migrate @ 2863]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2813
diff
changeset
|
671 g_free(from); |
5521
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
672 } else if (count > 0) { |
5583 | 673 const char *to = gaim_account_get_username(account); |
5521
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
674 const char *url = "http://mail.yahoo.com/"; |
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
675 |
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
676 gaim_notify_emails(gc, count, FALSE, NULL, NULL, &to, &url, |
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
677 NULL, NULL); |
76ec14ba51d7
[gaim-migrate @ 5921]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
678 } |
2681 | 679 } |
3147 | 680 /* This is the y64 alphabet... it's like base64, but has a . and a _ */ |
681 char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._"; | |
682 | |
683 /* This is taken from Sylpheed by Hiroyuki Yamamoto. We have our own tobase64 function | |
684 * in util.c, but it has a bug I don't feel like finding right now ;) */ | |
685 void to_y64(unsigned char *out, const unsigned char *in, int inlen) | |
686 /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */ | |
687 { | |
688 for (; inlen >= 3; inlen -= 3) | |
689 { | |
690 *out++ = base64digits[in[0] >> 2]; | |
691 *out++ = base64digits[((in[0] << 4) & 0x30) | (in[1] >> 4)]; | |
692 *out++ = base64digits[((in[1] << 2) & 0x3c) | (in[2] >> 6)]; | |
693 *out++ = base64digits[in[2] & 0x3f]; | |
694 in += 3; | |
695 } | |
696 if (inlen > 0) | |
697 { | |
698 unsigned char fragment; | |
699 | |
700 *out++ = base64digits[in[0] >> 2]; | |
701 fragment = (in[0] << 4) & 0x30; | |
702 if (inlen > 1) | |
703 fragment |= in[1] >> 4; | |
704 *out++ = base64digits[fragment]; | |
705 *out++ = (inlen < 2) ? '-' : base64digits[(in[1] << 2) & 0x3c]; | |
706 *out++ = '-'; | |
707 } | |
708 *out = '\0'; | |
709 } | |
710 | |
5583 | 711 static void yahoo_process_auth(GaimConnection *gc, struct yahoo_packet *pkt) |
3147 | 712 { |
713 char *seed = NULL; | |
714 char *sn = NULL; | |
715 GSList *l = pkt->hash; | |
716 struct yahoo_data *yd = gc->proto_data; | |
717 | |
718 while (l) { | |
719 struct yahoo_pair *pair = l->data; | |
720 if (pair->key == 94) | |
721 seed = pair->value; | |
722 if (pair->key == 1) | |
723 sn = pair->value; | |
724 l = l->next; | |
725 } | |
726 | |
727 if (seed) { | |
728 struct yahoo_packet *pack; | |
5583 | 729 GaimAccount *account = gaim_connection_get_account(gc); |
5921 | 730 const char *name = normalize(gaim_account_get_username(account)); |
5583 | 731 const char *pass = gaim_account_get_password(account); |
732 | |
3147 | 733 /* So, Yahoo has stopped supporting its older clients in India, and undoubtedly |
734 * will soon do so in the rest of the world. | |
735 * | |
736 * The new clients use this authentication method. I warn you in advance, it's | |
737 * bizzare, convoluted, inordinately complicated. It's also no more secure than | |
738 * crypt() was. The only purpose this scheme could serve is to prevent third | |
739 * part clients from connecting to their servers. | |
740 * | |
741 * Sorry, Yahoo. | |
742 */ | |
743 | |
744 md5_byte_t result[16]; | |
745 md5_state_t ctx; | |
5583 | 746 |
3147 | 747 char *crypt_result; |
5583 | 748 char password_hash[25]; |
749 char crypt_hash[25]; | |
3147 | 750 char *hash_string_p = g_malloc(50 + strlen(sn)); |
751 char *hash_string_c = g_malloc(50 + strlen(sn)); | |
752 | |
753 char checksum; | |
754 | |
3157 | 755 int sv; |
3147 | 756 |
5583 | 757 char result6[25]; |
758 char result96[25]; | |
3147 | 759 |
760 sv = seed[15]; | |
3157 | 761 sv = sv % 8; |
3147 | 762 |
763 md5_init(&ctx); | |
5583 | 764 md5_append(&ctx, pass, strlen(pass)); |
3147 | 765 md5_finish(&ctx, result); |
766 to_y64(password_hash, result, 16); | |
767 | |
768 md5_init(&ctx); | |
5583 | 769 crypt_result = yahoo_crypt(pass, "$1$_2S43d5f$"); |
3147 | 770 md5_append(&ctx, crypt_result, strlen(crypt_result)); |
771 md5_finish(&ctx, result); | |
772 to_y64(crypt_hash, result, 16); | |
3157 | 773 |
774 switch (sv) { | |
3147 | 775 case 1: |
776 case 6: | |
3157 | 777 checksum = seed[seed[9] % 16]; |
3147 | 778 g_snprintf(hash_string_p, strlen(sn) + 50, |
5583 | 779 "%c%s%s%s", checksum, name, seed, password_hash); |
3157 | 780 g_snprintf(hash_string_c, strlen(sn) + 50, |
5583 | 781 "%c%s%s%s", checksum, name, seed, crypt_hash); |
3147 | 782 break; |
783 case 2: | |
784 case 7: | |
3157 | 785 checksum = seed[seed[15] % 16]; |
3147 | 786 g_snprintf(hash_string_p, strlen(sn) + 50, |
5583 | 787 "%c%s%s%s", checksum, seed, password_hash, name); |
3157 | 788 g_snprintf(hash_string_c, strlen(sn) + 50, |
5583 | 789 "%c%s%s%s", checksum, seed, crypt_hash, name); |
3157 | 790 break; |
3147 | 791 case 3: |
3157 | 792 checksum = seed[seed[1] % 16]; |
3147 | 793 g_snprintf(hash_string_p, strlen(sn) + 50, |
5583 | 794 "%c%s%s%s", checksum, name, password_hash, seed); |
3157 | 795 g_snprintf(hash_string_c, strlen(sn) + 50, |
5583 | 796 "%c%s%s%s", checksum, name, crypt_hash, seed); |
3157 | 797 break; |
798 case 4: | |
799 checksum = seed[seed[3] % 16]; | |
800 g_snprintf(hash_string_p, strlen(sn) + 50, | |
5583 | 801 "%c%s%s%s", checksum, password_hash, seed, name); |
3147 | 802 g_snprintf(hash_string_c, strlen(sn) + 50, |
5583 | 803 "%c%s%s%s", checksum, crypt_hash, seed, name); |
3157 | 804 break; |
3147 | 805 case 0: |
806 case 5: | |
3157 | 807 checksum = seed[seed[7] % 16]; |
3147 | 808 g_snprintf(hash_string_p, strlen(sn) + 50, |
5583 | 809 "%c%s%s%s", checksum, password_hash, name, seed); |
3157 | 810 g_snprintf(hash_string_c, strlen(sn) + 50, |
5583 | 811 "%c%s%s%s", checksum, crypt_hash, name, seed); |
3157 | 812 break; |
3147 | 813 } |
3157 | 814 |
3147 | 815 md5_init(&ctx); |
3157 | 816 md5_append(&ctx, hash_string_p, strlen(hash_string_p)); |
3147 | 817 md5_finish(&ctx, result); |
818 to_y64(result6, result, 16); | |
819 | |
820 md5_init(&ctx); | |
821 md5_append(&ctx, hash_string_c, strlen(hash_string_c)); | |
822 md5_finish(&ctx, result); | |
823 to_y64(result96, result, 16); | |
824 | |
825 pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP, YAHOO_STATUS_AVAILABLE, 0); | |
5583 | 826 yahoo_packet_hash(pack, 0, name); |
3147 | 827 yahoo_packet_hash(pack, 6, result6); |
828 yahoo_packet_hash(pack, 96, result96); | |
5583 | 829 yahoo_packet_hash(pack, 1, name); |
3147 | 830 |
831 yahoo_send_packet(yd, pack); | |
832 | |
833 g_free(hash_string_p); | |
834 g_free(hash_string_c); | |
835 | |
836 yahoo_packet_free(pack); | |
837 } | |
838 } | |
2681 | 839 |
5583 | 840 static void yahoo_packet_process(GaimConnection *gc, struct yahoo_packet *pkt) |
2681 | 841 { |
842 switch (pkt->service) | |
843 { | |
844 case YAHOO_SERVICE_LOGON: | |
2771
450f4f9d2f23
[gaim-migrate @ 2784]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2741
diff
changeset
|
845 case YAHOO_SERVICE_LOGOFF: |
2681 | 846 case YAHOO_SERVICE_ISAWAY: |
2737
f61c1f3a6afa
[gaim-migrate @ 2750]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2724
diff
changeset
|
847 case YAHOO_SERVICE_ISBACK: |
3019 | 848 case YAHOO_SERVICE_GAMELOGON: |
849 case YAHOO_SERVICE_GAMELOGOFF: | |
2681 | 850 yahoo_process_status(gc, pkt); |
851 break; | |
3019 | 852 case YAHOO_SERVICE_NOTIFY: |
853 yahoo_process_notify(gc, pkt); | |
2993 | 854 break; |
2681 | 855 case YAHOO_SERVICE_MESSAGE: |
2786
318f846120e2
[gaim-migrate @ 2799]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2772
diff
changeset
|
856 case YAHOO_SERVICE_GAMEMSG: |
5939 | 857 case YAHOO_SERVICE_CHATMSG: |
2681 | 858 yahoo_process_message(gc, pkt); |
859 break; | |
860 case YAHOO_SERVICE_NEWMAIL: | |
861 yahoo_process_mail(gc, pkt); | |
862 break; | |
863 case YAHOO_SERVICE_NEWCONTACT: | |
864 yahoo_process_contact(gc, pkt); | |
865 break; | |
866 case YAHOO_SERVICE_LIST: | |
867 yahoo_process_list(gc, pkt); | |
868 break; | |
3147 | 869 case YAHOO_SERVICE_AUTH: |
870 yahoo_process_auth(gc, pkt); | |
871 break; | |
2681 | 872 default: |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
873 gaim_debug(GAIM_DEBUG_ERROR, "yahoo", |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
874 "Unhandled service 0x%02x\n", pkt->service); |
2681 | 875 break; |
876 } | |
877 } | |
878 | |
879 static void yahoo_pending(gpointer data, gint source, GaimInputCondition cond) | |
880 { | |
5583 | 881 GaimConnection *gc = data; |
2681 | 882 struct yahoo_data *yd = gc->proto_data; |
883 char buf[1024]; | |
884 int len; | |
885 | |
886 len = read(yd->fd, buf, sizeof(buf)); | |
887 | |
888 if (len <= 0) { | |
6321 | 889 gaim_connection_error(gc, _("Unable to read")); |
2681 | 890 return; |
891 } | |
892 | |
893 yd->rxqueue = g_realloc(yd->rxqueue, len + yd->rxlen); | |
894 memcpy(yd->rxqueue + yd->rxlen, buf, len); | |
895 yd->rxlen += len; | |
896 | |
897 while (1) { | |
898 struct yahoo_packet *pkt; | |
899 int pos = 0; | |
900 int pktlen; | |
901 | |
902 if (yd->rxlen < YAHOO_PACKET_HDRLEN) | |
903 return; | |
904 | |
905 pos += 4; /* YMSG */ | |
906 pos += 2; | |
907 pos += 2; | |
908 | |
909 pktlen = yahoo_get16(yd->rxqueue + pos); pos += 2; | |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
910 gaim_debug(GAIM_DEBUG_MISC, "yahoo", |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
911 "%d bytes to read, rxlen is %d\n", pktlen, yd->rxlen); |
2681 | 912 |
913 if (yd->rxlen < (YAHOO_PACKET_HDRLEN + pktlen)) | |
914 return; | |
915 | |
916 yahoo_packet_dump(yd->rxqueue, YAHOO_PACKET_HDRLEN + pktlen); | |
917 | |
918 pkt = yahoo_packet_new(0, 0, 0); | |
919 | |
920 pkt->service = yahoo_get16(yd->rxqueue + pos); pos += 2; | |
3021 | 921 pkt->status = yahoo_get32(yd->rxqueue + pos); pos += 4; |
5220
7b9d78fa051e
[gaim-migrate @ 5590]
Christian Hammond <chipx86@chipx86.com>
parents:
5216
diff
changeset
|
922 gaim_debug(GAIM_DEBUG_MISC, "yahoo", |
5216
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
923 "Yahoo Service: 0x%02x Status: %d\n", |
00bd3019749e
[gaim-migrate @ 5586]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
924 pkt->service, pkt->status); |
2681 | 925 pkt->id = yahoo_get32(yd->rxqueue + pos); pos += 4; |
926 | |
927 yahoo_packet_read(pkt, yd->rxqueue + pos, pktlen); | |
928 | |
929 yd->rxlen -= YAHOO_PACKET_HDRLEN + pktlen; | |
930 if (yd->rxlen) { | |
931 char *tmp = g_memdup(yd->rxqueue + YAHOO_PACKET_HDRLEN + pktlen, yd->rxlen); | |
932 g_free(yd->rxqueue); | |
933 yd->rxqueue = tmp; | |
934 } else { | |
935 g_free(yd->rxqueue); | |
936 yd->rxqueue = NULL; | |
937 } | |
938 | |
939 yahoo_packet_process(gc, pkt); | |
940 | |
941 yahoo_packet_free(pkt); | |
942 } | |
943 } | |
944 | |
945 static void yahoo_got_connected(gpointer data, gint source, GaimInputCondition cond) | |
946 { | |
5583 | 947 GaimConnection *gc = data; |
2681 | 948 struct yahoo_data *yd; |
949 struct yahoo_packet *pkt; | |
950 | |
5590
011a0a975060
[gaim-migrate @ 5994]
Christian Hammond <chipx86@chipx86.com>
parents:
5583
diff
changeset
|
951 if (!g_list_find(gaim_connections_get_all(), gc)) { |
2681 | 952 close(source); |
953 return; | |
954 } | |
955 | |
956 if (source < 0) { | |
6321 | 957 gaim_connection_error(gc, _("Unable to connect")); |
2681 | 958 return; |
959 } | |
960 | |
961 yd = gc->proto_data; | |
962 yd->fd = source; | |
963 | |
3147 | 964 pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH, YAHOO_STATUS_AVAILABLE, 0); |
2681 | 965 |
5921 | 966 yahoo_packet_hash(pkt, 1, normalize(gaim_account_get_username(gaim_connection_get_account(gc)))); |
2681 | 967 yahoo_send_packet(yd, pkt); |
968 | |
969 yahoo_packet_free(pkt); | |
970 | |
971 gc->inpa = gaim_input_add(yd->fd, GAIM_INPUT_READ, yahoo_pending, gc); | |
972 } | |
973 | |
5583 | 974 static void yahoo_login(GaimAccount *account) { |
975 GaimConnection *gc = gaim_account_get_connection(account); | |
2681 | 976 struct yahoo_data *yd = gc->proto_data = g_new0(struct yahoo_data, 1); |
977 | |
5583 | 978 gaim_connection_update_progress(gc, _("Connecting"), 1, 2); |
2681 | 979 |
980 yd->fd = -1; | |
981 yd->hash = g_hash_table_new(g_str_hash, g_str_equal); | |
3019 | 982 yd->games = g_hash_table_new(g_str_hash, g_str_equal); |
2681 | 983 |
5681
46d7ad0dfa26
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
984 if (gaim_proxy_connect(account, gaim_account_get_string(account, "server", YAHOO_PAGER_HOST), |
5583 | 985 gaim_account_get_int(account, "port", YAHOO_PAGER_PORT), |
986 yahoo_got_connected, gc) != 0) { | |
6321 | 987 gaim_connection_error(gc, _("Connection problem")); |
2681 | 988 return; |
989 } | |
990 | |
991 } | |
992 | |
993 static gboolean yahoo_destroy_hash(gpointer key, gpointer val, gpointer data) | |
994 { | |
995 g_free(key); | |
996 g_free(val); | |
997 return TRUE; | |
998 } | |
999 | |
5583 | 1000 static void yahoo_close(GaimConnection *gc) { |
2681 | 1001 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; |
1002 g_hash_table_foreach_remove(yd->hash, yahoo_destroy_hash, NULL); | |
1003 g_hash_table_destroy(yd->hash); | |
3019 | 1004 g_hash_table_foreach_remove(yd->games, yahoo_destroy_hash, NULL); |
1005 g_hash_table_destroy(yd->games); | |
2681 | 1006 if (yd->fd >= 0) |
1007 close(yd->fd); | |
3720
34c95669952f
[gaim-migrate @ 3853]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3642
diff
changeset
|
1008 |
2681 | 1009 if (yd->rxqueue) |
1010 g_free(yd->rxqueue); | |
2687
2d544f48146d
[gaim-migrate @ 2700]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2686
diff
changeset
|
1011 yd->rxlen = 0; |
2681 | 1012 if (gc->inpa) |
1013 gaim_input_remove(gc->inpa); | |
1014 g_free(yd); | |
1015 } | |
1016 | |
5583 | 1017 static const char *yahoo_list_icon(GaimAccount *a, struct buddy *b) |
2681 | 1018 { |
4687 | 1019 return "yahoo"; |
2681 | 1020 } |
4916 | 1021 |
1022 static void yahoo_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne) | |
1023 { | |
1024 int i = 0; | |
1025 char *emblems[4] = {NULL,NULL,NULL,NULL}; | |
5068 | 1026 if (b->present == GAIM_BUDDY_OFFLINE) { |
4916 | 1027 *se = "offline"; |
1028 return; | |
1029 } else { | |
1030 if (b->uc & UC_UNAVAILABLE) | |
1031 emblems[i++] = "away"; | |
1032 if (b->uc & YAHOO_STATUS_GAME) | |
1033 emblems[i++] = "game"; | |
1034 } | |
1035 *se = emblems[0]; | |
1036 *sw = emblems[1]; | |
1037 *nw = emblems[2]; | |
1038 *ne = emblems[3]; | |
1039 } | |
2681 | 1040 |
1041 static char *yahoo_get_status_string(enum yahoo_status a) | |
1042 { | |
1043 switch (a) { | |
1044 case YAHOO_STATUS_BRB: | |
4596 | 1045 return _("Be Right Back"); |
2681 | 1046 case YAHOO_STATUS_BUSY: |
4596 | 1047 return _("Busy"); |
2681 | 1048 case YAHOO_STATUS_NOTATHOME: |
4596 | 1049 return _("Not At Home"); |
2681 | 1050 case YAHOO_STATUS_NOTATDESK: |
4596 | 1051 return _("Not At Desk"); |
2681 | 1052 case YAHOO_STATUS_NOTINOFFICE: |
4596 | 1053 return _("Not In Office"); |
2681 | 1054 case YAHOO_STATUS_ONPHONE: |
4606 | 1055 return _("On The Phone"); |
2681 | 1056 case YAHOO_STATUS_ONVACATION: |
4596 | 1057 return _("On Vacation"); |
2681 | 1058 case YAHOO_STATUS_OUTTOLUNCH: |
4596 | 1059 return _("Out To Lunch"); |
2681 | 1060 case YAHOO_STATUS_STEPPEDOUT: |
4596 | 1061 return _("Stepped Out"); |
2873
26be84883f91
[gaim-migrate @ 2886]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2856
diff
changeset
|
1062 case YAHOO_STATUS_INVISIBLE: |
4596 | 1063 return _("Invisible"); |
4730 | 1064 case YAHOO_STATUS_IDLE: |
1065 return _("Idle"); | |
2879
5fc5123b7098
[gaim-migrate @ 2892]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2878
diff
changeset
|
1066 default: |
4596 | 1067 return _("Online"); |
2681 | 1068 } |
1069 } | |
1070 | |
5583 | 1071 static void yahoo_game(GaimConnection *gc, const char *name) { |
3019 | 1072 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; |
1073 char *game = g_hash_table_lookup(yd->games, name); | |
1074 char *t; | |
1075 char url[256]; | |
1076 | |
1077 if (!game) | |
1078 return; | |
1079 t = game = g_strdup(strstr(game, "ante?room=")); | |
1080 while (*t != '\t') | |
1081 t++; | |
1082 *t = 0; | |
1083 g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game); | |
6465
fb64cc87bc96
[gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
1084 gaim_notify_uri(gc, url); |
3019 | 1085 g_free(game); |
1086 } | |
4722 | 1087 |
4732 | 1088 static char *yahoo_status_text(struct buddy *b) |
4722 | 1089 { |
1090 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data; | |
4730 | 1091 if (b->uc & UC_UNAVAILABLE) { |
4732 | 1092 if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM) |
1093 return g_strdup(yahoo_get_status_string(b->uc >> 2)); | |
4777 | 1094 else { |
1095 char *stripped = strip_html(g_hash_table_lookup(yd->hash, b->name)); | |
1096 if(stripped) { | |
1097 char *ret = g_markup_escape_text(stripped, strlen(stripped)); | |
1098 g_free(stripped); | |
1099 return ret; | |
1100 } | |
1101 } | |
4722 | 1102 } |
4729 | 1103 return NULL; |
4722 | 1104 } |
1105 | |
4724 | 1106 static char *yahoo_tooltip_text(struct buddy *b) |
1107 { | |
1108 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data; | |
4730 | 1109 if (b->uc & UC_UNAVAILABLE) { |
4745 | 1110 char *status; |
1111 char *ret; | |
4731 | 1112 if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM) |
4745 | 1113 status = g_strdup(yahoo_get_status_string(b->uc >> 2)); |
4724 | 1114 else |
4745 | 1115 status = strip_html(g_hash_table_lookup(yd->hash, b->name)); |
1116 if(status) { | |
4777 | 1117 char *escaped = g_markup_escape_text(status, strlen(status)); |
1118 ret = g_strdup_printf(_("<b>Status:</b> %s"), escaped); | |
4745 | 1119 g_free(status); |
4777 | 1120 g_free(escaped); |
4745 | 1121 return ret; |
1122 } | |
4724 | 1123 } |
4729 | 1124 return NULL; |
1125 } | |
1126 | |
5583 | 1127 static GList *yahoo_buddy_menu(GaimConnection *gc, const char *who) |
2681 | 1128 { |
1129 GList *m = NULL; | |
1130 struct proto_buddy_menu *pbm; | |
1131 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | |
4687 | 1132 struct buddy *b = gaim_find_buddy(gc->account, who); /* this should never be null. if it is, |
2681 | 1133 segfault and get the bug report. */ |
3019 | 1134 static char buf2[1024]; |
4722 | 1135 |
3019 | 1136 if (b->uc | YAHOO_STATUS_GAME) { |
1137 char *game = g_hash_table_lookup(yd->games, b->name); | |
1138 char *room; | |
1139 if (!game) | |
1140 return m; | |
1141 if (game) { | |
1142 char *t; | |
1143 pbm = g_new0(struct proto_buddy_menu, 1); | |
1144 if (!(room = strstr(game, "&follow="))) /* skip ahead to the url */ | |
1145 return NULL; | |
1146 while (*room && *room != '\t') /* skip to the tab */ | |
1147 room++; | |
1148 t = room++; /* room as now at the name */ | |
1149 while (*t != '\n') | |
1150 t++; /* replace the \n with a space */ | |
1151 *t = ' '; | |
1152 g_snprintf(buf2, sizeof buf2, "%s", room); | |
1153 pbm->label = buf2; | |
1154 pbm->callback = yahoo_game; | |
1155 pbm->gc = gc; | |
1156 m = g_list_append(m, pbm); | |
1157 } | |
1158 } | |
4722 | 1159 |
2681 | 1160 return m; |
1161 } | |
1162 | |
5583 | 1163 static void yahoo_act_id(GaimConnection *gc, const char *entry) |
2681 | 1164 { |
1165 struct yahoo_data *yd = gc->proto_data; | |
1166 | |
1167 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_IDACT, YAHOO_STATUS_AVAILABLE, 0); | |
1168 yahoo_packet_hash(pkt, 3, entry); | |
1169 yahoo_send_packet(yd, pkt); | |
1170 yahoo_packet_free(pkt); | |
1171 | |
5583 | 1172 gaim_connection_set_display_name(gc, entry); |
2681 | 1173 } |
1174 | |
5583 | 1175 static void yahoo_show_act_id(GaimConnection *gc) |
2681 | 1176 { |
5493
3e8487580024
[gaim-migrate @ 5889]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
1177 gaim_request_input(gc, NULL, _("Active which ID?"), NULL, |
6035
8c44020a958e
[gaim-migrate @ 6485]
Christian Hammond <chipx86@chipx86.com>
parents:
5939
diff
changeset
|
1178 gaim_connection_get_display_name(gc), FALSE, FALSE, |
5493
3e8487580024
[gaim-migrate @ 5889]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
1179 _("OK"), G_CALLBACK(yahoo_act_id), |
3e8487580024
[gaim-migrate @ 5889]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
1180 _("Cancel"), NULL, gc); |
2681 | 1181 } |
1182 | |
5583 | 1183 static GList *yahoo_actions(GaimConnection *gc) { |
2681 | 1184 GList *m = NULL; |
4333 | 1185 struct proto_actions_menu *pam; |
2681 | 1186 |
4333 | 1187 pam = g_new0(struct proto_actions_menu, 1); |
1188 pam->label = _("Activate ID"); | |
1189 pam->callback = yahoo_show_act_id; | |
1190 pam->gc = gc; | |
1191 m = g_list_append(m, pam); | |
2681 | 1192 |
1193 return m; | |
1194 } | |
1195 | |
5583 | 1196 static int yahoo_send_im(GaimConnection *gc, const char *who, const char *what, int len, int flags) |
2681 | 1197 { |
1198 struct yahoo_data *yd = gc->proto_data; | |
1199 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, YAHOO_STATUS_OFFLINE, 0); | |
3642 | 1200 char *msg = g_strdup(what); |
2681 | 1201 |
5583 | 1202 yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); |
2681 | 1203 yahoo_packet_hash(pkt, 5, who); |
3493 | 1204 yahoo_packet_hash(pkt, 14, msg); |
6044 | 1205 yahoo_packet_hash(pkt, 97, "1"); |
2681 | 1206 |
1207 yahoo_send_packet(yd, pkt); | |
1208 | |
1209 yahoo_packet_free(pkt); | |
3493 | 1210 |
2681 | 1211 return 1; |
1212 } | |
1213 | |
6059 | 1214 int yahoo_send_typing(GaimConnection *gc, const char *who, int typ) |
2993 | 1215 { |
1216 struct yahoo_data *yd = gc->proto_data; | |
3019 | 1217 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_NOTIFY, YAHOO_STATUS_TYPING, 0); |
2993 | 1218 yahoo_packet_hash(pkt, 49, "TYPING"); |
5583 | 1219 yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); |
2993 | 1220 yahoo_packet_hash(pkt, 14, " "); |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5685
diff
changeset
|
1221 yahoo_packet_hash(pkt, 13, typ == GAIM_TYPING ? "1" : "0"); |
2993 | 1222 yahoo_packet_hash(pkt, 5, who); |
1223 yahoo_packet_hash(pkt, 1002, "1"); | |
1224 | |
1225 yahoo_send_packet(yd, pkt); | |
1226 | |
1227 yahoo_packet_free(pkt); | |
1228 | |
3001 | 1229 return 0; |
2993 | 1230 } |
1231 | |
6059 | 1232 static void yahoo_set_away(GaimConnection *gc, const char *state, const char *msg) |
2681 | 1233 { |
1234 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | |
1235 struct yahoo_packet *pkt; | |
2772
f9227268db25
[gaim-migrate @ 2785]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2771
diff
changeset
|
1236 int service; |
2681 | 1237 char s[4]; |
1238 | |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1239 if (gc->away) { |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1240 g_free(gc->away); |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1241 gc->away = NULL; |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1242 } |
2681 | 1243 |
1244 if (msg) { | |
1245 yd->current_status = YAHOO_STATUS_CUSTOM; | |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1246 gc->away = g_strdup(msg); |
2681 | 1247 } else if (state) { |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1248 gc->away = g_strdup(""); |
4596 | 1249 if (!strcmp(state, _("Available"))) { |
2681 | 1250 yd->current_status = YAHOO_STATUS_AVAILABLE; |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1251 g_free(gc->away); |
2681 | 1252 gc->away = NULL; |
4596 | 1253 } else if (!strcmp(state, _("Be Right Back"))) { |
2681 | 1254 yd->current_status = YAHOO_STATUS_BRB; |
4596 | 1255 } else if (!strcmp(state, _("Busy"))) { |
2681 | 1256 yd->current_status = YAHOO_STATUS_BUSY; |
4596 | 1257 } else if (!strcmp(state, _("Not At Home"))) { |
2681 | 1258 yd->current_status = YAHOO_STATUS_NOTATHOME; |
4596 | 1259 } else if (!strcmp(state, _("Not At Desk"))) { |
2681 | 1260 yd->current_status = YAHOO_STATUS_NOTATDESK; |
4596 | 1261 } else if (!strcmp(state, _("Not In Office"))) { |
2681 | 1262 yd->current_status = YAHOO_STATUS_NOTINOFFICE; |
4606 | 1263 } else if (!strcmp(state, _("On The Phone"))) { |
2681 | 1264 yd->current_status = YAHOO_STATUS_ONPHONE; |
4596 | 1265 } else if (!strcmp(state, _("On Vacation"))) { |
2681 | 1266 yd->current_status = YAHOO_STATUS_ONVACATION; |
4596 | 1267 } else if (!strcmp(state, _("Out To Lunch"))) { |
2681 | 1268 yd->current_status = YAHOO_STATUS_OUTTOLUNCH; |
4596 | 1269 } else if (!strcmp(state, _("Stepped Out"))) { |
2681 | 1270 yd->current_status = YAHOO_STATUS_STEPPEDOUT; |
4596 | 1271 } else if (!strcmp(state, _("Invisible"))) { |
2681 | 1272 yd->current_status = YAHOO_STATUS_INVISIBLE; |
1273 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { | |
1274 if (gc->is_idle) { | |
1275 yd->current_status = YAHOO_STATUS_IDLE; | |
1276 } else { | |
1277 yd->current_status = YAHOO_STATUS_AVAILABLE; | |
1278 } | |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4044
diff
changeset
|
1279 g_free(gc->away); |
2681 | 1280 gc->away = NULL; |
1281 } | |
1282 } else if (gc->is_idle) { | |
1283 yd->current_status = YAHOO_STATUS_IDLE; | |
1284 } else { | |
1285 yd->current_status = YAHOO_STATUS_AVAILABLE; | |
1286 } | |
1287 | |
2772
f9227268db25
[gaim-migrate @ 2785]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2771
diff
changeset
|
1288 if (yd->current_status == YAHOO_STATUS_AVAILABLE) |
f9227268db25
[gaim-migrate @ 2785]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2771
diff
changeset
|
1289 service = YAHOO_SERVICE_ISBACK; |
f9227268db25
[gaim-migrate @ 2785]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2771
diff
changeset
|
1290 else |
f9227268db25
[gaim-migrate @ 2785]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2771
diff
changeset
|
1291 service = YAHOO_SERVICE_ISAWAY; |
f9227268db25
[gaim-migrate @ 2785]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2771
diff
changeset
|
1292 pkt = yahoo_packet_new(service, yd->current_status, 0); |
2681 | 1293 g_snprintf(s, sizeof(s), "%d", yd->current_status); |
1294 yahoo_packet_hash(pkt, 10, s); | |
1295 if (yd->current_status == YAHOO_STATUS_CUSTOM) | |
1296 yahoo_packet_hash(pkt, 19, msg); | |
1297 | |
1298 yahoo_send_packet(yd, pkt); | |
1299 yahoo_packet_free(pkt); | |
1300 } | |
1301 | |
5583 | 1302 static void yahoo_set_idle(GaimConnection *gc, int idle) |
2681 | 1303 { |
1304 struct yahoo_data *yd = gc->proto_data; | |
1305 struct yahoo_packet *pkt = NULL; | |
1306 | |
1307 if (idle && yd->current_status == YAHOO_STATUS_AVAILABLE) { | |
1308 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_IDLE, 0); | |
1309 yd->current_status = YAHOO_STATUS_IDLE; | |
1310 } else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) { | |
1311 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_AVAILABLE, 0); | |
1312 yd->current_status = YAHOO_STATUS_AVAILABLE; | |
1313 } | |
1314 | |
1315 if (pkt) { | |
1316 char buf[4]; | |
1317 g_snprintf(buf, sizeof(buf), "%d", yd->current_status); | |
1318 yahoo_packet_hash(pkt, 10, buf); | |
1319 yahoo_send_packet(yd, pkt); | |
1320 yahoo_packet_free(pkt); | |
1321 } | |
1322 } | |
1323 | |
5583 | 1324 static GList *yahoo_away_states(GaimConnection *gc) |
2681 | 1325 { |
1326 GList *m = NULL; | |
1327 | |
4596 | 1328 m = g_list_append(m, _("Available")); |
1329 m = g_list_append(m, _("Be Right Back")); | |
1330 m = g_list_append(m, _("Busy")); | |
1331 m = g_list_append(m, _("Not At Home")); | |
1332 m = g_list_append(m, _("Not At Desk")); | |
1333 m = g_list_append(m, _("Not In Office")); | |
4606 | 1334 m = g_list_append(m, _("On The Phone")); |
4596 | 1335 m = g_list_append(m, _("On Vacation")); |
1336 m = g_list_append(m, _("Out To Lunch")); | |
1337 m = g_list_append(m, _("Stepped Out")); | |
1338 m = g_list_append(m, _("Invisible")); | |
2681 | 1339 m = g_list_append(m, GAIM_AWAY_CUSTOM); |
1340 | |
1341 return m; | |
1342 } | |
1343 | |
5583 | 1344 static void yahoo_keepalive(GaimConnection *gc) |
2681 | 1345 { |
1346 struct yahoo_data *yd = gc->proto_data; | |
1347 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_PING, YAHOO_STATUS_AVAILABLE, 0); | |
1348 yahoo_send_packet(yd, pkt); | |
1349 yahoo_packet_free(pkt); | |
1350 } | |
1351 | |
5583 | 1352 static void yahoo_add_buddy(GaimConnection *gc, const char *who) |
2681 | 1353 { |
1354 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | |
1355 struct yahoo_packet *pkt; | |
1356 struct group *g; | |
1357 char *group = NULL; | |
1358 | |
1359 if (!yd->logged_in) | |
1360 return; | |
1361 | |
4687 | 1362 g = gaim_find_buddys_group(gaim_find_buddy(gc->account, who)); |
2681 | 1363 if (g) |
1364 group = g->name; | |
1365 else | |
1366 group = "Buddies"; | |
1367 | |
1368 pkt = yahoo_packet_new(YAHOO_SERVICE_ADDBUDDY, YAHOO_STATUS_AVAILABLE, 0); | |
5583 | 1369 yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); |
2681 | 1370 yahoo_packet_hash(pkt, 7, who); |
1371 yahoo_packet_hash(pkt, 65, group); | |
1372 yahoo_send_packet(yd, pkt); | |
1373 yahoo_packet_free(pkt); | |
1374 } | |
1375 | |
6059 | 1376 static void yahoo_remove_buddy(GaimConnection *gc, const char *who, const char *group) |
2681 | 1377 { |
1378 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | |
1379 | |
1380 struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_REMBUDDY, YAHOO_STATUS_AVAILABLE, 0); | |
5583 | 1381 yahoo_packet_hash(pkt, 1, gaim_connection_get_display_name(gc)); |
2681 | 1382 yahoo_packet_hash(pkt, 7, who); |
1383 yahoo_packet_hash(pkt, 65, group); | |
1384 yahoo_send_packet(yd, pkt); | |
1385 yahoo_packet_free(pkt); | |
1386 } | |
1387 | |
6513 | 1388 static gboolean yahoo_unload_plugin(GaimPlugin *plugin) |
1389 { | |
1390 yahoo_dest_colorht(); | |
1391 return TRUE; | |
1392 } | |
1393 | |
6514 | 1394 static void yahoo_got_info(gpointer data, char *url_text, unsigned long len) |
1395 { | |
1396 char *stripped,*p; | |
1397 char buf[1024]; | |
1398 | |
1399 /* we failed to grab the profile URL */ | |
1400 if (!url_text) { | |
1401 g_show_info_text(NULL, NULL, 2, | |
6573 | 1402 _("<html><body><b>Error retrieving profile</b></body></html>"), NULL); |
6514 | 1403 return; |
1404 } | |
1405 | |
1406 /* we don't yet support the multiple link level of the warning page for | |
1407 * 'adult' profiles, not to mention the fact that yahoo wants you to be | |
1408 * logged in (on the website) to be able to view an 'adult' profile. for | |
1409 * now, just tell them that we can't help them, and provide a link to the | |
1410 * profile if they want to do the web browser thing. | |
1411 */ | |
1412 p = strstr(url_text, "Adult Profiles Warning Message"); | |
1413 if (p) { | |
6573 | 1414 strcpy(buf, _("<b>Sorry, profiles marked as containing adult content are not supported at this time.</b><br><br>\n")); |
6514 | 1415 info_extract_field(url_text, buf, ".idname=", 0, "%26", 0, NULL, |
6573 | 1416 _("If you wish to view this profile, you will need to visit this link in your web browser"), |
6514 | 1417 1, YAHOO_PROFILE_URL); |
1418 strcat(buf, "</body></html>\n"); | |
1419 g_show_info_text(NULL, NULL, 2, buf, NULL); | |
1420 return; | |
1421 } | |
1422 | |
1423 /* strip_html() doesn't strip out character entities like and · | |
1424 */ | |
1425 while ((p = strstr(url_text, " ")) != NULL) { | |
1426 memmove(p, p + 6, strlen(p + 6)); | |
1427 url_text[strlen(url_text) - 6] = '\0'; | |
1428 } | |
1429 while ((p = strstr(url_text, "·")) != NULL) { | |
1430 memmove(p, p + 6, strlen(p + 6)); | |
1431 url_text[strlen(url_text) - 6] = '\0'; | |
1432 } | |
1433 | |
1434 /* nuke the nasty \r's */ | |
1435 while ((p = strchr(url_text, '\r')) != NULL) { | |
1436 memmove(p, p + 1, strlen(p + 1)); | |
1437 url_text[strlen(url_text) - 1] = '\0'; | |
1438 } | |
1439 | |
1440 /* nuke the html, it's easier than trying to parse the horrid stuff */ | |
1441 stripped = strip_html(url_text); | |
1442 | |
1443 /* gonna re-use the memory we've already got for url_text */ | |
1444 strcpy(url_text, "<html><body>\n"); | |
1445 | |
1446 /* extract their Yahoo! ID and put it in */ | |
1447 info_extract_field(stripped, url_text, "Yahoo! ID:", 2, "\n", 0, | |
6573 | 1448 NULL, _("Yahoo! ID"), 0, NULL); |
6514 | 1449 |
1450 /* extract their Email address and put it in */ | |
1451 info_extract_field(stripped, url_text, "My Email", 5, "\n", 0, | |
6573 | 1452 _("Private"), _("Email"), 0, NULL); |
6514 | 1453 |
1454 /* extract the Nickname if it exists */ | |
1455 info_extract_field(stripped, url_text, "Nickname:", 1, "\n", '\n', | |
6573 | 1456 NULL, _("Nickname"), 0, NULL); |
6514 | 1457 |
1458 /* extract their RealName and put it in */ | |
1459 info_extract_field(stripped, url_text, "RealName:", 1, "\n", '\n', | |
6573 | 1460 NULL, _("Real Name"), 0, NULL); |
6514 | 1461 |
1462 /* extract their Location and put it in */ | |
1463 info_extract_field(stripped, url_text, "Location:", 2, "\n", '\n', | |
6573 | 1464 NULL, _("Location"), 0, NULL); |
6514 | 1465 |
1466 /* extract their Age and put it in */ | |
1467 info_extract_field(stripped, url_text, "Age:", 3, "\n", '\n', | |
6573 | 1468 NULL, _("Age"), 0, NULL); |
6514 | 1469 |
1470 /* extract their MaritalStatus and put it in */ | |
1471 info_extract_field(stripped, url_text, "MaritalStatus:", 3, "\n", '\n', | |
6573 | 1472 _("No Answer"), _("Marital Status"), 0, NULL); |
6514 | 1473 |
1474 /* extract their Gender and put it in */ | |
1475 info_extract_field(stripped, url_text, "Gender:", 3, "\n", '\n', | |
6573 | 1476 _("No Answer"), _("Gender"), 0, NULL); |
6514 | 1477 |
1478 /* extract their Occupation and put it in */ | |
1479 info_extract_field(stripped, url_text, "Occupation:", 2, "\n", '\n', | |
6573 | 1480 NULL, _("Occupation"), 0, NULL); |
6514 | 1481 |
1482 /* Hobbies, Latest News, and Favorite Quote are a bit different, since the | |
1483 * values can contain embedded newlines... but any or all of them can also | |
1484 * not appear. The way we delimit them is to successively look for the next | |
1485 * one that _could_ appear, and if all else fails, we end the section by | |
1486 * looking for the 'Links' heading, which is the next thing to follow this | |
1487 * bunch. | |
1488 */ | |
1489 if (!info_extract_field(stripped, url_text, "Hobbies:", 1, "Latest News", | |
6573 | 1490 '\n', NULL, _("Hobbies"), 0, NULL)) |
6514 | 1491 if (!info_extract_field(stripped, url_text, "Hobbies:", 1, "Favorite Quote", |
6573 | 1492 '\n', NULL, _("Hobbies"), 0, NULL)) |
6514 | 1493 info_extract_field(stripped, url_text, "Hobbies:", 1, "Links", |
6573 | 1494 '\n', NULL, _("Hobbies"), 0, NULL); |
6514 | 1495 if (!info_extract_field(stripped, url_text, "Latest News:", 1, "Favorite Quote", |
6573 | 1496 '\n', NULL, _("Latest News"), 0, NULL)) |
6514 | 1497 info_extract_field(stripped, url_text, "Latest News:", 1, "Links", |
6573 | 1498 '\n', NULL, _("Latest News"), 0, NULL); |
6514 | 1499 info_extract_field(stripped, url_text, "Favorite Quote:", 0, "Links", |
6573 | 1500 '\n', NULL, _("Favorite Quote"), 0, NULL); |
6514 | 1501 |
1502 /* Home Page will either be "No home page specified", | |
1503 * or "Home Page: " and a link. */ | |
1504 p = strstr(stripped, "No home page specified"); | |
1505 if (!p) | |
1506 info_extract_field(stripped, url_text, "Home Page:", 1, " ", 0, NULL, | |
6573 | 1507 _("Home Page"), 1, NULL); |
6514 | 1508 |
1509 /* Cool Link {1,2,3} is also different. If "No cool link specified" exists, | |
1510 * then we have none. If we have one however, we'll need to check and see if | |
1511 * we have a second one. If we have a second one, we have to check to see if | |
1512 * we have a third one. | |
1513 */ | |
1514 p = strstr(stripped,"No cool link specified"); | |
1515 if (!p) | |
1516 if (info_extract_field(stripped, url_text, "Cool Link 1:", 1, " ", 0, NULL, | |
6573 | 1517 _("Cool Link 1"), 1, NULL)) |
6514 | 1518 if (info_extract_field(stripped, url_text, "Cool Link 2:", 1, " ", 0, NULL, |
6573 | 1519 _("Cool Link 2"), 1, NULL)) |
6514 | 1520 info_extract_field(stripped, url_text, "Cool Link 3:", 1, " ", 0, NULL, |
6573 | 1521 _("Cool Link 3"), 1, NULL); |
6514 | 1522 |
1523 /* see if Member Since is there, and if so, extract it. */ | |
1524 info_extract_field(stripped, url_text, "Member Since:", 1, "Last Updated:", | |
6573 | 1525 '\n', NULL, _("Member Since"), 0, NULL); |
6514 | 1526 |
1527 /* extract the Last Updated date and put it in */ | |
1528 info_extract_field(stripped, url_text, "Last Updated:", 1, "\n", '\n', NULL, | |
6573 | 1529 _("Last Updated"), 0, NULL); |
6514 | 1530 |
1531 /* finish off the html */ | |
1532 strcat(url_text, "</body></html>\n"); | |
1533 g_free(stripped); | |
1534 | |
1535 /* show it to the user */ | |
1536 g_show_info_text(NULL, NULL, 2, url_text, NULL); | |
1537 } | |
1538 | |
1539 static void yahoo_get_info(GaimConnection *gc, const char *name) | |
1540 { | |
1541 /* struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; */ | |
1542 char url[256]; | |
1543 g_snprintf(url, sizeof url, "%s%s", YAHOO_PROFILE_URL, name); | |
6516 | 1544 grab_url(url, FALSE, yahoo_got_info, NULL, NULL, 0); |
6514 | 1545 } |
1546 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1547 static GaimPlugin *my_protocol = NULL; |
2681 | 1548 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1549 static GaimPluginProtocolInfo prpl_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1550 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1551 GAIM_PROTO_YAHOO, |
5367 | 1552 OPT_PROTO_MAIL_CHECK | OPT_PROTO_USE_POINTSIZE, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1553 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1554 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1555 yahoo_list_icon, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1556 yahoo_list_emblems, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1557 yahoo_status_text, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1558 yahoo_tooltip_text, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1559 yahoo_away_states, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1560 yahoo_actions, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1561 yahoo_buddy_menu, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1562 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1563 yahoo_login, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1564 yahoo_close, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1565 yahoo_send_im, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1566 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1567 yahoo_send_typing, |
6514 | 1568 yahoo_get_info, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1569 yahoo_set_away, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1570 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1571 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1572 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1573 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1574 yahoo_set_idle, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1575 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1576 yahoo_add_buddy, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1577 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1578 yahoo_remove_buddy, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1579 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1580 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1581 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1582 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1583 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1584 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1585 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1586 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1587 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1588 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1589 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1590 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1591 yahoo_keepalive, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1592 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1593 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1594 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1595 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1596 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1597 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1598 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1599 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1600 NULL |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1601 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1602 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1603 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1604 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1605 2, /**< api_version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1606 GAIM_PLUGIN_PROTOCOL, /**< type */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1607 NULL, /**< ui_requirement */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1608 0, /**< flags */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1609 NULL, /**< dependencies */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1610 GAIM_PRIORITY_DEFAULT, /**< priority */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1611 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1612 "prpl-yahoo", /**< id */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1613 "Yahoo", /**< name */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1614 VERSION, /**< version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1615 /** summary */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1616 N_("Yahoo Protocol Plugin"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1617 /** description */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1618 N_("Yahoo Protocol Plugin"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1619 NULL, /**< author */ |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6321
diff
changeset
|
1620 GAIM_WEBSITE, /**< homepage */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1621 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1622 NULL, /**< load */ |
6513 | 1623 yahoo_unload_plugin, /**< unload */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1624 NULL, /**< destroy */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1625 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1626 NULL, /**< ui_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1627 &prpl_info /**< extra_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1628 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1629 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1630 static void |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1631 init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1632 { |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1633 GaimAccountOption *option; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1634 |
5685
43ea75092684
[gaim-migrate @ 6106]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1635 option = gaim_account_option_string_new(_("Pager host"), "server", |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1636 YAHOO_PAGER_HOST); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1637 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1638 option); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1639 |
5685
43ea75092684
[gaim-migrate @ 6106]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1640 option = gaim_account_option_int_new(_("Pager port"), "port", |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1641 YAHOO_PAGER_PORT); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1642 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5590
diff
changeset
|
1643 option); |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1644 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1645 my_protocol = plugin; |
6513 | 1646 |
1647 yahoo_init_colorht(); | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1648 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1649 |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
1650 GAIM_INIT_PLUGIN(yahoo, init_plugin, info); |