source: protocols/yahoo/yahoo2_types.h @ 2288705

Last change on this file since 2288705 was ba16895, checked in by Wilmer van der Gaast <wilmer@…>, at 2009-10-10T13:48:44Z

More Yahoo! fixes: Adding and removing buddies works, and for the first
time buddy add requests are actually handled; from what I can see this
simply didn't exist in libyahoo2 yet so far. :-(

I melded pieces of changes from http://geny.sf.net/ to make this stuff
work.

  • Property mode set to 100644
File size: 5.8 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
200struct yab {
201        char *id;
202        char *fname;
203        char *lname;
204        char *nname;
205        char *email;
206        char *hphone;
207        char *wphone;
208        char *mphone;
209        int  dbid;
210};
211
212struct yahoo_buddy {
213        char *group;
214        char *id;
215        char *real_name;
216        struct yab *yab_entry;
217};
218
219enum yahoo_search_type {
220        YAHOO_SEARCH_KEYWORD = 0,
221        YAHOO_SEARCH_YID,
222        YAHOO_SEARCH_NAME
223};
224
225enum yahoo_search_gender {
226        YAHOO_GENDER_NONE = 0,
227        YAHOO_GENDER_MALE,
228        YAHOO_GENDER_FEMALE
229};
230
231enum yahoo_search_agerange {
232        YAHOO_AGERANGE_NONE = 0
233};
234
235struct yahoo_found_contact {
236        char *id;
237        char *gender;
238        char *location;
239        int age;
240        int online;
241};
242
243/*
244 * Function pointer to be passed to http get/post and send file
245 */
246typedef void (*yahoo_get_fd_callback)(int id, int fd, int error, void *data);
247
248/*
249 * Function pointer to be passed to yahoo_get_url_handle
250 */
251typedef void (*yahoo_get_url_handle_callback)(int id, int fd, int error,
252                const char *filename, unsigned long size, void *data);
253
254
255struct yahoo_chat_member {
256        char *id;
257        int  age;
258        int  attribs;
259        char *alias;
260        char *location;
261};
262
263#ifdef __cplusplus
264}
265#endif
266
267#endif
Note: See TracBrowser for help on using the repository browser.