annotate src/protocols/oscar/icq.c @ 6792:62aec9fd7aca

[gaim-migrate @ 7331] Jesse Farmer (vann) writes: " Oops! gaim_privacy_deny_add only adds someone to the server list if they're not already in the local deny list, but this is exactly the situation with Yahoo! when you add someone to the deny list who is also on your buddy list. The call to gaim_privacy_deny_add was changed to serv_add_deny, and also some formatting issues were cleared up (tabs instead of spaces). The diff is against the "latest" CVS sources in that I applied all the available patches." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 08 Sep 2003 10:07:14 +0000
parents bfe98c4d331e
children 6d3d8f11e765
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
3952
07283934dedd [gaim-migrate @ 4133]
Mark Doliner <mark@kingant.net>
parents: 2742
diff changeset
2 * Family 0x0015 - Encapsulated ICQ.
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 *
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 */
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 #define FAIM_INTERNAL
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 #include <aim.h>
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
9 faim_export int aim_icq_reqofflinemsgs(aim_session_t *sess)
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
10 {
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
11 aim_conn_t *conn;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
12 aim_frame_t *fr;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
13 aim_snacid_t snacid;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
14 int bslen;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
15
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
16 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
17 return -EINVAL;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
18
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
19 bslen = 2 + 4 + 2 + 2;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
20
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
21 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
22 return -ENOMEM;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
23
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
24 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
25 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
26
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
27 /* For simplicity, don't bother using a tlvlist */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
28 aimbs_put16(&fr->data, 0x0001);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
29 aimbs_put16(&fr->data, bslen);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
30
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
31 aimbs_putle16(&fr->data, bslen - 2);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
32 aimbs_putle32(&fr->data, atoi(sess->sn));
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
33 aimbs_putle16(&fr->data, 0x003c); /* I command thee. */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
34 aimbs_putle16(&fr->data, snacid); /* eh. */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
35
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
36 aim_tx_enqueue(sess, fr);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
37
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
38 return 0;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
39 }
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
40
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
41 faim_export int aim_icq_ackofflinemsgs(aim_session_t *sess)
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
42 {
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
43 aim_conn_t *conn;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
44 aim_frame_t *fr;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
45 aim_snacid_t snacid;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
46 int bslen;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
47
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
48 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
49 return -EINVAL;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
50
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
51 bslen = 2 + 4 + 2 + 2;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
52
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
53 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
54 return -ENOMEM;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
55
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
56 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
57 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
58
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
59 /* For simplicity, don't bother using a tlvlist */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
60 aimbs_put16(&fr->data, 0x0001);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
61 aimbs_put16(&fr->data, bslen);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
62
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
63 aimbs_putle16(&fr->data, bslen - 2);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
64 aimbs_putle32(&fr->data, atoi(sess->sn));
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
65 aimbs_putle16(&fr->data, 0x003e); /* I command thee. */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
66 aimbs_putle16(&fr->data, snacid); /* eh. */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
67
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
68 aim_tx_enqueue(sess, fr);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
69
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
70 return 0;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
71 }
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
72
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
73 faim_export int aim_icq_hideip(aim_session_t *sess)
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
74 {
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
75 aim_conn_t *conn;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
76 aim_frame_t *fr;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
77 aim_snacid_t snacid;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
78 int bslen;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
79
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
80 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
81 return -EINVAL;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
82
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
83 bslen = 2+4+2+2+2+4;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
84
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
85 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
86 return -ENOMEM;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
87
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
88 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
89 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
90
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
91 /* For simplicity, don't bother using a tlvlist */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
92 aimbs_put16(&fr->data, 0x0001);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
93 aimbs_put16(&fr->data, bslen);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
94
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
95 aimbs_putle16(&fr->data, bslen - 2);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
96 aimbs_putle32(&fr->data, atoi(sess->sn));
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
97 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
98 aimbs_putle16(&fr->data, snacid); /* eh. */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
99 aimbs_putle16(&fr->data, 0x0424); /* shrug. */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
100 aimbs_putle16(&fr->data, 0x0001);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
101 aimbs_putle16(&fr->data, 0x0001);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
102
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
103 aim_tx_enqueue(sess, fr);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
104
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
105 return 0;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
106 }
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
107
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
108 /**
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
109 * Change your ICQ password.
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
110 *
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
111 * @param sess The oscar session
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
112 * @param passwd The new password. If this is longer than 8 characters it
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
113 * will be truncated.
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
114 * @return Return 0 if no errors, otherwise return the error number.
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
115 */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
116 faim_export int aim_icq_changepasswd(aim_session_t *sess, const char *passwd)
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
117 {
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
118 aim_conn_t *conn;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
119 aim_frame_t *fr;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
120 aim_snacid_t snacid;
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
121 int bslen, passwdlen;
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
122
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
123 if (!passwd)
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
124 return -EINVAL;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
125
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
126 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
127 return -EINVAL;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
128
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
129 passwdlen = strlen(passwd);
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
130 if (passwdlen > MAXICQPASSLEN)
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
131 passwdlen = MAXICQPASSLEN;
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
132 bslen = 2+4+2+2+2+2+passwdlen+1;
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
133
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
134 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
135 return -ENOMEM;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
136
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
137 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
138 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
139
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
140 /* For simplicity, don't bother using a tlvlist */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
141 aimbs_put16(&fr->data, 0x0001);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
142 aimbs_put16(&fr->data, bslen);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
143
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
144 aimbs_putle16(&fr->data, bslen - 2);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
145 aimbs_putle32(&fr->data, atoi(sess->sn));
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
146 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
147 aimbs_putle16(&fr->data, snacid); /* eh. */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
148 aimbs_putle16(&fr->data, 0x042e); /* shrug. */
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
149 aimbs_putle16(&fr->data, passwdlen+1);
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
150 aimbs_putraw(&fr->data, passwd, passwdlen);
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
151 aimbs_putle8(&fr->data, '\0');
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
152
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
153 aim_tx_enqueue(sess, fr);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
154
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
155 return 0;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
156 }
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
157
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
158 faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin)
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
159 {
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
160 aim_conn_t *conn;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
161 aim_frame_t *fr;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
162 aim_snacid_t snacid;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
163 int bslen;
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
164 struct aim_icq_info *info;
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
165
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
166 if (!uin || uin[0] < '0' || uin[0] > '9')
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
167 return -EINVAL;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
168
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
169 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
170 return -EINVAL;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
171
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
172 bslen = 2 + 4 + 2 + 2 + 2 + 4;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
173
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
174 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
175 return -ENOMEM;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
176
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
177 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
178 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
179
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
180 /* For simplicity, don't bother using a tlvlist */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
181 aimbs_put16(&fr->data, 0x0001);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
182 aimbs_put16(&fr->data, bslen);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
183
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
184 aimbs_putle16(&fr->data, bslen - 2);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
185 aimbs_putle32(&fr->data, atoi(sess->sn));
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
186 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
187 aimbs_putle16(&fr->data, snacid); /* eh. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
188 aimbs_putle16(&fr->data, 0x04b2); /* shrug. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
189 aimbs_putle32(&fr->data, atoi(uin));
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
190
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
191 aim_tx_enqueue(sess, fr);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
192
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
193 /* Keep track of this request and the ICQ number and request ID */
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
194 info = (struct aim_icq_info *)calloc(1, sizeof(struct aim_icq_info));
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
195 info->reqid = snacid;
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
196 info->uin = atoi(uin);
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
197 info->next = sess->icq_info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
198 sess->icq_info = info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
199
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
200 return 0;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
201 }
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
202
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
203 faim_export int aim_icq_getalias(aim_session_t *sess, const char *uin)
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
204 {
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
205 aim_conn_t *conn;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
206 aim_frame_t *fr;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
207 aim_snacid_t snacid;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
208 int bslen;
4784
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
209 struct aim_icq_info *info;
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
210
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
211 if (!uin || uin[0] < '0' || uin[0] > '9')
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
212 return -EINVAL;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
213
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
214 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
215 return -EINVAL;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
216
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
217 bslen = 2 + 4 + 2 + 2 + 2 + 4;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
218
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
219 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
220 return -ENOMEM;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
221
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
222 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
223 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
224
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
225 /* For simplicity, don't bother using a tlvlist */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
226 aimbs_put16(&fr->data, 0x0001);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
227 aimbs_put16(&fr->data, bslen);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
228
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
229 aimbs_putle16(&fr->data, bslen - 2);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
230 aimbs_putle32(&fr->data, atoi(sess->sn));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
231 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
232 aimbs_putle16(&fr->data, snacid); /* eh. */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
233 aimbs_putle16(&fr->data, 0x04ba); /* shrug. */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
234 aimbs_putle32(&fr->data, atoi(uin));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
235
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
236 aim_tx_enqueue(sess, fr);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
237
4784
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
238 /* Keep track of this request and the ICQ number and request ID */
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
239 info = (struct aim_icq_info *)calloc(1, sizeof(struct aim_icq_info));
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
240 info->reqid = snacid;
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
241 info->uin = atoi(uin);
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
242 info->next = sess->icq_info;
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
243 sess->icq_info = info;
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
244
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
245 return 0;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
246 }
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
247
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
248 faim_export int aim_icq_getsimpleinfo(aim_session_t *sess, const char *uin)
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
249 {
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
250 aim_conn_t *conn;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
251 aim_frame_t *fr;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
252 aim_snacid_t snacid;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
253 int bslen;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
254
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
255 if (!uin || uin[0] < '0' || uin[0] > '9')
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
256 return -EINVAL;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
257
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
258 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
259 return -EINVAL;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
260
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
261 bslen = 2 + 4 + 2 + 2 + 2 + 4;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
262
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
263 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
264 return -ENOMEM;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
265
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
266 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
267 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
268
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
269 /* For simplicity, don't bother using a tlvlist */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
270 aimbs_put16(&fr->data, 0x0001);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
271 aimbs_put16(&fr->data, bslen);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
272
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
273 aimbs_putle16(&fr->data, bslen - 2);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
274 aimbs_putle32(&fr->data, atoi(sess->sn));
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
275 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
276 aimbs_putle16(&fr->data, snacid); /* eh. */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
277 aimbs_putle16(&fr->data, 0x051f); /* shrug. */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
278 aimbs_putle32(&fr->data, atoi(uin));
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
279
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
280 aim_tx_enqueue(sess, fr);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
281
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
282 return 0;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
283 }
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
284
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
285 faim_export int aim_icq_sendxmlreq(aim_session_t *sess, const char *xml)
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
286 {
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
287 aim_conn_t *conn;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
288 aim_frame_t *fr;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
289 aim_snacid_t snacid;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
290 int bslen;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
291
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
292 if (!xml || !strlen(xml))
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
293 return -EINVAL;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
294
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
295 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
296 return -EINVAL;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
297
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
298 bslen = 2 + 10 + 2 + strlen(xml) + 1;
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
299
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
300 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
301 return -ENOMEM;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
302
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
303 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
304 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
305
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
306 /* For simplicity, don't bother using a tlvlist */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
307 aimbs_put16(&fr->data, 0x0001);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
308 aimbs_put16(&fr->data, bslen);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
309
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
310 aimbs_putle16(&fr->data, bslen - 2);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
311 aimbs_putle32(&fr->data, atoi(sess->sn));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
312 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
313 aimbs_putle16(&fr->data, snacid); /* eh. */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
314 aimbs_putle16(&fr->data, 0x0998); /* shrug. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
315 aimbs_putle16(&fr->data, strlen(xml) + 1);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
316 aimbs_putraw(&fr->data, xml, strlen(xml) + 1);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
317
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
318 aim_tx_enqueue(sess, fr);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
319
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
320 return 0;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
321 }
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
322
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
323 static void aim_icq_freeinfo(struct aim_icq_info *info) {
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
324 int i;
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
325
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
326 if (!info)
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
327 return;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
328 free(info->nick);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
329 free(info->first);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
330 free(info->last);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
331 free(info->email);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
332 free(info->homecity);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
333 free(info->homestate);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
334 free(info->homephone);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
335 free(info->homefax);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
336 free(info->homeaddr);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
337 free(info->mobile);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
338 free(info->homezip);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
339 free(info->personalwebpage);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
340 if (info->email2)
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
341 for (i = 0; i < info->numaddresses; i++)
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
342 free(info->email2[i]);
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
343 free(info->email2);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
344 free(info->workcity);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
345 free(info->workstate);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
346 free(info->workphone);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
347 free(info->workfax);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
348 free(info->workaddr);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
349 free(info->workzip);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
350 free(info->workcompany);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
351 free(info->workdivision);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
352 free(info->workposition);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
353 free(info->workwebpage);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
354 free(info->info);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
355 free(info);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
356 }
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
357
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
358 /**
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
359 * Subtype 0x0003 - Response to 0x0015/0x002, contains an ICQesque packet.
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
360 */
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
361 static int icqresponse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
362 {
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
363 int ret = 0;
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
364 aim_tlvlist_t *tl;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
365 aim_tlv_t *datatlv;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
366 aim_bstream_t qbs;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
367 fu32_t ouruin;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
368 fu16_t cmdlen, cmd, reqid;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
369
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
370 if (!(tl = aim_readtlvchain(bs)) || !(datatlv = aim_gettlv(tl, 0x0001, 1))) {
2733
eeac6ea7ade6 [gaim-migrate @ 2746]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2732
diff changeset
371 aim_freetlvchain(&tl);
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
372 faimdprintf(sess, 0, "corrupt ICQ response\n");
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
373 return 0;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
374 }
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
375
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
376 aim_bstream_init(&qbs, datatlv->value, datatlv->length);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
377
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
378 cmdlen = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
379 ouruin = aimbs_getle32(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
380 cmd = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
381 reqid = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
382
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
383 faimdprintf(sess, 1, "icq response: %d bytes, %ld, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid);
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
384
4075
2221f6801577 [gaim-migrate @ 4290]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
385 if (cmd == 0x0041) { /* offline message */
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
386 struct aim_icq_offlinemsg msg;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
387 aim_rxcallback_t userfunc;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
388
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
389 memset(&msg, 0, sizeof(msg));
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
390
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
391 msg.sender = aimbs_getle32(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
392 msg.year = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
393 msg.month = aimbs_getle8(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
394 msg.day = aimbs_getle8(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
395 msg.hour = aimbs_getle8(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
396 msg.minute = aimbs_getle8(&qbs);
4173
b66f960bfe60 [gaim-migrate @ 4403]
Mark Doliner <mark@kingant.net>
parents: 4154
diff changeset
397 msg.type = aimbs_getle8(&qbs);
b66f960bfe60 [gaim-migrate @ 4403]
Mark Doliner <mark@kingant.net>
parents: 4154
diff changeset
398 msg.flags = aimbs_getle8(&qbs);
4076
91c4bd698d39 [gaim-migrate @ 4291]
Mark Doliner <mark@kingant.net>
parents: 4075
diff changeset
399 msg.msglen = aimbs_getle16(&qbs);
91c4bd698d39 [gaim-migrate @ 4291]
Mark Doliner <mark@kingant.net>
parents: 4075
diff changeset
400 msg.msg = aimbs_getstr(&qbs, msg.msglen);
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
401
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
402 if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSG)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
403 ret = userfunc(sess, rx, &msg);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
404
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
405 free(msg.msg);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
406
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
407 } else if (cmd == 0x0042) {
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
408 aim_rxcallback_t userfunc;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
409
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
410 if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
411 ret = userfunc(sess, rx);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
412
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
413 } else if (cmd == 0x07da) { /* information */
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
414 fu16_t subtype;
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
415 struct aim_icq_info *info;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
416 aim_rxcallback_t userfunc;
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
417
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
418 subtype = aimbs_getle16(&qbs);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
419 aim_bstream_advance(&qbs, 1); /* 0x0a */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
420
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
421 /* find other data from the same request */
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
422 for (info = sess->icq_info; info && (info->reqid != reqid); info = info->next);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
423 if (!info) {
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
424 info = (struct aim_icq_info *)calloc(1, sizeof(struct aim_icq_info));
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
425 info->reqid = reqid;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
426 info->next = sess->icq_info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
427 sess->icq_info = info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
428 }
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
429
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
430 switch (subtype) {
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
431 case 0x00a0: { /* hide ip status */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
432 /* nothing */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
433 } break;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
434
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
435 case 0x00aa: { /* password change status */
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
436 /* nothing */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
437 } break;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
438
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
439 case 0x00c8: { /* general and "home" information */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
440 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
441 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
442 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
443 info->email = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
444 info->homecity = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
445 info->homestate = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
446 info->homephone = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
447 info->homefax = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
448 info->homeaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
449 info->mobile = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
450 info->homezip = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
451 info->homecountry = aimbs_getle16(&qbs);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
452 /* 0x0a 00 02 00 */
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
453 /* 1 byte timezone? */
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
454 /* 1 byte hide email flag? */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
455 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
456
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
457 case 0x00dc: { /* personal information */
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
458 info->age = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
459 info->unknown = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
460 info->gender = aimbs_getle8(&qbs);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
461 info->personalwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
462 info->birthyear = aimbs_getle16(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
463 info->birthmonth = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
464 info->birthday = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
465 info->language1 = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
466 info->language2 = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
467 info->language3 = aimbs_getle8(&qbs);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
468 /* 0x00 00 01 00 00 01 00 00 00 00 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
469 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
470
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
471 case 0x00d2: { /* work information */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
472 info->workcity = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
473 info->workstate = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
474 info->workphone = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
475 info->workfax = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
476 info->workaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
477 info->workzip = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
478 info->workcountry = aimbs_getle16(&qbs);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
479 info->workcompany = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
480 info->workdivision = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
481 info->workposition = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
482 aim_bstream_advance(&qbs, 2); /* 0x01 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
483 info->workwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
484 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
485
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
486 case 0x00e6: { /* additional personal information */
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
487 info->info = aimbs_getstr(&qbs, aimbs_getle16(&qbs)-1);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
488 } break;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
489
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
490 case 0x00eb: { /* email address(es) */
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
491 int i;
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
492 info->numaddresses = aimbs_getle16(&qbs);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
493 info->email2 = (char **)calloc(info->numaddresses, sizeof(char *));
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
494 for (i = 0; i < info->numaddresses; i++) {
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
495 info->email2[i] = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
496 if (i+1 != info->numaddresses)
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
497 aim_bstream_advance(&qbs, 1); /* 0x00 */
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
498 }
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
499 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
500
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
501 case 0x00f0: { /* personal interests */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
502 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
503
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
504 case 0x00fa: { /* past background and current organizations */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
505 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
506
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
507 case 0x0104: { /* alias info */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
508 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
509 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
510 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
511 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); /* email address? */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
512 /* Then 0x00 02 00 */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
513 } break;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
514
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
515 case 0x010e: { /* unknown */
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
516 /* 0x00 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
517 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
518
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
519 case 0x019a: { /* simple info */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
520 aim_bstream_advance(&qbs, 2);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
521 info->uin = aimbs_getle32(&qbs);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
522 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
523 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
524 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
525 info->email = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4154
3468d666d3cc [gaim-migrate @ 4382]
Mark Doliner <mark@kingant.net>
parents: 4151
diff changeset
526 /* Then 0x00 02 00 00 00 00 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
527 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
528 } /* End switch statement */
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
529
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
530 if (!(snac->flags & 0x0001)) {
4784
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
531 if (subtype != 0x0104)
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
532 if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_INFO)))
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
533 ret = userfunc(sess, rx, info);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
534
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
535 if (info->uin && info->nick)
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
536 if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_ALIAS)))
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
537 ret = userfunc(sess, rx, info);
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
538
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
539 if (sess->icq_info == info) {
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
540 sess->icq_info = info->next;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
541 } else {
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
542 struct aim_icq_info *cur;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
543 for (cur=sess->icq_info; (cur->next && (cur->next!=info)); cur=cur->next);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
544 if (cur->next)
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
545 cur->next = cur->next->next;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
546 }
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
547 aim_icq_freeinfo(info);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
548 }
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
549 }
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
550
2732
efa3e7115cb5 [gaim-migrate @ 2745]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2731
diff changeset
551 aim_freetlvchain(&tl);
2731
e9e624d8803e [gaim-migrate @ 2744]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2706
diff changeset
552
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
553 return ret;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
554 }
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
555
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
556 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
557 {
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
558
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
559 if (snac->subtype == 0x0003)
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
560 return icqresponse(sess, mod, rx, snac, bs);
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
561
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
562 return 0;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
563 }
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
564
4830
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
565 static void icq_shutdown(aim_session_t *sess, aim_module_t *mod)
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
566 {
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
567 struct aim_icq_info *del;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
568
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
569 while (sess->icq_info) {
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
570 del = sess->icq_info;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
571 sess->icq_info = sess->icq_info->next;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
572 aim_icq_freeinfo(del);
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
573 }
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
574
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
575 return;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
576 }
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
577
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
578 faim_internal int icq_modfirst(aim_session_t *sess, aim_module_t *mod)
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
579 {
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
580
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
581 mod->family = 0x0015;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
582 mod->version = 0x0001;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
583 mod->toolid = 0x0110;
4071
2532f1192da3 [gaim-migrate @ 4283]
Mark Doliner <mark@kingant.net>
parents: 3952
diff changeset
584 mod->toolversion = 0x047c;
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
585 mod->flags = 0;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
586 strncpy(mod->name, "icq", sizeof(mod->name));
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
587 mod->snachandler = snachandler;
4830
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
588 mod->shutdown = icq_shutdown;
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
589
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
590 return 0;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
591 }