source: protocols/yahoo/yahoo2_types.h @ 82e8fe8

Last change on this file since 82e8fe8 was cfc8d58, checked in by Wilmer van der Gaast <wilmer@…>, at 2007-04-16T04:31:52Z

Updating the Yahoo! module. This seems to fix handling of incoming away
states/messages, should fix some issues with group chats, and unfortunately
also adds some crap which I don't want to clean up for now.

  • Property mode set to 100644
File size: 5.5 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 yahoo_error {
63        E_UNKNOWN = -1,
64        E_CONNECTION = -2,
65        E_SYSTEM = -3,
66        E_CUSTOM = 0,
67
68        /* responses from ignore buddy */
69        E_IGNOREDUP = 2,
70        E_IGNORENONE = 3,
71        E_IGNORECONF = 12,
72       
73        /* conference */
74        E_CONFNOTAVAIL = 20
75};
76
77enum yahoo_log_level {
78        YAHOO_LOG_NONE = 0,
79        YAHOO_LOG_FATAL,
80        YAHOO_LOG_ERR,
81        YAHOO_LOG_WARNING,
82        YAHOO_LOG_NOTICE,
83        YAHOO_LOG_INFO,
84        YAHOO_LOG_DEBUG
85};
86
87#define YAHOO_PROTO_VER 0x000b
88
89/* Yahoo style/color directives */
90#define YAHOO_COLOR_BLACK "\033[30m"
91#define YAHOO_COLOR_BLUE "\033[31m"
92#define YAHOO_COLOR_LIGHTBLUE "\033[32m"
93#define YAHOO_COLOR_GRAY "\033[33m"
94#define YAHOO_COLOR_GREEN "\033[34m"
95#define YAHOO_COLOR_PINK "\033[35m"
96#define YAHOO_COLOR_PURPLE "\033[36m"
97#define YAHOO_COLOR_ORANGE "\033[37m"
98#define YAHOO_COLOR_RED "\033[38m"
99#define YAHOO_COLOR_OLIVE "\033[39m"
100#define YAHOO_COLOR_ANY "\033[#"
101#define YAHOO_STYLE_ITALICON "\033[2m"
102#define YAHOO_STYLE_ITALICOFF "\033[x2m"
103#define YAHOO_STYLE_BOLDON "\033[1m"
104#define YAHOO_STYLE_BOLDOFF "\033[x1m"
105#define YAHOO_STYLE_UNDERLINEON "\033[4m"
106#define YAHOO_STYLE_UNDERLINEOFF "\033[x4m"
107#define YAHOO_STYLE_URLON "\033[lm"
108#define YAHOO_STYLE_URLOFF "\033[xlm"
109
110enum yahoo_connection_type {
111        YAHOO_CONNECTION_PAGER=0,
112        YAHOO_CONNECTION_FT,
113        YAHOO_CONNECTION_YAB,
114        YAHOO_CONNECTION_WEBCAM_MASTER,
115        YAHOO_CONNECTION_WEBCAM,
116        YAHOO_CONNECTION_CHATCAT,
117        YAHOO_CONNECTION_SEARCH
118};
119
120enum yahoo_webcam_direction_type {
121        YAHOO_WEBCAM_DOWNLOAD=0,
122        YAHOO_WEBCAM_UPLOAD
123};
124
125enum yahoo_stealth_visibility_type {
126        YAHOO_STEALTH_DEFAULT = 0,
127        YAHOO_STEALTH_ONLINE,
128        YAHOO_STEALTH_PERM_OFFLINE
129};
130
131/* chat member attribs */
132#define YAHOO_CHAT_MALE 0x8000
133#define YAHOO_CHAT_FEMALE 0x10000
134#define YAHOO_CHAT_FEMALE 0x10000
135#define YAHOO_CHAT_DUNNO 0x400
136#define YAHOO_CHAT_WEBCAM 0x10
137
138enum yahoo_webcam_conn_type { Y_WCM_DIALUP, Y_WCM_DSL, Y_WCM_T1 };
139
140struct yahoo_webcam {
141        int direction;     /* Uploading or downloading */
142        int conn_type;     /* 0=Dialup, 1=DSL/Cable, 2=T1/Lan */
143
144        char *user;        /* user we are viewing */
145        char *server;      /* webcam server to connect to */
146        int   port;        /* webcam port to connect on */
147        char *key;         /* key to connect to the server with */
148        char *description; /* webcam description */
149        char *my_ip;       /* own ip number */
150};
151
152struct yahoo_webcam_data {
153        unsigned int data_size;
154        unsigned int to_read;
155        unsigned int timestamp;
156        unsigned char packet_type;
157};
158
159struct yahoo_data {
160        char  *user;
161        char  *password;
162
163        char  *cookie_y;
164        char  *cookie_t;
165        char  *cookie_c;
166        char  *login_cookie;
167
168        YList *buddies;
169        YList *ignore;
170        YList *identities;
171        char  *login_id;
172
173        int   current_status;
174        int   initial_status;
175        int   logged_in;
176
177        int   session_id;
178
179        int   client_id;
180
181        char  *rawbuddylist;
182        char  *ignorelist;
183
184        void  *server_settings;
185};
186
187struct yab {
188        char *id;
189        char *fname;
190        char *lname;
191        char *nname;
192        char *email;
193        char *hphone;
194        char *wphone;
195        char *mphone;
196        int  dbid;
197};
198
199struct yahoo_buddy {
200        char *group;
201        char *id;
202        char *real_name;
203        struct yab *yab_entry;
204};
205
206enum yahoo_search_type {
207        YAHOO_SEARCH_KEYWORD = 0,
208        YAHOO_SEARCH_YID,
209        YAHOO_SEARCH_NAME
210};
211
212enum yahoo_search_gender {
213        YAHOO_GENDER_NONE = 0,
214        YAHOO_GENDER_MALE,
215        YAHOO_GENDER_FEMALE
216};
217
218enum yahoo_search_agerange {
219        YAHOO_AGERANGE_NONE = 0
220};
221
222struct yahoo_found_contact {
223        char *id;
224        char *gender;
225        char *location;
226        int age;
227        int online;
228};
229
230/*
231 * Function pointer to be passed to http get/post and send file
232 */
233typedef void (*yahoo_get_fd_callback)(int id, int fd, int error, void *data);
234
235/*
236 * Function pointer to be passed to yahoo_get_url_handle
237 */
238typedef void (*yahoo_get_url_handle_callback)(int id, int fd, int error,
239                const char *filename, unsigned long size, void *data);
240
241
242struct yahoo_chat_member {
243        char *id;
244        int  age;
245        int  attribs;
246        char *alias;
247        char *location;
248};
249
250#ifdef __cplusplus
251}
252#endif
253
254#endif
Note: See TracBrowser for help on using the repository browser.