Mercurial > pidgin.yaz
annotate src/protocols/yahoo/yahoo.h @ 12047:0b7ec6a106d5
[gaim-migrate @ 14342]
Possible crash fix from Fernando Herrera.
I'm not sure when this would crash, exactly. Maybe if you pass
something invalid to gtk_image_new
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 12 Nov 2005 14:07:42 +0000 |
parents | 8f8b4d1ac26e |
children | 0aeda1869b32 |
rev | line source |
---|---|
6513 | 1 /** |
2 * @file yahoo.h The Yahoo! protocol plugin | |
3 * | |
4 * gaim | |
5 * | |
8046 | 6 * Gaim is the legal property of its developers, whose names are too numerous |
7 * to list here. Please refer to the COPYRIGHT file distributed with this | |
8 * source distribution. | |
6513 | 9 * |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 */ | |
24 | |
25 #ifndef _YAHOO_H_ | |
26 #define _YAHOO_H_ | |
27 | |
6784 | 28 #include "prpl.h" |
29 | |
7883 | 30 #define YAHOO_PAGER_HOST "scs.msg.yahoo.com" |
7827 | 31 #define YAHOO_PAGER_PORT 5050 |
32 #define YAHOO_PROFILE_URL "http://profiles.yahoo.com/" | |
11046
c0421a7cba03
[gaim-migrate @ 12962]
Richard Laager <rlaager@wiktel.com>
parents:
11043
diff
changeset
|
33 #define YAHOO_MAIL_URL "https://mail.yahoo.com/" |
7651 | 34 #define YAHOO_XFER_HOST "filetransfer.msg.yahoo.com" |
35 #define YAHOO_XFER_PORT 80 | |
8113 | 36 #define YAHOO_ROOMLIST_URL "http://insider.msg.yahoo.com/ycontent/" |
11160
3adcad067e5f
[gaim-migrate @ 13248]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11046
diff
changeset
|
37 #define YAHOO_ROOMLIST_LOCALE "us" |
9164 | 38 /* really we should get the list of servers from |
39 http://update.messenger.yahoo.co.jp/servers.html */ | |
40 #define YAHOOJP_PAGER_HOST "cs.yahoo.co.jp" | |
9221 | 41 #define YAHOOJP_PROFILE_URL "http://profiles.yahoo.co.jp/" |
42 #define YAHOOJP_MAIL_URL "http://mail.yahoo.co.jp/" | |
9164 | 43 #define YAHOOJP_XFER_HOST "filetransfer.msg.yahoo.co.jp" |
44 #define YAHOOJP_WEBCAM_HOST "wc.yahoo.co.jp" | |
45 | |
7134 | 46 #define WEBMESSENGER_URL "http://login.yahoo.com/config/login?.src=pg" |
47 | |
9306 | 48 #define YAHOO_ICON_CHECKSUM_KEY "icon_checksum" |
49 #define YAHOO_PICURL_SETTING "picture_url" | |
50 #define YAHOO_PICCKSUM_SETTING "picture_checksum" | |
51 #define YAHOO_PICEXPIRE_SETTING "picture_expire" | |
52 | |
10373 | 53 #define YAHOO_STATUS_TYPE_OFFLINE "offline" |
54 #define YAHOO_STATUS_TYPE_AVAILABLE "available" | |
55 #define YAHOO_STATUS_TYPE_BRB "brb" | |
56 #define YAHOO_STATUS_TYPE_BUSY "busy" | |
57 #define YAHOO_STATUS_TYPE_NOTATHOME "notathome" | |
58 #define YAHOO_STATUS_TYPE_NOTATDESK "notatdesk" | |
59 #define YAHOO_STATUS_TYPE_NOTINOFFICE "notinoffice" | |
60 #define YAHOO_STATUS_TYPE_ONPHONE "onphone" | |
61 #define YAHOO_STATUS_TYPE_ONVACATION "onvacation" | |
62 #define YAHOO_STATUS_TYPE_OUTTOLUNCH "outtolunch" | |
63 #define YAHOO_STATUS_TYPE_STEPPEDOUT "steppedout" | |
64 #define YAHOO_STATUS_TYPE_AWAY "away" | |
65 #define YAHOO_STATUS_TYPE_INVISIBLE "invisible" | |
66 | |
6729 | 67 enum yahoo_status { |
68 YAHOO_STATUS_AVAILABLE = 0, | |
69 YAHOO_STATUS_BRB, | |
70 YAHOO_STATUS_BUSY, | |
71 YAHOO_STATUS_NOTATHOME, | |
72 YAHOO_STATUS_NOTATDESK, | |
73 YAHOO_STATUS_NOTINOFFICE, | |
74 YAHOO_STATUS_ONPHONE, | |
75 YAHOO_STATUS_ONVACATION, | |
76 YAHOO_STATUS_OUTTOLUNCH, | |
77 YAHOO_STATUS_STEPPEDOUT, | |
78 YAHOO_STATUS_INVISIBLE = 12, | |
79 YAHOO_STATUS_CUSTOM = 99, | |
80 YAHOO_STATUS_IDLE = 999, | |
7134 | 81 YAHOO_STATUS_WEBLOGIN = 0x5a55aa55, |
6729 | 82 YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */ |
83 YAHOO_STATUS_TYPING = 0x16 | |
84 }; | |
85 | |
9306 | 86 struct yahoo_buddy_icon_upload_data { |
87 GaimConnection *gc; | |
88 GString *str; | |
89 char *filename; | |
90 int pos; | |
91 int fd; | |
92 guint watcher; | |
93 }; | |
94 | |
9376 | 95 struct _YchtConn; |
96 | |
6729 | 97 struct yahoo_data { |
98 int fd; | |
99 guchar *rxqueue; | |
100 int rxlen; | |
6784 | 101 GHashTable *friends; |
6729 | 102 int current_status; |
103 gboolean logged_in; | |
6784 | 104 GString *tmp_serv_blist, *tmp_serv_ilist; |
6729 | 105 GSList *confs; |
106 unsigned int conf_id; /* just a counter */ | |
107 gboolean chat_online; | |
108 gboolean in_chat; | |
109 char *chat_name; | |
7134 | 110 char *auth; |
7651 | 111 char *cookie_y; |
112 char *cookie_t; | |
113 int session_id; | |
9164 | 114 gboolean jp; |
10989
b4919e8c634c
[gaim-migrate @ 12827]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10937
diff
changeset
|
115 gboolean wm; /* connected w/ web messenger method */ |
9306 | 116 /* picture aka buddy icon stuff */ |
117 char *picture_url; | |
118 int picture_checksum; | |
119 | |
120 /* ew. we have to check the icon before we connect, | |
121 * but can't upload it til we're connected. */ | |
122 struct yahoo_buddy_icon_upload_data *picture_upload_todo; | |
9376 | 123 |
124 struct _YchtConn *ycht; | |
6729 | 125 }; |
126 | |
9603 | 127 #define YAHOO_MAX_STATUS_MESSAGE_LENGTH (255) |
6847 | 128 |
7651 | 129 /* sometimes i wish prpls could #include things from other prpls. then i could just |
130 * use the routines from libfaim and not have to admit to knowing how they work. */ | |
131 #define yahoo_put16(buf, data) ( \ | |
132 (*(buf) = (unsigned char)((data)>>8)&0xff), \ | |
133 (*((buf)+1) = (unsigned char)(data)&0xff), \ | |
134 2) | |
135 #define yahoo_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff)) | |
136 #define yahoo_put32(buf, data) ( \ | |
137 (*((buf)) = (unsigned char)((data)>>24)&0xff), \ | |
138 (*((buf)+1) = (unsigned char)((data)>>16)&0xff), \ | |
139 (*((buf)+2) = (unsigned char)((data)>>8)&0xff), \ | |
140 (*((buf)+3) = (unsigned char)(data)&0xff), \ | |
141 4) | |
142 #define yahoo_get32(buf) ((((*(buf))<<24)&0xff000000) + \ | |
143 (((*((buf)+1))<<16)&0x00ff0000) + \ | |
144 (((*((buf)+2))<< 8)&0x0000ff00) + \ | |
145 (((*((buf)+3) )&0x000000ff))) | |
146 | |
6729 | 147 /* util.c */ |
6513 | 148 void yahoo_init_colorht(); |
149 void yahoo_dest_colorht(); | |
6629 | 150 char *yahoo_codes_to_html(const char *x); |
151 char *yahoo_html_to_codes(const char *src); | |
6513 | 152 |
7827 | 153 /** |
154 * Encode some text to send to the yahoo server. | |
155 * | |
156 * @param gc The connection handle. | |
157 * @param str The null terminated utf8 string to encode. | |
158 * @param utf8 If not @c NULL, whether utf8 is okay or not. | |
159 * Even if it is okay, we may not use it. If we | |
160 * used it, we set this to @c TRUE, else to | |
161 * @c FALSE. If @c NULL, false is assumed, and | |
162 * it is not dereferenced. | |
163 * @return The g_malloced string in the appropriate encoding. | |
164 */ | |
165 char *yahoo_string_encode(GaimConnection *gc, const char *str, gboolean *utf8); | |
166 | |
167 /** | |
168 * Decode some text received from the server. | |
169 * | |
170 * @param gc The gc handle. | |
171 * @param str The null terminated string to decode. | |
172 * @param utf8 Did the server tell us it was supposed to be utf8? | |
173 * @return The decoded, utf-8 string, which must be g_free()'d. | |
174 */ | |
175 char *yahoo_string_decode(GaimConnection *gc, const char *str, gboolean utf8); | |
176 | |
9220 | 177 /* previously-static functions, now needed for yahoo_profile.c */ |
178 char *yahoo_tooltip_text(GaimBuddy *b); | |
179 | |
9161 | 180 /* yahoo_profile.c */ |
181 void yahoo_get_info(GaimConnection *gc, const char *name); | |
182 | |
10937 | 183 /** |
184 * Check to see whether the sender is permitted to send | |
185 * | |
186 * @param gc The gc handle. | |
187 * @param who The sender of the packet to check | |
188 */ | |
189 gboolean yahoo_privacy_check | |
190 (GaimConnection *gc, const char *who); | |
191 | |
6513 | 192 #endif /* _YAHOO_H_ */ |