source: protocols/yahoo/yahoo2_types.h @ 24b8bbb

Last change on this file since 24b8bbb was 7053379, checked in by Wilmer van der Gaast <wilmer@…>, at 2010-03-12T23:02:29Z

Yahoo! status updates (at least initial ones, I assume) can be too long to
fit into one packet. Yahoo! servers will split them up, and not necessarily
on buddy boundaries. Trying to handle this a little bit better now. (Sadly
I can't test this myself, I can only see this causing troubles on testing
sometimes.)

  • Property mode set to 100644
File size: 6.6 KB
Line 
1/*
2 * libyahoo2: yahoo2_types.h
3 *
4 * Copyright (C) 2002-2004, Philip S Tellis <philip.tellis AT gmx.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 *
20 */
21
22#ifndef YAHOO2_TYPES_H
23#define YAHOO2_TYPES_H
24
25#include "yahoo_list.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31enum yahoo_status {
32        YAHOO_STATUS_DISCONNECTED = -1,
33        YAHOO_STATUS_AVAILABLE = 0,
34        YAHOO_STATUS_BRB,
35        YAHOO_STATUS_BUSY,
36        YAHOO_STATUS_NOTATHOME,
37        YAHOO_STATUS_NOTATDESK,
38        YAHOO_STATUS_NOTINOFFICE,
39        YAHOO_STATUS_ONPHONE,
40        YAHOO_STATUS_ONVACATION,
41        YAHOO_STATUS_OUTTOLUNCH,
42        YAHOO_STATUS_STEPPEDOUT,
43        YAHOO_STATUS_INVISIBLE = 12,
44        YAHOO_STATUS_CUSTOM = 99,
45        YAHOO_STATUS_IDLE = 999,
46        YAHOO_STATUS_WEBLOGIN = 0x5a55aa55,
47        YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
48        YAHOO_STATUS_NOTIFY = 0x16 /* TYPING */
49};
50#define YAHOO_STATUS_GAME       0x2             /* Games don't fit into the regular status model */
51
52enum yahoo_login_status {
53        YAHOO_LOGIN_OK = 0,
54        YAHOO_LOGIN_LOGOFF = 2,
55        YAHOO_LOGIN_UNAME = 3,
56        YAHOO_LOGIN_PASSWD = 13,
57        YAHOO_LOGIN_LOCK = 14,
58        YAHOO_LOGIN_DUPL = 99,
59        YAHOO_LOGIN_SOCK = -1,
60};
61
62enum ypacket_status {
63        YPACKET_STATUS_DISCONNECTED = -1,
64        YPACKET_STATUS_DEFAULT = 0,
65        YPACKET_STATUS_SERVERACK = 1,
66        YPACKET_STATUS_GAME     = 0x2,
67        YPACKET_STATUS_AWAY     = 0x4,
68        YPACKET_STATUS_CONTINUED = 0x5,
69        YPACKET_STATUS_INVISIBLE = 12,
70        YPACKET_STATUS_NOTIFY = 0x16, /* TYPING */
71        YPACKET_STATUS_WEBLOGIN = 0x5a55aa55,
72        YPACKET_STATUS_OFFLINE = 0x5a55aa56
73};
74
75enum yahoo_error {
76        E_UNKNOWN = -1,
77        E_CONNECTION = -2,
78        E_SYSTEM = -3,
79        E_CUSTOM = 0,
80
81        /* responses from ignore buddy */
82        E_IGNOREDUP = 2,
83        E_IGNORENONE = 3,
84        E_IGNORECONF = 12,
85       
86        /* conference */
87        E_CONFNOTAVAIL = 20
88};
89
90enum yahoo_log_level {
91        YAHOO_LOG_NONE = 0,
92        YAHOO_LOG_FATAL,
93        YAHOO_LOG_ERR,
94        YAHOO_LOG_WARNING,
95        YAHOO_LOG_NOTICE,
96        YAHOO_LOG_INFO,
97        YAHOO_LOG_DEBUG
98};
99
100#define YAHOO_PROTO_VER 0x0010
101
102/* Yahoo style/color directives */
103#define YAHOO_COLOR_BLACK "\033[30m"
104#define YAHOO_COLOR_BLUE "\033[31m"
105#define YAHOO_COLOR_LIGHTBLUE "\033[32m"
106#define YAHOO_COLOR_GRAY "\033[33m"
107#define YAHOO_COLOR_GREEN "\033[34m"
108#define YAHOO_COLOR_PINK "\033[35m"
109#define YAHOO_COLOR_PURPLE "\033[36m"
110#define YAHOO_COLOR_ORANGE "\033[37m"
111#define YAHOO_COLOR_RED "\033[38m"
112#define YAHOO_COLOR_OLIVE "\033[39m"
113#define YAHOO_COLOR_ANY "\033[#"
114#define YAHOO_STYLE_ITALICON "\033[2m"
115#define YAHOO_STYLE_ITALICOFF "\033[x2m"
116#define YAHOO_STYLE_BOLDON "\033[1m"
117#define YAHOO_STYLE_BOLDOFF "\033[x1m"
118#define YAHOO_STYLE_UNDERLINEON "\033[4m"
119#define YAHOO_STYLE_UNDERLINEOFF "\033[x4m"
120#define YAHOO_STYLE_URLON "\033[lm"
121#define YAHOO_STYLE_URLOFF "\033[xlm"
122
123enum yahoo_connection_type {
124        YAHOO_CONNECTION_PAGER=0,
125        YAHOO_CONNECTION_FT,
126        YAHOO_CONNECTION_YAB,
127        YAHOO_CONNECTION_WEBCAM_MASTER,
128        YAHOO_CONNECTION_WEBCAM,
129        YAHOO_CONNECTION_CHATCAT,
130        YAHOO_CONNECTION_SEARCH,
131        YAHOO_CONNECTION_AUTH,
132};
133
134enum yahoo_webcam_direction_type {
135        YAHOO_WEBCAM_DOWNLOAD=0,
136        YAHOO_WEBCAM_UPLOAD
137};
138
139enum yahoo_stealth_visibility_type {
140        YAHOO_STEALTH_DEFAULT = 0,
141        YAHOO_STEALTH_ONLINE,
142        YAHOO_STEALTH_PERM_OFFLINE
143};
144
145/* chat member attribs */
146#define YAHOO_CHAT_MALE 0x8000
147#define YAHOO_CHAT_FEMALE 0x10000
148#define YAHOO_CHAT_DUNNO 0x400
149#define YAHOO_CHAT_WEBCAM 0x10
150
151enum yahoo_webcam_conn_type { Y_WCM_DIALUP, Y_WCM_DSL, Y_WCM_T1 };
152
153struct yahoo_webcam {
154        int direction;     /* Uploading or downloading */
155        int conn_type;     /* 0=Dialup, 1=DSL/Cable, 2=T1/Lan */
156
157        char *user;        /* user we are viewing */
158        char *server;      /* webcam server to connect to */
159        int   port;        /* webcam port to connect on */
160        char *key;         /* key to connect to the server with */
161        char *description; /* webcam description */
162        char *my_ip;       /* own ip number */
163};
164
165struct yahoo_webcam_data {
166        unsigned int data_size;
167        unsigned int to_read;
168        unsigned int timestamp;
169        unsigned char packet_type;
170};
171
172struct yahoo_data {
173        char  *user;
174        char  *password;
175
176        char  *cookie_y;
177        char  *cookie_t;
178        char  *cookie_c;
179        char  *login_cookie;
180
181        YList *buddies;
182        YList *ignore;
183        YList *identities;
184        char  *login_id;
185
186        int   current_status;
187        int   initial_status;
188        int   logged_in;
189
190        int   session_id;
191
192        int   client_id;
193
194        char  *rawbuddylist;
195        char  *ignorelist;
196
197        void  *server_settings;
198       
199        struct yahoo_process_status_entry *half_user;
200};
201
202struct yab {
203        char *id;
204        char *fname;
205        char *lname;
206        char *nname;
207        char *email;
208        char *hphone;
209        char *wphone;
210        char *mphone;
211        int  dbid;
212};
213
214struct yahoo_buddy {
215        char *group;
216        char *id;
217        char *real_name;
218        struct yab *yab_entry;
219};
220
221enum yahoo_search_type {
222        YAHOO_SEARCH_KEYWORD = 0,
223        YAHOO_SEARCH_YID,
224        YAHOO_SEARCH_NAME
225};
226
227enum yahoo_search_gender {
228        YAHOO_GENDER_NONE = 0,
229        YAHOO_GENDER_MALE,
230        YAHOO_GENDER_FEMALE
231};
232
233enum yahoo_search_agerange {
234        YAHOO_AGERANGE_NONE = 0
235};
236
237struct yahoo_found_contact {
238        char *id;
239        char *gender;
240        char *location;
241        int age;
242        int online;
243};
244
245/*
246 * Function pointer to be passed to http get/post and send file
247 */
248typedef void (*yahoo_get_fd_callback)(int id, int fd, int error, void *data);
249
250/*
251 * Function pointer to be passed to yahoo_get_url_handle
252 */
253typedef void (*yahoo_get_url_handle_callback)(int id, int fd, int error,
254                const char *filename, unsigned long size, void *data);
255
256
257struct yahoo_chat_member {
258        char *id;
259        int  age;
260        int  attribs;
261        char *alias;
262        char *location;
263};
264
265struct yahoo_process_status_entry {
266        char *name;     /* 7      name */
267        int state;      /* 10     state */
268        int flags;      /* 13     flags, bit 0 = pager, bit 1 = chat, bit 2 = game */
269        int mobile;     /* 60     mobile */
270        char *msg;      /* 19     custom status message */
271        int away;       /* 47     away (or invisible) */
272        int buddy_session; /* 11  state */
273        int f17;        /* 17     in chat? then what about flags? */
274        int idle;       /* 137    seconds idle */
275        int f138;       /* 138    state */
276        char *f184;     /* 184    state */
277        int f192;       /* 192    state */
278        int f10001;     /* 10001  state */
279        int f10002;     /* 10002  state */
280        int f198;       /* 198    state */
281        char *f197;     /* 197    state */
282        char *f205;     /* 205    state */
283        int f213;       /* 213    state */
284};
285
286#ifdef __cplusplus
287}
288#endif
289
290#endif
Note: See TracBrowser for help on using the repository browser.