comparison src/protocols/oscar/aim.h @ 7011:4375bf2d9020

[gaim-migrate @ 7574] The user-visible changes? Gaim now shows peep's away messages in their tooltip for AIM over oscar. Things to do: -Make sure this doesn't screw up with huge buddy lists -Replace %n with your screen name, etc. in the tooltip -Leave in b, i, u tags in the tooltip -Fix the 2 8 byte memleaks in locate.c Client authors that aren't me will want to read the following pretty closely... I made some internal libfaim changes. I desire to make libfaim cleaner. I don't know if this really helps or not. Here's what I've done: Changed all the SNAC-sending functions in info.c to NOT take a conn argument. The connection is looked up from the session. I'm trying to make oscar.c less-aware of connections. Added aim_locate_finduserinfo() - Use for getting the aim_userinfo_t for the given screenname. Added aim_locate_getinfoshort() - Use this to request that the servers send you profile info, away message, caps, or a combination of the above. It's like aim_locate_getinfo() but less rate limited. Renamed aim_bos_reqlocaterights() to aim_locate_reqrights() Renamed aim_getinfo() to aim_locate_getinfo() Renamed aim_setdirectoryinfo() to aim_locate_setdirinfo() Renamed aim_0002_000b() to aim_locate_000b() Renamed aim_setuserinterests() to aim_locate_setinterests() Removed aim_userinfo_sn() Removed aim_userinfo_flags() Removed aim_userinfo_idle() Removed aim_userinfo_warnlevel() Removed aim_userinfo_createtime() Removed aim_userinfo_membersince() Removed aim_userinfo_onlinesince() Removed aim_userinfo_sessionlen() Removed aim_userinfo_hascap() Renamed info.c to locate.c Made locate.c keep a static, linked list of nodes of sn, away message, available message, user info. This list is maintained by libfaim automatically. Now clients don't have to keep track of all this stuff themselves, and users won't have to wait for away message/info retrieval if the person is in your buddy list. libfaim uses the iChat way of retrieving stuff, which is not nearly as rate limited as the old way. I actually have a feeling WinAIM uses the same SNAC now (although I didn't check), but I like pluggin iChat because it's innovative. Moved sess->emailinfo to a static variable inside email.c. Removed evilhack from oscar.c I think that's about everything... committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 29 Sep 2003 12:30:03 +0000
parents 594682101ba6
children db041f206848
comparison
equal deleted inserted replaced
7010:eb3ed649252e 7011:4375bf2d9020
441 441
442 aim_msgcookie_t *msgcookies; 442 aim_msgcookie_t *msgcookies;
443 struct aim_icq_info *icq_info; 443 struct aim_icq_info *icq_info;
444 struct aim_oft_info *oft_info; 444 struct aim_oft_info *oft_info;
445 struct aim_authresp_info *authinfo; 445 struct aim_authresp_info *authinfo;
446 struct aim_emailinfo *emailinfo;
447 446
448 /* Server-stored information (ssi) */ 447 /* Server-stored information (ssi) */
449 struct { 448 struct {
450 int received_data; 449 int received_data;
451 fu16_t numitems; 450 fu16_t numitems;
601 faim_export int aim_nop(aim_session_t *, aim_conn_t *); 600 faim_export int aim_nop(aim_session_t *, aim_conn_t *);
602 faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn); 601 faim_export int aim_flap_nop(aim_session_t *sess, aim_conn_t *conn);
603 faim_export int aim_bos_setidle(aim_session_t *, aim_conn_t *, fu32_t); 602 faim_export int aim_bos_setidle(aim_session_t *, aim_conn_t *, fu32_t);
604 faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *); 603 faim_export int aim_bos_changevisibility(aim_session_t *, aim_conn_t *, int, const char *);
605 faim_export int aim_bos_setbuddylist(aim_session_t *, aim_conn_t *, const char *); 604 faim_export int aim_bos_setbuddylist(aim_session_t *, aim_conn_t *, const char *);
606 faim_export int aim_bos_setprofile(aim_session_t *sess, aim_conn_t *conn, const char *profile_encoding, const char *profile, const int profile_len, const char *awaymsg_encoding, const char *awaymsg, const int awaymsg_len, fu32_t caps);
607 faim_export int aim_bos_setgroupperm(aim_session_t *, aim_conn_t *, fu32_t mask); 605 faim_export int aim_bos_setgroupperm(aim_session_t *, aim_conn_t *, fu32_t mask);
608 faim_export int aim_bos_setprivacyflags(aim_session_t *, aim_conn_t *, fu32_t); 606 faim_export int aim_bos_setprivacyflags(aim_session_t *, aim_conn_t *, fu32_t);
609 faim_export int aim_reqpersonalinfo(aim_session_t *, aim_conn_t *); 607 faim_export int aim_reqpersonalinfo(aim_session_t *, aim_conn_t *);
610 faim_export int aim_reqservice(aim_session_t *, aim_conn_t *, fu16_t); 608 faim_export int aim_reqservice(aim_session_t *, aim_conn_t *, fu16_t);
611 faim_export int aim_bos_reqrights(aim_session_t *, aim_conn_t *); 609 faim_export int aim_bos_reqrights(aim_session_t *, aim_conn_t *);
612 faim_export int aim_bos_reqbuddyrights(aim_session_t *, aim_conn_t *); 610 faim_export int aim_bos_reqbuddyrights(aim_session_t *, aim_conn_t *);
613 faim_export int aim_bos_reqlocaterights(aim_session_t *, aim_conn_t *);
614 faim_export int aim_setdirectoryinfo(aim_session_t *sess, aim_conn_t *conn, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy);
615 faim_export int aim_setuserinterests(aim_session_t *sess, aim_conn_t *conn, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, fu16_t privacy);
616 faim_export int aim_setextstatus(aim_session_t *sess, fu32_t status); 611 faim_export int aim_setextstatus(aim_session_t *sess, fu32_t status);
617 612
618 #define AIM_CLIENTTYPE_UNKNOWN 0x0000 613 #define AIM_CLIENTTYPE_UNKNOWN 0x0000
619 #define AIM_CLIENTTYPE_MC 0x0001 614 #define AIM_CLIENTTYPE_MC 0x0001
620 #define AIM_CLIENTTYPE_WINAIM 0x0002 615 #define AIM_CLIENTTYPE_WINAIM 0x0002
934 faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info); 929 faim_export int aim_sendfile_listen(aim_session_t *sess, struct aim_oft_info *oft_info);
935 faim_export int aim_oft_sendheader(aim_session_t *sess, fu16_t type, struct aim_oft_info *oft_info); 930 faim_export int aim_oft_sendheader(aim_session_t *sess, fu16_t type, struct aim_oft_info *oft_info);
936 931
937 932
938 933
939 /* info.c */ 934 /* 0x0002 - locate.c */
940 /* 935 /*
941 * AIM User Info, Standard Form. 936 * AIM User Info, Standard Form.
942 */ 937 */
943 #define AIM_FLAG_UNCONFIRMED 0x0001 /* "damned transients" */ 938 #define AIM_FLAG_UNCONFIRMED 0x0001 /* "damned transients" */
944 #define AIM_FLAG_ADMINISTRATOR 0x0002 939 #define AIM_FLAG_ADMINISTRATOR 0x0002
945 #define AIM_FLAG_AOL 0x0004 940 #define AIM_FLAG_AOL 0x0004
946 #define AIM_FLAG_OSCAR_PAY 0x0008 941 #define AIM_FLAG_OSCAR_PAY 0x0008
947 #define AIM_FLAG_FREE 0x0010 942 #define AIM_FLAG_FREE 0x0010
948 #define AIM_FLAG_AWAY 0x0020 943 #define AIM_FLAG_AWAY 0x0020
949 #define AIM_FLAG_ICQ 0x0040 944 #define AIM_FLAG_ICQ 0x0040
950 #define AIM_FLAG_WIRELESS 0x0080 945 #define AIM_FLAG_WIRELESS 0x0080
951 #define AIM_FLAG_UNKNOWN100 0x0100 946 #define AIM_FLAG_UNKNOWN100 0x0100
952 #define AIM_FLAG_UNKNOWN200 0x0200 947 #define AIM_FLAG_UNKNOWN200 0x0200
953 #define AIM_FLAG_ACTIVEBUDDY 0x0400 948 #define AIM_FLAG_ACTIVEBUDDY 0x0400
954 #define AIM_FLAG_UNKNOWN800 0x0800 949 #define AIM_FLAG_UNKNOWN800 0x0800
955 #define AIM_FLAG_ABINTERNAL 0x1000 950 #define AIM_FLAG_ABINTERNAL 0x1000
956 #define AIM_FLAG_ALLUSERS 0x001f 951 #define AIM_FLAG_ALLUSERS 0x001f
957 952
958 #define AIM_USERINFO_PRESENT_FLAGS 0x00000001 953 #define AIM_USERINFO_PRESENT_FLAGS 0x00000001
959 #define AIM_USERINFO_PRESENT_MEMBERSINCE 0x00000002 954 #define AIM_USERINFO_PRESENT_MEMBERSINCE 0x00000002
960 #define AIM_USERINFO_PRESENT_ONLINESINCE 0x00000004 955 #define AIM_USERINFO_PRESENT_ONLINESINCE 0x00000004
961 #define AIM_USERINFO_PRESENT_IDLE 0x00000008 956 #define AIM_USERINFO_PRESENT_IDLE 0x00000008
964 #define AIM_USERINFO_PRESENT_ICQDATA 0x00000040 959 #define AIM_USERINFO_PRESENT_ICQDATA 0x00000040
965 #define AIM_USERINFO_PRESENT_CAPABILITIES 0x00000080 960 #define AIM_USERINFO_PRESENT_CAPABILITIES 0x00000080
966 #define AIM_USERINFO_PRESENT_SESSIONLEN 0x00000100 961 #define AIM_USERINFO_PRESENT_SESSIONLEN 0x00000100
967 #define AIM_USERINFO_PRESENT_CREATETIME 0x00000200 962 #define AIM_USERINFO_PRESENT_CREATETIME 0x00000200
968 963
969 typedef struct { 964 typedef struct aim_userinfo_s {
970 char sn[MAXSNLEN+1]; 965 char *sn;
971 fu16_t warnlevel; /* evil percent * 10 (999 = 99.9%) */ 966 fu16_t warnlevel; /* evil percent * 10 (999 = 99.9%) */
972 fu16_t idletime; /* in seconds */ 967 fu16_t idletime; /* in seconds */
973 fu16_t flags; 968 fu16_t flags;
974 fu32_t createtime; /* time_t */ 969 fu32_t createtime; /* time_t */
975 fu32_t membersince; /* time_t */ 970 fu32_t membersince; /* time_t */
980 fu32_t status; 975 fu32_t status;
981 fu32_t ipaddr; 976 fu32_t ipaddr;
982 fu8_t crap[0x25]; /* until we figure it out... */ 977 fu8_t crap[0x25]; /* until we figure it out... */
983 } icqinfo; 978 } icqinfo;
984 fu32_t present; 979 fu32_t present;
980
985 fu16_t iconcsumlen; 981 fu16_t iconcsumlen;
986 fu8_t *iconcsum; 982 fu8_t *iconcsum;
987 char *availmsg_encoding; 983
988 char *availmsg; 984 char *info;
989 int availmsg_len; 985 char *info_encoding;
986 fu16_t info_len;
987
988 char *avail;
989 char *avail_encoding;
990 fu16_t avail_len;
991
992 char *away;
993 char *away_encoding;
994 fu16_t away_len;
995
996 struct aim_userinfo_s *next;
990 } aim_userinfo_t; 997 } aim_userinfo_t;
991
992 faim_export const char *aim_userinfo_sn(aim_userinfo_t *ui);
993 faim_export fu16_t aim_userinfo_flags(aim_userinfo_t *ui);
994 faim_export fu16_t aim_userinfo_idle(aim_userinfo_t *ui);
995 faim_export float aim_userinfo_warnlevel(aim_userinfo_t *ui);
996 faim_export time_t aim_userinfo_createtime(aim_userinfo_t *ui);
997 faim_export time_t aim_userinfo_membersince(aim_userinfo_t *ui);
998 faim_export time_t aim_userinfo_onlinesince(aim_userinfo_t *ui);
999 faim_export fu32_t aim_userinfo_sessionlen(aim_userinfo_t *ui);
1000 faim_export int aim_userinfo_hascap(aim_userinfo_t *ui, fu32_t cap);
1001 998
1002 #define AIM_CAPS_BUDDYICON 0x00000001 999 #define AIM_CAPS_BUDDYICON 0x00000001
1003 #define AIM_CAPS_VOICE 0x00000002 1000 #define AIM_CAPS_VOICE 0x00000002
1004 #define AIM_CAPS_DIRECTIM 0x00000004 1001 #define AIM_CAPS_DIRECTIM 0x00000004
1005 #define AIM_CAPS_CHAT 0x00000008 1002 #define AIM_CAPS_CHAT 0x00000008
1021 #define AIM_CAPS_ICHAT 0x00080000 1018 #define AIM_CAPS_ICHAT 0x00080000
1022 #define AIM_CAPS_HIPTOP 0x00100000 1019 #define AIM_CAPS_HIPTOP 0x00100000
1023 #define AIM_CAPS_SECUREIM 0x00200000 1020 #define AIM_CAPS_SECUREIM 0x00200000
1024 #define AIM_CAPS_LAST 0x00400000 1021 #define AIM_CAPS_LAST 0x00400000
1025 1022
1026 faim_export int aim_0002_000b(aim_session_t *sess, aim_conn_t *conn, const char *sn);
1027
1028 #define AIM_SENDMEMBLOCK_FLAG_ISREQUEST 0 1023 #define AIM_SENDMEMBLOCK_FLAG_ISREQUEST 0
1029 #define AIM_SENDMEMBLOCK_FLAG_ISHASH 1 1024 #define AIM_SENDMEMBLOCK_FLAG_ISHASH 1
1030 1025
1031 faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag); 1026 faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag);
1032
1033 #define AIM_GETINFO_GENERALINFO 0x00001
1034 #define AIM_GETINFO_AWAYMESSAGE 0x00003
1035 #define AIM_GETINFO_CAPABILITIES 0x0004
1036 1027
1037 struct aim_invite_priv { 1028 struct aim_invite_priv {
1038 char *sn; 1029 char *sn;
1039 char *roomname; 1030 char *roomname;
1040 fu16_t exchange; 1031 fu16_t exchange;
1056 #define AIM_COOKIETYPE_OFTSEND 0x12 1047 #define AIM_COOKIETYPE_OFTSEND 0x12
1057 #define AIM_COOKIETYPE_OFTVOICE 0x13 1048 #define AIM_COOKIETYPE_OFTVOICE 0x13
1058 #define AIM_COOKIETYPE_OFTIMAGE 0x14 1049 #define AIM_COOKIETYPE_OFTIMAGE 0x14
1059 #define AIM_COOKIETYPE_OFTICON 0x15 1050 #define AIM_COOKIETYPE_OFTICON 0x15
1060 1051
1061 /* 0x0005 */ faim_export int aim_getinfo(aim_session_t *, aim_conn_t *, const char *, fu16_t); 1052 faim_export aim_userinfo_t *aim_locate_finduserinfo(const char *sn);
1053
1054 /* 0x0002 */ faim_export int aim_locate_reqrights(aim_session_t *sess);
1055 /* 0x0004 */ faim_export int aim_locate_setprofile(aim_session_t *sess, const char *profile_encoding, const char *profile, const int profile_len, const char *awaymsg_encoding, const char *awaymsg, const int awaymsg_len, fu32_t caps);
1056 /* 0x0005 */ faim_export int aim_locate_getinfo(aim_session_t *sess, const char *, fu16_t);
1057 /* 0x0009 */ faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy);
1058 /* 0x000b */ faim_export int aim_locate_000b(aim_session_t *sess, const char *sn);
1059 /* 0x000f */ faim_export int aim_locate_setinterests(aim_session_t *sess, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, fu16_t privacy);
1060 /* 0x0015 */ faim_export int aim_locate_getinfoshort(aim_session_t *sess, const char *sn, fu32_t flags);
1062 1061
1063 1062
1064 1063
1065 /* 0x0003 - buddylist.c */ 1064 /* 0x0003 - buddylist.c */
1066 /* 0x0004 */ faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *); 1065 /* 0x0004 */ faim_export int aim_add_buddy(aim_session_t *, aim_conn_t *, const char *);