comparison src/protocols/oscar/aim.h @ 3952:07283934dedd

[gaim-migrate @ 4133] Ok, big commit with little functionality change. Most of it is me shuffling crap around because I'm one of them neat freaks. Lots of general code cleanup too. I'm trying to move to that whole "one-family-per-file" thing. The details... I added libfaim support for aim's new search family, 0x000f. I only tested this briefly, so if anyone uses it for anything, be aware that it could be buggy. I'll add oscar support sometime. Advantages of this family are... when you search for someone, you get the directory info for that person. So like, first name, middle name, last name, maiden name, city, state, country, zip, address, interests, nickname, and maybe some other stuff. Basically all the info that they've set in their directory info thing. Info. Oh, and I'm calling it "new search" because seach was already taken, and cookie monster ate my right brain. The reason I didn't add support to oscar.c... the new search family requires making a connection to another server. While moving stuff around I realized that I didn't really like how new connections are made. It's kind of sloppy. I'm thinking it would be nice to have an outgoing queue for each type of connection, and then let the client queue messages as much as they want. Then, if libfaim sees that there is a message for a certain type of connection, and there is no open connection of that type, it will connect, and then flush the queue when the connection is made. This seems a lot cleaner, but it also seems like a pain in the ass. I should do ssi for icq first, anyway :-) Also, I think it would be neat if there was an ICBM file that handled channels 1 through 4. Then im.c and chat.c could pass the ICBM part to the icbm stuff and it could get parsed there. im.c is really huge right now. I applied a patch from Graham Booker that paves the way for unicode in direct IMs. Thanks Graham. Now we just need Paco-Paco to git a little free time and write a patch for this. http://sourceforge.net/tracker/index.php?func=detail&aid=633589&group_id=235&atid=300235 I applied 2 patches from Will Mahan dealing with file transfer/oft/rendezous/whatever. Here's some info on them, from The Man himself: Patch 1 "Currently the Rendezvous code is rather messy; this patch attempts to bring it up to speed with the rest of the Oscar prpl. Its changes include: * Rewrite several ft.c functions to use bstreams. Apparently the code in question was written before bstreams were implemented. * Handle incoming Rendezvous packets through the rxqueue like FLAP packets, rather than handling them as a special case as soon as they are received. This takes advantage of the bstream cleanup to unify some code and simplify the aim_frame_t struct. * Change some names used to try to clarify the distinction between OFT, which refers specifically to file transfer, and Rendezvous, which encompasses OFT as well as other types of client-to-client connections." Patch 2 "* Add some comments I inadvertently left out of my last patch. * Fix a double-free that occurs when connections time out. * Correct a bug causing filenames to be truncated by 4 characters on some clients. * Preserve directory structure when sending multiple files. * Handle (throw away) resource forks sent by Mac clients." I also changed all indents to tabs in ft.c. And split all the bstream stuff from rxqueue.c and put it in bstream.c. It really is a separate thing. Especially since it can be used for outgoing connections. Also, I was going to look over the whole patch tonight to make sure it's all good, but it's like 6000 lines, so, uh, I'll do it later. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 13 Nov 2002 07:01:37 +0000
parents e73c48cf1645
children 6efe00ee7de8
comparison
equal deleted inserted replaced
3951:32942c49dced 3952:07283934dedd
214 #define AIM_CONN_TYPE_AUTH 0x0007 214 #define AIM_CONN_TYPE_AUTH 0x0007
215 #define AIM_CONN_TYPE_ADS 0x0005 215 #define AIM_CONN_TYPE_ADS 0x0005
216 #define AIM_CONN_TYPE_BOS 0x0002 216 #define AIM_CONN_TYPE_BOS 0x0002
217 #define AIM_CONN_TYPE_CHAT 0x000e 217 #define AIM_CONN_TYPE_CHAT 0x000e
218 #define AIM_CONN_TYPE_CHATNAV 0x000d 218 #define AIM_CONN_TYPE_CHATNAV 0x000d
219 #define AIM_CONN_TYPE_SEARCH 0x000f
219 #define AIM_CONN_TYPE_EMAIL 0x0018 220 #define AIM_CONN_TYPE_EMAIL 0x0018
220 221
221 /* they start getting arbitrary in rendezvous stuff =) */ 222 /* they start getting arbitrary in rendezvous stuff =) */
222 #define AIM_CONN_TYPE_RENDEZVOUS 0x0101 /* these do not speak FLAP! */ 223 #define AIM_CONN_TYPE_RENDEZVOUS 0x0101 /* these do not speak FLAP! */
223 #define AIM_CONN_TYPE_RENDEZVOUS_OUT 0x0102 /* socket waiting for accept() */ 224 #define AIM_CONN_TYPE_RENDEZVOUS_OUT 0x0102 /* socket waiting for accept() */
285 struct { 286 struct {
286 fu8_t type; 287 fu8_t type;
287 flap_seqnum_t seqnum; 288 flap_seqnum_t seqnum;
288 } flap; 289 } flap;
289 struct { 290 struct {
291 fu8_t magic[4]; /* ODC2 OFT2 */
292 fu16_t hdrlen;
290 fu16_t type; 293 fu16_t type;
291 fu8_t magic[4]; /* ODC2 OFT2 */ 294 } rend;
292 fu16_t hdr2len;
293 fu8_t *hdr2; /* rest of bloated header */
294 } oft;
295 } hdr; 295 } hdr;
296 aim_bstream_t data; /* payload stream */ 296 aim_bstream_t data; /* payload stream */
297 fu8_t handled; /* 0 = new, !0 = been handled */ 297 fu8_t handled; /* 0 = new, !0 = been handled */
298 fu8_t nofree; /* 0 = free data on purge, 1 = only unlink */ 298 fu8_t nofree; /* 0 = free data on purge, 1 = only unlink */
299 aim_conn_t *conn; /* the connection it came in on... */ 299 aim_conn_t *conn; /* the connection it came in on... */
494 faim_internal int aim_puttlv_raw(fu8_t *buf, const fu16_t t, const fu16_t l, const fu8_t *v); 494 faim_internal int aim_puttlv_raw(fu8_t *buf, const fu16_t t, const fu16_t l, const fu8_t *v);
495 #endif 495 #endif
496 496
497 /* TLV list handling. */ 497 /* TLV list handling. */
498 faim_internal aim_tlvlist_t *aim_readtlvchain(aim_bstream_t *bs); 498 faim_internal aim_tlvlist_t *aim_readtlvchain(aim_bstream_t *bs);
499 faim_internal aim_tlvlist_t *aim_readtlvchain_num(aim_bstream_t *bs, fu16_t num);
499 faim_internal void aim_freetlvchain(aim_tlvlist_t **list); 500 faim_internal void aim_freetlvchain(aim_tlvlist_t **list);
500 faim_internal aim_tlv_t *aim_gettlv(aim_tlvlist_t *, fu16_t t, const int n); 501 faim_internal aim_tlv_t *aim_gettlv(aim_tlvlist_t *, fu16_t t, const int n);
501 faim_internal char *aim_gettlv_str(aim_tlvlist_t *, const fu16_t t, const int n); 502 faim_internal char *aim_gettlv_str(aim_tlvlist_t *, const fu16_t t, const int n);
502 faim_internal fu8_t aim_gettlv8(aim_tlvlist_t *list, const fu16_t type, const int num); 503 faim_internal fu8_t aim_gettlv8(aim_tlvlist_t *list, const fu16_t type, const int num);
503 faim_internal fu16_t aim_gettlv16(aim_tlvlist_t *list, const fu16_t t, const int n); 504 faim_internal fu16_t aim_gettlv16(aim_tlvlist_t *list, const fu16_t t, const int n);
883 faim_export int aim_send_im_ext(aim_session_t *sess, struct aim_sendimext_args *args); 884 faim_export int aim_send_im_ext(aim_session_t *sess, struct aim_sendimext_args *args);
884 faim_export int aim_send_im(aim_session_t *, const char *destsn, unsigned short flags, const char *msg); 885 faim_export int aim_send_im(aim_session_t *, const char *destsn, unsigned short flags, const char *msg);
885 faim_export int aim_send_icon(aim_session_t *sess, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum); 886 faim_export int aim_send_icon(aim_session_t *sess, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum);
886 faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen); 887 faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen);
887 faim_export int aim_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing); 888 faim_export int aim_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing);
888 faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg, int len); 889 faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg, int len, int encoding);
889 faim_export const char *aim_directim_getsn(aim_conn_t *conn); 890 faim_export const char *aim_directim_getsn(aim_conn_t *conn);
890 faim_export aim_conn_t *aim_directim_initiate(aim_session_t *, const char *destsn); 891 faim_export aim_conn_t *aim_directim_initiate(aim_session_t *, const char *destsn);
891 faim_export aim_conn_t *aim_directim_connect(aim_session_t *, const char *sn, const char *addr, const fu8_t *cookie); 892 faim_export aim_conn_t *aim_directim_connect(aim_session_t *, const char *sn, const char *addr, const fu8_t *cookie);
892 893
893 faim_export int aim_send_im_ch2_geticqmessage(aim_session_t *sess, const char *sn, int type); 894 faim_export int aim_send_im_ch2_geticqmessage(aim_session_t *sess, const char *sn, int type);
1017 faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn); 1018 faim_export int aim_admin_reqconfirm(aim_session_t *sess, aim_conn_t *conn);
1018 faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info); 1019 faim_export int aim_admin_getinfo(aim_session_t *sess, aim_conn_t *conn, fu16_t info);
1019 faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail); 1020 faim_export int aim_admin_setemail(aim_session_t *sess, aim_conn_t *conn, const char *newemail);
1020 faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick); 1021 faim_export int aim_admin_setnick(aim_session_t *sess, aim_conn_t *conn, const char *newnick);
1021 1022
1022 /* aim_buddylist.c */ 1023 /* buddylist.c */
1023 faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *); 1024 faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *);
1024 faim_export int aim_remove_buddy(aim_session_t *, aim_conn_t *, const char *); 1025 faim_export int aim_remove_buddy(aim_session_t *, aim_conn_t *, const char *);
1025 1026
1026 /* aim_search.c */ 1027 /* search.c */
1027 faim_export int aim_usersearch_address(aim_session_t *, aim_conn_t *, const char *); 1028 faim_export int aim_usersearch_address(aim_session_t *, aim_conn_t *, const char *);
1029
1030 /* newsearch.c */
1031 struct aim_usersearch {
1032 char *first;
1033 char *last;
1034 char *middle;
1035 char *maiden;
1036 char *email;
1037 char *country;
1038 char *state;
1039 char *city;
1040 char *sn;
1041 char *interest;
1042 char *nick;
1043 char *zip;
1044 char *region;
1045 char *address;
1046 struct aim_usersearch *next;
1047 };
1048
1049 faim_export int aim_usersearch_email(aim_session_t *, const char *, const char *);
1050 faim_export int aim_usersearch_name(aim_session_t *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *);
1051 faim_export int aim_usersearch_interest(aim_session_t *, const char *, const char *);
1052
1028 1053
1029 /* These apply to exchanges as well. */ 1054 /* These apply to exchanges as well. */
1030 #define AIM_CHATROOM_FLAG_EVILABLE 0x0001 1055 #define AIM_CHATROOM_FLAG_EVILABLE 0x0001
1031 #define AIM_CHATROOM_FLAG_NAV_ONLY 0x0002 1056 #define AIM_CHATROOM_FLAG_NAV_ONLY 0x0002
1032 #define AIM_CHATROOM_FLAG_INSTANCING_ALLOWED 0x0004 1057 #define AIM_CHATROOM_FLAG_INSTANCING_ALLOWED 0x0004