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