annotate src/protocols/yahoo/yahoo.h @ 8420:c25c697525b7

[gaim-migrate @ 9150] Phase II. If anyone finds anything problematic here that can't be attributed to GtkIMHtml itself, please let me know (I'll probably tell you it can be attributed to GtkIMHtml itself ;)). Love, Sean. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 10 Mar 2004 06:10:00 +0000
parents f1ca7e06e8de
children c6d32e1c0120
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6513
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
1 /**
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
2 * @file yahoo.h The Yahoo! protocol plugin
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
3 *
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
4 * gaim
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
5 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8045
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8045
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8045
diff changeset
8 * source distribution.
6513
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
9 *
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
13 * (at your option) any later version.
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
14 *
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
18 * GNU General Public License for more details.
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
19 *
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
23 */
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
24
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
25 #ifndef _YAHOO_H_
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
26 #define _YAHOO_H_
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
27
6784
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
28 #include "prpl.h"
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
29
7883
30ed1fc892aa [gaim-migrate @ 8537]
Luke Schierer <lschiere@pidgin.im>
parents: 7827
diff changeset
30 #define YAHOO_PAGER_HOST "scs.msg.yahoo.com"
7827
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
31 #define YAHOO_PAGER_PORT 5050
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
32 #define YAHOO_PROFILE_URL "http://profiles.yahoo.com/"
7651
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
33 #define YAHOO_XFER_HOST "filetransfer.msg.yahoo.com"
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
34 #define YAHOO_XFER_PORT 80
8113
d60272410bd5 [gaim-migrate @ 8817]
Nathan Walp <nwalp@pidgin.im>
parents: 8046
diff changeset
35 #define YAHOO_ROOMLIST_URL "http://insider.msg.yahoo.com/ycontent/"
7651
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
36
7134
67f9b43c402a [gaim-migrate @ 7701]
Sean Egan <seanegan@gmail.com>
parents: 6895
diff changeset
37 #define WEBMESSENGER_URL "http://login.yahoo.com/config/login?.src=pg"
67f9b43c402a [gaim-migrate @ 7701]
Sean Egan <seanegan@gmail.com>
parents: 6895
diff changeset
38
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
39 enum yahoo_service { /* these are easier to see in hex */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
40 YAHOO_SERVICE_LOGON = 1,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
41 YAHOO_SERVICE_LOGOFF,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
42 YAHOO_SERVICE_ISAWAY,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
43 YAHOO_SERVICE_ISBACK,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
44 YAHOO_SERVICE_IDLE, /* 5 (placemarker) */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
45 YAHOO_SERVICE_MESSAGE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
46 YAHOO_SERVICE_IDACT,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
47 YAHOO_SERVICE_IDDEACT,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
48 YAHOO_SERVICE_MAILSTAT,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
49 YAHOO_SERVICE_USERSTAT, /* 0xa */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
50 YAHOO_SERVICE_NEWMAIL,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
51 YAHOO_SERVICE_CHATINVITE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
52 YAHOO_SERVICE_CALENDAR,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
53 YAHOO_SERVICE_NEWPERSONALMAIL,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
54 YAHOO_SERVICE_NEWCONTACT,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
55 YAHOO_SERVICE_ADDIDENT, /* 0x10 */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
56 YAHOO_SERVICE_ADDIGNORE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
57 YAHOO_SERVICE_PING,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
58 YAHOO_SERVICE_GOTGROUPRENAME,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
59 YAHOO_SERVICE_SYSMESSAGE = 0x14,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
60 YAHOO_SERVICE_PASSTHROUGH2 = 0x16,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
61 YAHOO_SERVICE_CONFINVITE = 0x18,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
62 YAHOO_SERVICE_CONFLOGON,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
63 YAHOO_SERVICE_CONFDECLINE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
64 YAHOO_SERVICE_CONFLOGOFF,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
65 YAHOO_SERVICE_CONFADDINVITE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
66 YAHOO_SERVICE_CONFMSG,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
67 YAHOO_SERVICE_CHATLOGON,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
68 YAHOO_SERVICE_CHATLOGOFF,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
69 YAHOO_SERVICE_CHATMSG = 0x20,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
70 YAHOO_SERVICE_GAMELOGON = 0x28,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
71 YAHOO_SERVICE_GAMELOGOFF,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
72 YAHOO_SERVICE_GAMEMSG = 0x2a,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
73 YAHOO_SERVICE_FILETRANSFER = 0x46,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
74 YAHOO_SERVICE_VOICECHAT = 0x4A,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
75 YAHOO_SERVICE_NOTIFY = 0x4B,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
76 YAHOO_SERVICE_VERIFY,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
77 YAHOO_SERVICE_P2PFILEXFER,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
78 YAHOO_SERVICE_PEEPTOPEER = 0x4F,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
79 YAHOO_SERVICE_WEBCAM,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
80 YAHOO_SERVICE_AUTHRESP = 0x54,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
81 YAHOO_SERVICE_LIST = 0x55,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
82 YAHOO_SERVICE_AUTH = 0x57,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
83 YAHOO_SERVICE_ADDBUDDY = 0x83,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
84 YAHOO_SERVICE_REMBUDDY = 0x84,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
85 YAHOO_SERVICE_IGNORECONTACT, /* > 1, 7, 13 < 1, 66, 13, 0*/
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
86 YAHOO_SERVICE_REJECTCONTACT,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
87 YAHOO_SERVICE_GROUPRENAME = 0x89, /* > 1, 65(new), 66(0), 67(old) */
6847
7de1b559cbbb [gaim-migrate @ 7392]
Luke Schierer <lschiere@pidgin.im>
parents: 6784
diff changeset
88 /* YAHOO_SERVICE_??? = 0x8A, */
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
89 YAHOO_SERVICE_CHATONLINE = 0x96, /* > 109(id), 1, 6(abcde) < 0,1*/
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
90 YAHOO_SERVICE_CHATGOTO,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
91 YAHOO_SERVICE_CHATJOIN, /* > 1 104-room 129-1600326591 62-2 */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
92 YAHOO_SERVICE_CHATLEAVE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
93 YAHOO_SERVICE_CHATEXIT = 0x9b,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
94 YAHOO_SERVICE_CHATADDINVITE = 0x9d,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
95 YAHOO_SERVICE_CHATLOGOUT = 0xa0,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
96 YAHOO_SERVICE_CHATPING,
7134
67f9b43c402a [gaim-migrate @ 7701]
Sean Egan <seanegan@gmail.com>
parents: 6895
diff changeset
97 YAHOO_SERVICE_COMMENT = 0xa8,
67f9b43c402a [gaim-migrate @ 7701]
Sean Egan <seanegan@gmail.com>
parents: 6895
diff changeset
98 YAHOO_SERVICE_WEBLOGIN = 0x0226
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
99 };
6513
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
100
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
101 enum yahoo_status {
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
102 YAHOO_STATUS_AVAILABLE = 0,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
103 YAHOO_STATUS_BRB,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
104 YAHOO_STATUS_BUSY,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
105 YAHOO_STATUS_NOTATHOME,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
106 YAHOO_STATUS_NOTATDESK,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
107 YAHOO_STATUS_NOTINOFFICE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
108 YAHOO_STATUS_ONPHONE,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
109 YAHOO_STATUS_ONVACATION,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
110 YAHOO_STATUS_OUTTOLUNCH,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
111 YAHOO_STATUS_STEPPEDOUT,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
112 YAHOO_STATUS_INVISIBLE = 12,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
113 YAHOO_STATUS_CUSTOM = 99,
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
114 YAHOO_STATUS_IDLE = 999,
7134
67f9b43c402a [gaim-migrate @ 7701]
Sean Egan <seanegan@gmail.com>
parents: 6895
diff changeset
115 YAHOO_STATUS_WEBLOGIN = 0x5a55aa55,
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
116 YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
117 YAHOO_STATUS_TYPING = 0x16
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
118 };
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
119
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
120 struct yahoo_data {
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
121 int fd;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
122 guchar *rxqueue;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
123 int rxlen;
6784
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
124 GHashTable *friends;
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
125 int current_status;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
126 gboolean logged_in;
6784
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
127 GString *tmp_serv_blist, *tmp_serv_ilist;
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
128 GSList *confs;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
129 unsigned int conf_id; /* just a counter */
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
130 gboolean chat_online;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
131 gboolean in_chat;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
132 char *chat_name;
7134
67f9b43c402a [gaim-migrate @ 7701]
Sean Egan <seanegan@gmail.com>
parents: 6895
diff changeset
133 char *auth;
7651
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
134 char *cookie_y;
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
135 char *cookie_t;
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
136 int session_id;
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
137 };
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
138
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
139 struct yahoo_pair {
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
140 int key;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
141 char *value;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
142 };
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
143
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
144 struct yahoo_packet {
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
145 guint16 service;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
146 guint32 status;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
147 guint32 id;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
148 GSList *hash;
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
149 };
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
150
6784
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
151 struct yahoo_friend { /* we'll call them friends, so we don't confuse them with GaimBuddy */
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
152 enum yahoo_status status;
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
153 char *msg;
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
154 char *game;
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
155 int idle;
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
156 int away;
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
157 gboolean sms;
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
158 };
ea3707dde7a3 [gaim-migrate @ 7323]
Luke Schierer <lschiere@pidgin.im>
parents: 6729
diff changeset
159
6895
847d899a5724 [gaim-migrate @ 7442]
Luke Schierer <lschiere@pidgin.im>
parents: 6847
diff changeset
160 #define YAHOO_MAX_STATUS_MESSAGE_LENGTH (48)
6847
7de1b559cbbb [gaim-migrate @ 7392]
Luke Schierer <lschiere@pidgin.im>
parents: 6784
diff changeset
161
7651
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
162 #ifdef YAHOO_WEBMESSENGER
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
163 #define YAHOO_PROTO_VER 0x0065
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
164 #else
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
165 #define YAHOO_PROTO_VER 0x000b
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
166 #endif
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
167
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
168 #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4)
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
169
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
170 /* sometimes i wish prpls could #include things from other prpls. then i could just
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
171 * use the routines from libfaim and not have to admit to knowing how they work. */
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
172 #define yahoo_put16(buf, data) ( \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
173 (*(buf) = (unsigned char)((data)>>8)&0xff), \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
174 (*((buf)+1) = (unsigned char)(data)&0xff), \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
175 2)
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
176 #define yahoo_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff))
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
177 #define yahoo_put32(buf, data) ( \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
178 (*((buf)) = (unsigned char)((data)>>24)&0xff), \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
179 (*((buf)+1) = (unsigned char)((data)>>16)&0xff), \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
180 (*((buf)+2) = (unsigned char)((data)>>8)&0xff), \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
181 (*((buf)+3) = (unsigned char)(data)&0xff), \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
182 4)
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
183 #define yahoo_get32(buf) ((((*(buf))<<24)&0xff000000) + \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
184 (((*((buf)+1))<<16)&0x00ff0000) + \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
185 (((*((buf)+2))<< 8)&0x0000ff00) + \
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
186 (((*((buf)+3) )&0x000000ff)))
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
187
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
188
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
189 struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id);
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
190 void yahoo_packet_hash(struct yahoo_packet *pkt, int key, const char *value);
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
191 int yahoo_send_packet(struct yahoo_data *yd, struct yahoo_packet *pkt);
7651
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
192 void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data);
580bd39219a2 [gaim-migrate @ 8295]
Luke Schierer <lschiere@pidgin.im>
parents: 7134
diff changeset
193 int yahoo_packet_length(struct yahoo_packet *pkt);
6729
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
194 void yahoo_packet_free(struct yahoo_packet *pkt);
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
195
7b878ee8f064 [gaim-migrate @ 7256]
Luke Schierer <lschiere@pidgin.im>
parents: 6629
diff changeset
196 /* util.c */
6513
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
197 void yahoo_init_colorht();
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
198 void yahoo_dest_colorht();
6629
bdc448cf4cb6 [gaim-migrate @ 7153]
Luke Schierer <lschiere@pidgin.im>
parents: 6513
diff changeset
199 char *yahoo_codes_to_html(const char *x);
bdc448cf4cb6 [gaim-migrate @ 7153]
Luke Schierer <lschiere@pidgin.im>
parents: 6513
diff changeset
200 char *yahoo_html_to_codes(const char *src);
6513
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
201
7827
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
202 /**
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
203 * Encode some text to send to the yahoo server.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
204 *
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
205 * @param gc The connection handle.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
206 * @param str The null terminated utf8 string to encode.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
207 * @param utf8 If not @c NULL, whether utf8 is okay or not.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
208 * Even if it is okay, we may not use it. If we
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
209 * used it, we set this to @c TRUE, else to
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
210 * @c FALSE. If @c NULL, false is assumed, and
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
211 * it is not dereferenced.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
212 * @return The g_malloced string in the appropriate encoding.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
213 */
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
214 char *yahoo_string_encode(GaimConnection *gc, const char *str, gboolean *utf8);
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
215
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
216 /**
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
217 * Decode some text received from the server.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
218 *
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
219 * @param gc The gc handle.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
220 * @param str The null terminated string to decode.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
221 * @param utf8 Did the server tell us it was supposed to be utf8?
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
222 * @return The decoded, utf-8 string, which must be g_free()'d.
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
223 */
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
224 char *yahoo_string_decode(GaimConnection *gc, const char *str, gboolean utf8);
ee32e030c9be [gaim-migrate @ 8479]
Ethan Blanton <elb@pidgin.im>
parents: 7651
diff changeset
225
6513
63c449a1022f [gaim-migrate @ 7030]
Luke Schierer <lschiere@pidgin.im>
parents:
diff changeset
226 #endif /* _YAHOO_H_ */