1.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/yahoo.h Sun Jun 21 22:04:11 2009 -0400
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,268 +0,0 @@
1.4 -/**
1.5 - * @file yahoo.h The Yahoo! protocol plugin
1.6 - *
1.7 - * purple
1.8 - *
1.9 - * Purple is the legal property of its developers, whose names are too numerous
1.10 - * to list here. Please refer to the COPYRIGHT file distributed with this
1.11 - * source distribution.
1.12 - *
1.13 - * This program is free software; you can redistribute it and/or modify
1.14 - * it under the terms of the GNU General Public License as published by
1.15 - * the Free Software Foundation; either version 2 of the License, or
1.16 - * (at your option) any later version.
1.17 - *
1.18 - * This program is distributed in the hope that it will be useful,
1.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.21 - * GNU General Public License for more details.
1.22 - *
1.23 - * You should have received a copy of the GNU General Public License
1.24 - * along with this program; if not, write to the Free Software
1.25 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.26 - */
1.27 -
1.28 -#ifndef _YAHOO_H_
1.29 -#define _YAHOO_H_
1.30 -
1.31 -#include "circbuffer.h"
1.32 -#include "prpl.h"
1.33 -
1.34 -#define YAHOO_PAGER_HOST "scs.msg.yahoo.com"
1.35 -#define YAHOO_PAGER_PORT 5050
1.36 -#define YAHOO_PROFILE_URL "http://profiles.yahoo.com/"
1.37 -#define YAHOO_MAIL_URL "https://login.yahoo.com/config/login?.src=ym"
1.38 -#define YAHOO_XFER_HOST "filetransfer.msg.yahoo.com"
1.39 -#define YAHOO_XFER_PORT 80
1.40 -#define YAHOO_XFER_RELAY_HOST "relay.msg.yahoo.com"
1.41 -#define YAHOO_XFER_RELAY_PORT 80
1.42 -#define YAHOO_ROOMLIST_URL "http://insider.msg.yahoo.com/ycontent/"
1.43 -#define YAHOO_ROOMLIST_LOCALE "us"
1.44 -/* really we should get the list of servers from
1.45 - http://update.messenger.yahoo.co.jp/servers.html */
1.46 -#define YAHOOJP_PAGER_HOST "cs.yahoo.co.jp"
1.47 -#define YAHOOJP_PROFILE_URL "http://profiles.yahoo.co.jp/"
1.48 -#define YAHOOJP_MAIL_URL "http://mail.yahoo.co.jp/"
1.49 -#define YAHOOJP_XFER_HOST "filetransfer.msg.yahoo.co.jp"
1.50 -#define YAHOOJP_WEBCAM_HOST "wc.yahoo.co.jp"
1.51 -/*not sure, must test:*/
1.52 -#define YAHOOJP_XFER_RELAY_HOST "relay.msg.yahoo.co.jp"
1.53 -#define YAHOOJP_XFER_RELAY_PORT 80
1.54 -#define YAHOOJP_ROOMLIST_URL "http://insider.msg.yahoo.co.jp/ycontent/"
1.55 -#define YAHOOJP_ROOMLIST_LOCALE "ja"
1.56 -
1.57 -#define YAHOO_AUDIBLE_URL "http://us.dl1.yimg.com/download.yahoo.com/dl/aud"
1.58 -
1.59 -#define WEBMESSENGER_URL "http://login.yahoo.com/config/login?.src=pg"
1.60 -
1.61 -#define YAHOO_PICURL_SETTING "picture_url"
1.62 -#define YAHOO_PICCKSUM_SETTING "picture_checksum"
1.63 -#define YAHOO_PICEXPIRE_SETTING "picture_expire"
1.64 -
1.65 -#define YAHOO_STATUS_TYPE_OFFLINE "offline"
1.66 -#define YAHOO_STATUS_TYPE_AVAILABLE "available"
1.67 -#define YAHOO_STATUS_TYPE_BRB "brb"
1.68 -#define YAHOO_STATUS_TYPE_BUSY "busy"
1.69 -#define YAHOO_STATUS_TYPE_NOTATHOME "notathome"
1.70 -#define YAHOO_STATUS_TYPE_NOTATDESK "notatdesk"
1.71 -#define YAHOO_STATUS_TYPE_NOTINOFFICE "notinoffice"
1.72 -#define YAHOO_STATUS_TYPE_ONPHONE "onphone"
1.73 -#define YAHOO_STATUS_TYPE_ONVACATION "onvacation"
1.74 -#define YAHOO_STATUS_TYPE_OUTTOLUNCH "outtolunch"
1.75 -#define YAHOO_STATUS_TYPE_STEPPEDOUT "steppedout"
1.76 -#define YAHOO_STATUS_TYPE_AWAY "away"
1.77 -#define YAHOO_STATUS_TYPE_INVISIBLE "invisible"
1.78 -#define YAHOO_STATUS_TYPE_MOBILE "mobile"
1.79 -
1.80 -#define YAHOO_CLIENT_VERSION_ID "2097087"
1.81 -#define YAHOO_CLIENT_VERSION "8.1.0.421"
1.82 -
1.83 -#define YAHOOJP_CLIENT_VERSION_ID "524223"
1.84 -#define YAHOOJP_CLIENT_VERSION "7,0,1,1"
1.85 -
1.86 -
1.87 -/* Index into attention types list. */
1.88 -#define YAHOO_BUZZ 0
1.89 -
1.90 -enum yahoo_status {
1.91 - YAHOO_STATUS_AVAILABLE = 0,
1.92 - YAHOO_STATUS_BRB,
1.93 - YAHOO_STATUS_BUSY,
1.94 - YAHOO_STATUS_NOTATHOME,
1.95 - YAHOO_STATUS_NOTATDESK,
1.96 - YAHOO_STATUS_NOTINOFFICE,
1.97 - YAHOO_STATUS_ONPHONE,
1.98 - YAHOO_STATUS_ONVACATION,
1.99 - YAHOO_STATUS_OUTTOLUNCH,
1.100 - YAHOO_STATUS_STEPPEDOUT,
1.101 - YAHOO_STATUS_INVISIBLE = 12,
1.102 - YAHOO_STATUS_CUSTOM = 99,
1.103 - YAHOO_STATUS_IDLE = 999,
1.104 - YAHOO_STATUS_WEBLOGIN = 0x5a55aa55,
1.105 - YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
1.106 - YAHOO_STATUS_TYPING = 0x16,
1.107 - YAHOO_STATUS_DISCONNECTED = 0xffffffff /* in ymsg 15. doesnt mean the normal sense of 'disconnected' */
1.108 -};
1.109 -
1.110 -struct yahoo_buddy_icon_upload_data {
1.111 - PurpleConnection *gc;
1.112 - GString *str;
1.113 - char *filename;
1.114 - int pos;
1.115 - int fd;
1.116 - guint watcher;
1.117 -};
1.118 -
1.119 -struct _YchtConn;
1.120 -
1.121 -struct yahoo_data {
1.122 - PurpleConnection *gc;
1.123 - int fd;
1.124 - guchar *rxqueue;
1.125 - int rxlen;
1.126 - PurpleCircBuffer *txbuf;
1.127 - guint txhandler;
1.128 - GHashTable *friends;
1.129 -
1.130 - /**
1.131 - * This is used to keep track of the IMVironment chosen
1.132 - * by people you talk to. We don't do very much with
1.133 - * this right now... but at least now if the remote user
1.134 - * selects an IMVironment we won't reset it back to the
1.135 - * default of nothing.
1.136 - */
1.137 - GHashTable *imvironments;
1.138 -
1.139 - int current_status;
1.140 - gboolean logged_in;
1.141 - GString *tmp_serv_blist, *tmp_serv_ilist, *tmp_serv_plist;
1.142 - GSList *confs;
1.143 - unsigned int conf_id; /* just a counter */
1.144 - gboolean chat_online;
1.145 - gboolean in_chat;
1.146 - char *chat_name;
1.147 - char *pending_chat_room;
1.148 - char *pending_chat_id;
1.149 - char *pending_chat_topic;
1.150 - char *pending_chat_goto;
1.151 - char *auth;
1.152 - gsize auth_written;
1.153 - char *cookie_y;
1.154 - char *cookie_t;
1.155 - int session_id;
1.156 - gboolean jp;
1.157 - gboolean wm; /* connected w/ web messenger method */
1.158 - /* picture aka buddy icon stuff */
1.159 - char *picture_url;
1.160 - int picture_checksum;
1.161 -
1.162 - /* ew. we have to check the icon before we connect,
1.163 - * but can't upload it til we're connected. */
1.164 - struct yahoo_buddy_icon_upload_data *picture_upload_todo;
1.165 - PurpleProxyConnectData *buddy_icon_connect_data;
1.166 -
1.167 - struct _YchtConn *ycht;
1.168 -
1.169 - /**
1.170 - * This linked list contains PurpleUtilFetchUrlData structs
1.171 - * for when we lookup people profile or photo information.
1.172 - */
1.173 - GSList *url_datas;
1.174 - GHashTable *xfer_peer_idstring_map;/*Hey, i dont know, but putting this HashTable next to friends gives a run time fault...*/
1.175 - GSList *cookies;/*contains all cookies, including _y and _t*/
1.176 -
1.177 - /**
1.178 - * We may receive a list15 in multiple packets with no prior warning as to how many we'll be getting;
1.179 - * the server expects us to keep track of the group for which it is sending us contact names.
1.180 - */
1.181 - char *current_list15_grp;
1.182 - time_t last_ping;
1.183 - time_t last_keepalive;
1.184 -};
1.185 -
1.186 -#define YAHOO_MAX_STATUS_MESSAGE_LENGTH (255)
1.187 -
1.188 -/*
1.189 - * Current Maximum Length for Instant Messages
1.190 - *
1.191 - * This was found by experiment.
1.192 - *
1.193 - * The YMSG protocol allows a message of up to 948 bytes, but the official client
1.194 - * limits to 800 characters. According to experiments I conducted, it seems that
1.195 - * the discrepancy is to allow some leeway for messages with mixed single- and
1.196 - * multi-byte characters, as I was able to send messages of 840 and 932 bytes
1.197 - * by using some multibyte characters (some random Chinese or Japanese characters,
1.198 - * to be precise). - rekkanoryo
1.199 - */
1.200 -#define YAHOO_MAX_MESSAGE_LENGTH_BYTES 948
1.201 -#define YAHOO_MAX_MESSAGE_LENGTH_CHARS 800
1.202 -
1.203 -/* sometimes i wish prpls could #include things from other prpls. then i could just
1.204 - * use the routines from libfaim and not have to admit to knowing how they work. */
1.205 -#define yahoo_put16(buf, data) ( \
1.206 - (*(buf) = (unsigned char)((data)>>8)&0xff), \
1.207 - (*((buf)+1) = (unsigned char)(data)&0xff), \
1.208 - 2)
1.209 -#define yahoo_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff))
1.210 -#define yahoo_put32(buf, data) ( \
1.211 - (*((buf)) = (unsigned char)((data)>>24)&0xff), \
1.212 - (*((buf)+1) = (unsigned char)((data)>>16)&0xff), \
1.213 - (*((buf)+2) = (unsigned char)((data)>>8)&0xff), \
1.214 - (*((buf)+3) = (unsigned char)(data)&0xff), \
1.215 - 4)
1.216 -#define yahoo_get32(buf) ((((*(buf))<<24)&0xff000000) + \
1.217 - (((*((buf)+1))<<16)&0x00ff0000) + \
1.218 - (((*((buf)+2))<< 8)&0x0000ff00) + \
1.219 - (((*((buf)+3) )&0x000000ff)))
1.220 -
1.221 -/* util.c */
1.222 -void yahoo_init_colorht(void);
1.223 -void yahoo_dest_colorht(void);
1.224 -char *yahoo_codes_to_html(const char *x);
1.225 -char *yahoo_html_to_codes(const char *src);
1.226 -
1.227 -gboolean
1.228 -yahoo_account_use_http_proxy(PurpleConnection *conn);
1.229 -
1.230 -/**
1.231 - * Encode some text to send to the yahoo server.
1.232 - *
1.233 - * @param gc The connection handle.
1.234 - * @param str The null terminated utf8 string to encode.
1.235 - * @param utf8 If not @c NULL, whether utf8 is okay or not.
1.236 - * Even if it is okay, we may not use it. If we
1.237 - * used it, we set this to @c TRUE, else to
1.238 - * @c FALSE. If @c NULL, false is assumed, and
1.239 - * it is not dereferenced.
1.240 - * @return The g_malloced string in the appropriate encoding.
1.241 - */
1.242 -char *yahoo_string_encode(PurpleConnection *gc, const char *str, gboolean *utf8);
1.243 -
1.244 -/**
1.245 - * Decode some text received from the server.
1.246 - *
1.247 - * @param gc The gc handle.
1.248 - * @param str The null terminated string to decode.
1.249 - * @param utf8 Did the server tell us it was supposed to be utf8?
1.250 - * @return The decoded, utf-8 string, which must be g_free()'d.
1.251 - */
1.252 -char *yahoo_string_decode(PurpleConnection *gc, const char *str, gboolean utf8);
1.253 -
1.254 -char *yahoo_convert_to_numeric(const char *str);
1.255 -
1.256 -/* previously-static functions, now needed for yahoo_profile.c */
1.257 -void yahoo_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full);
1.258 -
1.259 -/* yahoo_profile.c */
1.260 -void yahoo_get_info(PurpleConnection *gc, const char *name);
1.261 -
1.262 -/* needed for xfer, thought theyd be useful for other enhancements later on
1.263 - Returns list of cookies stored in yahoo_data formatted as a single null terminated string
1.264 - returned value must be g_freed
1.265 -*/
1.266 -gchar* yahoo_get_cookies(PurpleConnection *gc);
1.267 -
1.268 -gboolean yahoo_send_attention(PurpleConnection *gc, const char *username, guint type);
1.269 -GList *yahoo_attention_types(PurpleAccount *account);
1.270 -
1.271 -#endif /* _YAHOO_H_ */