📄 oscar.h
字号:
GQueue *queued_snacs; /**< Contains QueuedSnacs. */ guint queued_timeout; void *internal; /* internal conn-specific libfaim data */};struct _IcbmCookie{ guchar cookie[8]; int type; void *data; time_t addtime; struct _IcbmCookie *next;};#include "peer.h"/* * AIM Session: The main client-data interface. * */struct _OscarData{ gboolean iconconnecting; gboolean set_icon; GSList *create_rooms; gboolean conf; gboolean reqemail; gboolean setemail; char *email; gboolean setnick; char *newsn; gboolean chpass; char *oldp; char *newp; GSList *oscar_chats; GHashTable *buddyinfo; GSList *requesticon; gboolean killme; gboolean icq; guint icontimer; guint getblisttimer; guint getinfotimer; struct { guint maxwatchers; /* max users who can watch you */ guint maxbuddies; /* max users you can watch */ guint maxgroups; /* max groups in server list */ guint maxpermits; /* max users on permit list */ guint maxdenies; /* max users on deny list */ guint maxsiglen; /* max size (bytes) of profile */ guint maxawaymsglen; /* max size (bytes) of posted away message */ } rights; /* ---- Client Accessible ------------------------ */ /* Our screen name. */ /* TODO: Get rid of this and use purple_account_get_username() everywhere? */ char sn[MAXSNLEN+1]; PurpleConnection *gc; /* ---- Internal Use Only ------------------------ */ void *modlistv; /* * Outstanding snac handling * * TODO: Should these be per-connection? -mid */ void *snac_hash[FAIM_SNAC_HASH_SIZE]; aim_snacid_t snacid_next; /* * TODO: Data specific to a certain family should go into a * hashtable and the core parts of libfaim shouldn't * need to know about them. */ IcbmCookie *msgcookies; struct aim_icq_info *icq_info; struct aim_authresp_info *authinfo; struct aim_emailinfo *emailinfo; struct { struct aim_userinfo_s *userinfo; struct userinfo_node *torequest; struct userinfo_node *requested; gboolean waiting_for_response; } locate; /* Server-stored information (ssi) */ struct { gboolean received_data; guint16 numitems; struct aim_ssi_item *official; struct aim_ssi_item *local; struct aim_ssi_tmp *pending; time_t timestamp; gboolean waiting_for_ack; gboolean in_transaction; } ssi; /** Contains pointers to handler functions for each family/subtype. */ GHashTable *handlerlist; /** A linked list containing FlapConnections. */ GSList *oscar_connections; /** A linked list containing PeerConnections. */ GSList *peer_connections;};/* Valid for calling aim_icq_setstatus() and for aim_userinfo_t->icqinfo.status */#define AIM_ICQ_STATE_NORMAL 0x00000000#define AIM_ICQ_STATE_AWAY 0x00000001#define AIM_ICQ_STATE_DND 0x00000002#define AIM_ICQ_STATE_OUT 0x00000004#define AIM_ICQ_STATE_BUSY 0x00000010#define AIM_ICQ_STATE_CHAT 0x00000020#define AIM_ICQ_STATE_INVISIBLE 0x00000100#define AIM_ICQ_STATE_WEBAWARE 0x00010000#define AIM_ICQ_STATE_HIDEIP 0x00020000#define AIM_ICQ_STATE_BIRTHDAY 0x00080000#define AIM_ICQ_STATE_DIRECTDISABLED 0x00100000#define AIM_ICQ_STATE_ICQHOMEPAGE 0x00200000#define AIM_ICQ_STATE_DIRECTREQUIREAUTH 0x10000000#define AIM_ICQ_STATE_DIRECTCONTACTLIST 0x20000000typedef int (*aim_rxcallback_t)(OscarData *od, FlapConnection *conn, FlapFrame *frame, ...);/* family_auth.c */struct aim_clientrelease{ char *name; guint32 build; char *url; char *info;};struct aim_authresp_info{ char *sn; guint16 errorcode; char *errorurl; guint16 regstatus; char *email; char *bosip; guint16 cookielen; guint8 *cookie; char *chpassurl; struct aim_clientrelease latestrelease; struct aim_clientrelease latestbeta;};/* Callback data for redirect. */struct aim_redirect_data{ guint16 group; const char *ip; guint16 cookielen; const guint8 *cookie; struct { /* group == SNAC_FAMILY_CHAT */ guint16 exchange; const char *room; guint16 instance; } chat;};void aim_clientready(OscarData *od, FlapConnection *conn);int aim_request_login(OscarData *od, FlapConnection *conn, const char *sn);int aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key);/* 0x000b */ int aim_auth_securid_send(OscarData *od, const char *securid);void aim_cleansnacs(OscarData *, int maxage);void oscar_data_addhandler(OscarData *od, guint16 family, guint16 subtype, aim_rxcallback_t newhandler, guint16 flags);aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 subtype);/* flap_connection.c */FlapConnection *flap_connection_new(OscarData *, int type);void flap_connection_close(OscarData *od, FlapConnection *conn);void flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message);void flap_connection_schedule_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message);FlapConnection *flap_connection_findbygroup(OscarData *od, guint16 group);FlapConnection *flap_connection_getbytype(OscarData *, int type);FlapConnection *flap_connection_getbytype_all(OscarData *, int type);void flap_connection_recv_cb(gpointer data, gint source, PurpleInputCondition cond);void flap_connection_send(FlapConnection *conn, FlapFrame *frame);void flap_connection_send_version(OscarData *od, FlapConnection *conn);void flap_connection_send_version_with_cookie(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy);void flap_connection_send_snac(OscarData *od, FlapConnection *conn, guint16 family, const guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data);void flap_connection_send_keepalive(OscarData *od, FlapConnection *conn);FlapFrame *flap_frame_new(OscarData *od, guint16 channel, int datalen);OscarData *oscar_data_new(void);void oscar_data_destroy(OscarData *);/* misc.c */#define AIM_VISIBILITYCHANGE_PERMITADD 0x05#define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06#define AIM_VISIBILITYCHANGE_DENYADD 0x07#define AIM_VISIBILITYCHANGE_DENYREMOVE 0x08#define AIM_PRIVFLAGS_ALLOWIDLE 0x01#define AIM_PRIVFLAGS_ALLOWMEMBERSINCE 0x02#define AIM_WARN_ANON 0x01/* 0x0001 - family_oservice.c *//* 0x0004 */ void aim_srv_requestnew(OscarData *od, guint16 serviceid);/* 0x0006 */ void aim_srv_reqrates(OscarData *od, FlapConnection *conn);/* 0x0008 */ void aim_srv_rates_addparam(OscarData *od, FlapConnection *conn);/* 0x0009 */ void aim_srv_rates_delparam(OscarData *od, FlapConnection *conn);/* 0x000c */ void aim_srv_sendpauseack(OscarData *od, FlapConnection *conn);/* 0x000e */ void aim_srv_reqpersonalinfo(OscarData *od, FlapConnection *conn);/* 0x0011 */ void aim_srv_setidle(OscarData *od, guint32 idletime);/* 0x0014 */ void aim_srv_setprivacyflags(OscarData *od, FlapConnection *conn, guint32);/* 0x0016 */ void aim_srv_nop(OscarData *od, FlapConnection *conn);/* 0x0017 */ void aim_srv_setversions(OscarData *od, FlapConnection *conn);/* 0x001e */ int aim_srv_setextrainfo(OscarData *od, gboolean seticqstatus, guint32 icqstatus, gboolean setavailmsg, const char *availmsg, const char *itmsurl);void aim_bos_reqrights(OscarData *od, FlapConnection *conn);int aim_bos_changevisibility(OscarData *od, FlapConnection *conn, int, const char *);void aim_bos_setgroupperm(OscarData *od, FlapConnection *conn, guint32 mask);#define AIM_CLIENTTYPE_UNKNOWN 0x0000#define AIM_CLIENTTYPE_MC 0x0001#define AIM_CLIENTTYPE_WINAIM 0x0002#define AIM_CLIENTTYPE_WINAIM41 0x0003#define AIM_CLIENTTYPE_AOL_TOC 0x0004guint16 aim_im_fingerprint(const guint8 *msghdr, int len);#define AIM_RATE_CODE_CHANGE 0x0001#define AIM_RATE_CODE_WARNING 0x0002#define AIM_RATE_CODE_LIMIT 0x0003#define AIM_RATE_CODE_CLEARLIMIT 0x0004void aim_ads_requestads(OscarData *od, FlapConnection *conn);/* family_icbm.c */#define AIM_OFT_SUBTYPE_SEND_FILE 0x0001#define AIM_OFT_SUBTYPE_SEND_DIR 0x0002#define AIM_OFT_SUBTYPE_GET_FILE 0x0011#define AIM_OFT_SUBTYPE_GET_LIST 0x0012#define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000#define AIM_TRANSFER_DENY_DECLINE 0x0001#define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002#define AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED 0x00000001#define AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED 0x00000002/* This is what the server will give you if you don't set them yourself. */#define AIM_IMPARAM_DEFAULTS { \ 0, \ AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \ 512, /* !! Note how small this is. */ \ (99.9)*10, (99.9)*10, \ 1000 /* !! And how large this is. */ \}/* This is what most AIM versions use. */#define AIM_IMPARAM_REASONABLE { \ 0, \ AIM_IMPARAM_FLAG_CHANMSGS_ALLOWED | AIM_IMPARAM_FLAG_MISSEDCALLS_ENABLED, \ 8000, \ (99.9)*10, (99.9)*10, \ 0 \}struct aim_icbmparameters{ guint16 maxchan; guint32 flags; /* AIM_IMPARAM_FLAG_ */ guint16 maxmsglen; /* message size that you will accept */ guint16 maxsenderwarn; /* this and below are *10 (999=99.9%) */ guint16 maxrecverwarn; guint32 minmsginterval; /* in milliseconds? */};/* * TODO: Should probably combine this with struct chat_connection. */struct aim_chat_roominfo{ guint16 exchange; char *name; guint8 namelen; guint16 instance;};struct chat_connection{ char *name; char *show; /* AOL did something funny to us */ guint16 exchange; guint16 instance; FlapConnection *conn; int id; PurpleConnection *gc; PurpleConversation *conv; int maxlen; int maxvis;};/* * All this chat struct stuff should be in family_chat.c */void oscar_chat_destroy(struct chat_connection *cc);#define AIM_IMFLAGS_AWAY 0x0001 /* mark as an autoreply */#define AIM_IMFLAGS_ACK 0x0002 /* request a receipt notice */#define AIM_IMFLAGS_BUDDYREQ 0x0010 /* buddy icon requested */#define AIM_IMFLAGS_HASICON 0x0020 /* already has icon */#define AIM_IMFLAGS_SUBENC_MACINTOSH 0x0040 /* damn that Steve Jobs! */#define AIM_IMFLAGS_CUSTOMFEATURES 0x0080 /* features field present */#define AIM_IMFLAGS_EXTDATA 0x0100#define AIM_IMFLAGS_X 0x0200#define AIM_IMFLAGS_MULTIPART 0x0400 /* ->mpmsg section valid */#define AIM_IMFLAGS_OFFLINE 0x0800 /* send to offline user */#define AIM_IMFLAGS_TYPINGNOT 0x1000 /* typing notification */#define AIM_CHARSET_ASCII 0x0000#define AIM_CHARSET_UNICODE 0x0002 /* UCS-2BE */#define AIM_CHARSET_CUSTOM 0x0003/* * Multipart message structures. */typedef struct aim_mpmsg_section_s{ guint16 charset; guint16 charsubset; gchar *data; guint16 datalen; struct aim_mpmsg_section_s *next;} aim_mpmsg_section_t;typedef struct aim_mpmsg_s{ unsigned int numparts; aim_mpmsg_section_t *parts;} aim_mpmsg_t;int aim_mpmsg_init(OscarData *od, aim_mpmsg_t *mpm);int aim_mpmsg_addraw(OscarData *od, aim_mpmsg_t *mpm, guint16 charset, guint16 charsubset, const gchar *data, guint16 datalen);int aim_mpmsg_addascii(OscarData *od, aim_mpmsg_t *mpm, const char *ascii);int aim_mpmsg_addunicode(OscarData *od, aim_mpmsg_t *mpm, const guint16 *unicode, guint16 unicodelen);void aim_mpmsg_free(OscarData *od, aim_mpmsg_t *mpm);/* * Arguments to aim_send_im_ext(). * * This is really complicated. But immensely versatile. * */struct aim_sendimext_args{ /* These are _required_ */ const char *destsn; guint32 flags; /* often 0 */ /* Only required if not using multipart messages */ const char *msg; int msglen; /* Required if ->msg is not provided */ aim_mpmsg_t *mpmsg; /* Only used if AIM_IMFLAGS_HASICON is set */ guint32 iconlen; time_t iconstamp; guint32 iconsum; /* Only used if AIM_IMFLAGS_CUSTOMFEATURES is set */ guint16 featureslen; guint8 *features; /* Only used if AIM_IMFLAGS_CUSTOMCHARSET is set and mpmsg not used */ guint16 charset; guint16 charsubset;};/* * Arguments to aim_send_rtfmsg(). */struct aim_sendrtfmsg_args{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -