annotate src/protocols/oscar/icq.c @ 11208:0a3a85452896

[gaim-migrate @ 13339] Judging from Adam's latest commit to upnp.c, I jumped the gun yesterday when I committed the change here. I'm reverting, so this matches upnp.c again. Adam, my apologies. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 08 Aug 2005 16:07:27 +0000
parents 137ce6382675
children 7d31d61e6438
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
10570
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
73 /**
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
74 * Set your ICQ security.
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
75 *
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
76 * @param sess The oscar session.
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
77 * @param auth Ask authorization when a buddy adds us?
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
78 * @param web Show our presence on the ICQ web site.
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
79 * @param hide Hide our IP address.
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
80 * @return Return 0 if no errors, otherwise return the error number.
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
81 */
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
82 faim_export int aim_icq_setsecurity(aim_session_t *sess, const int auth, const int web, const int hide)
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
83 {
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
84 aim_conn_t *conn;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
85 aim_frame_t *fr;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
86 aim_snacid_t snacid;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
87 int bslen;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
88
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
89 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
90 return -EINVAL;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
91
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
92 bslen = 2+4+2+2+2+4;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
93
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
94 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
95 return -ENOMEM;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
96
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
97 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
98 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
99
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
100 /* For simplicity, don't bother using a tlvlist */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
101 aimbs_put16(&fr->data, 0x0001);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
102 aimbs_put16(&fr->data, bslen);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
103
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
104 aimbs_putle16(&fr->data, bslen - 2);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
105 aimbs_putle32(&fr->data, atoi(sess->sn));
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
106 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
107 aimbs_putle16(&fr->data, snacid); /* eh. */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
108 aimbs_putle16(&fr->data, 0x0424); /* shrug. */
10570
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
109 aimbs_putle8(&fr->data, (auth == TRUE) ? 0x00 : 0x01);
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
110 aimbs_putle8(&fr->data, (web == TRUE) ? 0x00 : 0x01);
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
111 aimbs_putle8(&fr->data, (hide == TRUE) ? 0x00 : 0x01);
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
112 aimbs_putle8(&fr->data, 0x00);
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
113
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
114 aim_tx_enqueue(sess, fr);
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
115
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
116 return 0;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
117 }
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
118
10570
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
119 /**
10595
de34037a02c7 [gaim-migrate @ 12010]
Mark Doliner <mark@kingant.net>
parents: 10570
diff changeset
120 * I'm not really sure what the difference is between this function
de34037a02c7 [gaim-migrate @ 12010]
Mark Doliner <mark@kingant.net>
parents: 10570
diff changeset
121 * and the one above. They both definitely exist.
10570
2b05acfeec65 [gaim-migrate @ 11960]
Mark Doliner <mark@kingant.net>
parents: 10560
diff changeset
122 */
10560
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
123 faim_export int aim_icq_setauthsetting(aim_session_t *sess, int auth_required)
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
124 {
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
125 aim_conn_t *conn;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
126 aim_frame_t *fr;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
127 aim_snacid_t snacid;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
128 int bslen;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
129
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
130 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
131 return -EINVAL;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
132
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
133 bslen = 2+4+2+2+2+4;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
134
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
135 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen)))
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
136 return -ENOMEM;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
137
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
138 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
139 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
140
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
141 /* For simplicity, don't bother using a tlvlist */
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
142 aimbs_put16(&fr->data, 0x0001);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
143 aimbs_put16(&fr->data, bslen);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
144
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
145 aimbs_putle16(&fr->data, bslen - 2);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
146 aimbs_putle32(&fr->data, atoi(sess->sn));
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
147 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
148 aimbs_putle16(&fr->data, snacid); /* eh. */
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
149 aimbs_putle16(&fr->data, 0x0c3a); /* shrug. */
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
150 aimbs_putle16(&fr->data, 0x02f8);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
151 aimbs_putle16(&fr->data, 0x0001);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
152 aimbs_putle8(&fr->data, auth_required);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
153 aimbs_putle8(&fr->data, 0x0c);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
154 aimbs_putle16(&fr->data, 0x0103);
10595
de34037a02c7 [gaim-migrate @ 12010]
Mark Doliner <mark@kingant.net>
parents: 10570
diff changeset
155 aimbs_putle16(&fr->data, 0x0000); /* web enabled or not! */
10560
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
156
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
157 aim_tx_enqueue(sess, fr);
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
158
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
159 return 0;
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
160 }
33746d45bd0d [gaim-migrate @ 11938]
Mark Doliner <mark@kingant.net>
parents: 8902
diff changeset
161
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
162 /**
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
163 * Change your ICQ password.
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
164 *
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
165 * @param sess The oscar session
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
166 * @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
167 * will be truncated.
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
168 * @return Return 0 if no errors, otherwise return the error number.
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
169 */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
170 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
171 {
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
172 aim_conn_t *conn;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
173 aim_frame_t *fr;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
174 aim_snacid_t snacid;
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
175 int bslen, passwdlen;
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
176
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
177 if (!passwd)
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
178 return -EINVAL;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
179
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
180 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
181 return -EINVAL;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
182
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
183 passwdlen = strlen(passwd);
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
184 if (passwdlen > MAXICQPASSLEN)
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
185 passwdlen = MAXICQPASSLEN;
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
186 bslen = 2+4+2+2+2+2+passwdlen+1;
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
187
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
188 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
189 return -ENOMEM;
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 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
192 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
193
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
194 /* For simplicity, don't bother using a tlvlist */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
195 aimbs_put16(&fr->data, 0x0001);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
196 aimbs_put16(&fr->data, bslen);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
197
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
198 aimbs_putle16(&fr->data, bslen - 2);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
199 aimbs_putle32(&fr->data, atoi(sess->sn));
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
200 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
201 aimbs_putle16(&fr->data, snacid); /* eh. */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
202 aimbs_putle16(&fr->data, 0x042e); /* shrug. */
5345
bfe98c4d331e [gaim-migrate @ 5721]
Mark Doliner <mark@kingant.net>
parents: 4830
diff changeset
203 aimbs_putle16(&fr->data, passwdlen+1);
10997
137ce6382675 [gaim-migrate @ 12839]
Mark Doliner <mark@kingant.net>
parents: 10595
diff changeset
204 aimbs_putstr(&fr->data, passwd);
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
205 aimbs_putle8(&fr->data, '\0');
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
206
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
207 aim_tx_enqueue(sess, fr);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
208
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
209 return 0;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
210 }
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
211
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
212 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
213 {
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
214 aim_conn_t *conn;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
215 aim_frame_t *fr;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
216 aim_snacid_t snacid;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
217 int bslen;
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
218 struct aim_icq_info *info;
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
219
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
220 if (!uin || uin[0] < '0' || uin[0] > '9')
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
221 return -EINVAL;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
222
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
223 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
224 return -EINVAL;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
225
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
226 bslen = 2 + 4 + 2 + 2 + 2 + 4;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
227
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
228 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
229 return -ENOMEM;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
230
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
231 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
232 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
233
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
234 /* For simplicity, don't bother using a tlvlist */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
235 aimbs_put16(&fr->data, 0x0001);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
236 aimbs_put16(&fr->data, bslen);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
237
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
238 aimbs_putle16(&fr->data, bslen - 2);
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
239 aimbs_putle32(&fr->data, atoi(sess->sn));
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
240 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
241 aimbs_putle16(&fr->data, snacid); /* eh. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
242 aimbs_putle16(&fr->data, 0x04b2); /* shrug. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
243 aimbs_putle32(&fr->data, atoi(uin));
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
244
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
245 aim_tx_enqueue(sess, fr);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
246
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
247 /* 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
248 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
249 info->reqid = snacid;
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
250 info->uin = atoi(uin);
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
251 info->next = sess->icq_info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
252 sess->icq_info = info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
253
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
254 return 0;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
255 }
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
256
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
257 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
258 {
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
259 aim_conn_t *conn;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
260 aim_frame_t *fr;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
261 aim_snacid_t snacid;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
262 int bslen;
4784
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
263 struct aim_icq_info *info;
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
264
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
265 if (!uin || uin[0] < '0' || uin[0] > '9')
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
266 return -EINVAL;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
267
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
268 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
269 return -EINVAL;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
270
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
271 bslen = 2 + 4 + 2 + 2 + 2 + 4;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
272
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
273 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
274 return -ENOMEM;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
275
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
276 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
277 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
278
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
279 /* For simplicity, don't bother using a tlvlist */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
280 aimbs_put16(&fr->data, 0x0001);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
281 aimbs_put16(&fr->data, bslen);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
282
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
283 aimbs_putle16(&fr->data, bslen - 2);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
284 aimbs_putle32(&fr->data, atoi(sess->sn));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
285 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
286 aimbs_putle16(&fr->data, snacid); /* eh. */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
287 aimbs_putle16(&fr->data, 0x04ba); /* shrug. */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
288 aimbs_putle32(&fr->data, atoi(uin));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
289
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
290 aim_tx_enqueue(sess, fr);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
291
4784
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
292 /* 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
293 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
294 info->reqid = snacid;
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
295 info->uin = atoi(uin);
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
296 info->next = sess->icq_info;
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
297 sess->icq_info = info;
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
298
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
299 return 0;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
300 }
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
301
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
302 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
303 {
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
304 aim_conn_t *conn;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
305 aim_frame_t *fr;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
306 aim_snacid_t snacid;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
307 int bslen;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
308
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
309 if (!uin || uin[0] < '0' || uin[0] > '9')
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
310 return -EINVAL;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
311
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
312 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
313 return -EINVAL;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
314
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
315 bslen = 2 + 4 + 2 + 2 + 2 + 4;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
316
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
317 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
318 return -ENOMEM;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
319
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
320 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
321 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
322
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
323 /* For simplicity, don't bother using a tlvlist */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
324 aimbs_put16(&fr->data, 0x0001);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
325 aimbs_put16(&fr->data, bslen);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
326
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
327 aimbs_putle16(&fr->data, bslen - 2);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
328 aimbs_putle32(&fr->data, atoi(sess->sn));
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
329 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
330 aimbs_putle16(&fr->data, snacid); /* eh. */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
331 aimbs_putle16(&fr->data, 0x051f); /* shrug. */
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
332 aimbs_putle32(&fr->data, atoi(uin));
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
333
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
334 aim_tx_enqueue(sess, fr);
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
335
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
336 return 0;
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
337 }
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
338
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
339 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
340 {
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
341 aim_conn_t *conn;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
342 aim_frame_t *fr;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
343 aim_snacid_t snacid;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
344 int bslen;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
345
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
346 if (!xml || !strlen(xml))
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
347 return -EINVAL;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
348
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
349 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
350 return -EINVAL;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
351
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
352 bslen = 2 + 10 + 2 + strlen(xml) + 1;
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
353
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
354 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
355 return -ENOMEM;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
356
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
357 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
358 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
359
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
360 /* For simplicity, don't bother using a tlvlist */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
361 aimbs_put16(&fr->data, 0x0001);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
362 aimbs_put16(&fr->data, bslen);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
363
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
364 aimbs_putle16(&fr->data, bslen - 2);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
365 aimbs_putle32(&fr->data, atoi(sess->sn));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
366 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
367 aimbs_putle16(&fr->data, snacid); /* eh. */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
368 aimbs_putle16(&fr->data, 0x0998); /* shrug. */
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
369 aimbs_putle16(&fr->data, strlen(xml) + 1);
10997
137ce6382675 [gaim-migrate @ 12839]
Mark Doliner <mark@kingant.net>
parents: 10595
diff changeset
370 aimbs_putraw(&fr->data, (fu8_t *)xml, strlen(xml) + 1);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
371
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
372 aim_tx_enqueue(sess, fr);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
373
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
374 return 0;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
375 }
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
376
7282
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
377 /*
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
378 * Send an SMS message. This is the non-US way. The US-way is to IM
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
379 * their cell phone number (+19195551234).
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
380 *
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
381 * We basically construct and send an XML message. The format is:
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
382 * <icq_sms_message>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
383 * <destination>full_phone_without_leading_+</destination>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
384 * <text>message</text>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
385 * <codepage>1252</codepage>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
386 * <senders_UIN>self_uin</senders_UIN>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
387 * <senders_name>self_name</senders_name>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
388 * <delivery_receipt>Yes|No</delivery_receipt>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
389 * <time>Wkd, DD Mmm YYYY HH:MM:SS TMZ</time>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
390 * </icq_sms_message>
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
391 *
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
392 * Yeah hi Peter, whaaaat's happening. If there's any way to use
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
393 * a codepage other than 1252 that would be great. Thaaaanks.
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
394 */
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
395 faim_export int aim_icq_sendsms(aim_session_t *sess, const char *name, const char *msg, const char *alias)
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
396 {
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
397 aim_conn_t *conn;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
398 aim_frame_t *fr;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
399 aim_snacid_t snacid;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
400 int bslen, xmllen;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
401 char *xml, timestr[30];
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
402 time_t t;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
403 struct tm *tm;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
404
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
405 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015)))
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
406 return -EINVAL;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
407
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
408 if (!name || !msg || !alias)
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
409 return -EINVAL;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
410
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
411 time(&t);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
412 tm = gmtime(&t);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
413 strftime(timestr, 30, "%a, %d %b %Y %T %Z", tm);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
414
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
415 /* The length of xml included the null terminating character */
7301
0ed0ac132b1b [gaim-migrate @ 7885]
Mark Doliner <mark@kingant.net>
parents: 7282
diff changeset
416 xmllen = 225 + strlen(name) + strlen(msg) + strlen(sess->sn) + strlen(alias) + strlen(timestr) + 1;
7282
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
417
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
418 if (!(xml = (char *)malloc(xmllen*sizeof(char))))
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
419 return -ENOMEM;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
420 snprintf(xml, xmllen, "<icq_sms_message>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
421 "\t<destination>%s</destination>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
422 "\t<text>%s</text>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
423 "\t<codepage>1252</codepage>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
424 "\t<senders_UIN>%s</senders_UIN>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
425 "\t<senders_name>%s</senders_name>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
426 "\t<delivery_receipt>Yes</delivery_receipt>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
427 "\t<time>%s</time>\n"
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
428 "</icq_sms_message>\n",
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
429 name, msg, sess->sn, alias, timestr);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
430
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
431 bslen = 37 + xmllen;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
432
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
433 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) {
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
434 free(xml);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
435 return -ENOMEM;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
436 }
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
437
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
438 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
439 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
440
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
441 /* For simplicity, don't bother using a tlvlist */
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
442 aimbs_put16(&fr->data, 0x0001);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
443 aimbs_put16(&fr->data, bslen);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
444
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
445 aimbs_putle16(&fr->data, bslen - 2);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
446 aimbs_putle32(&fr->data, atoi(sess->sn));
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
447 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
448 aimbs_putle16(&fr->data, snacid); /* eh. */
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
449
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
450 /* From libicq200-0.3.2/src/SNAC-SRV.cpp */
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
451 aimbs_putle16(&fr->data, 0x8214);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
452 aimbs_put16(&fr->data, 0x0001);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
453 aimbs_put16(&fr->data, 0x0016);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
454 aimbs_put32(&fr->data, 0x00000000);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
455 aimbs_put32(&fr->data, 0x00000000);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
456 aimbs_put32(&fr->data, 0x00000000);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
457 aimbs_put32(&fr->data, 0x00000000);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
458
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
459 aimbs_put16(&fr->data, 0x0000);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
460 aimbs_put16(&fr->data, xmllen);
10997
137ce6382675 [gaim-migrate @ 12839]
Mark Doliner <mark@kingant.net>
parents: 10595
diff changeset
461 aimbs_putstr(&fr->data, xml);
7282
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
462
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
463 aim_tx_enqueue(sess, fr);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
464
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
465 free(xml);
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
466
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
467 return 0;
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
468 }
ad243bc63184 [gaim-migrate @ 7861]
Mark Doliner <mark@kingant.net>
parents: 7167
diff changeset
469
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
470 static void aim_icq_freeinfo(struct aim_icq_info *info) {
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
471 int i;
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
472
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
473 if (!info)
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
474 return;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
475 free(info->nick);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
476 free(info->first);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
477 free(info->last);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
478 free(info->email);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
479 free(info->homecity);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
480 free(info->homestate);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
481 free(info->homephone);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
482 free(info->homefax);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
483 free(info->homeaddr);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
484 free(info->mobile);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
485 free(info->homezip);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
486 free(info->personalwebpage);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
487 if (info->email2)
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
488 for (i = 0; i < info->numaddresses; i++)
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
489 free(info->email2[i]);
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
490 free(info->email2);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
491 free(info->workcity);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
492 free(info->workstate);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
493 free(info->workphone);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
494 free(info->workfax);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
495 free(info->workaddr);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
496 free(info->workzip);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
497 free(info->workcompany);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
498 free(info->workdivision);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
499 free(info->workposition);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
500 free(info->workwebpage);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
501 free(info->info);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
502 free(info);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
503 }
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
504
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
505 /**
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
506 * Subtype 0x0003 - Response to 0x0015/0x002, contains an ICQesque packet.
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
507 */
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
508 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
509 {
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
510 int ret = 0;
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
511 aim_tlvlist_t *tl;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
512 aim_tlv_t *datatlv;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
513 aim_bstream_t qbs;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
514 fu32_t ouruin;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
515 fu16_t cmdlen, cmd, reqid;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
516
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 5345
diff changeset
517 if (!(tl = aim_tlvlist_read(bs)) || !(datatlv = aim_tlv_gettlv(tl, 0x0001, 1))) {
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 5345
diff changeset
518 aim_tlvlist_free(&tl);
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
519 faimdprintf(sess, 0, "corrupt ICQ response\n");
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
520 return 0;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
521 }
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
522
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
523 aim_bstream_init(&qbs, datatlv->value, datatlv->length);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
524
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
525 cmdlen = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
526 ouruin = aimbs_getle32(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
527 cmd = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
528 reqid = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
529
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
530 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
531
4075
2221f6801577 [gaim-migrate @ 4290]
Mark Doliner <mark@kingant.net>
parents: 4071
diff changeset
532 if (cmd == 0x0041) { /* offline message */
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
533 struct aim_icq_offlinemsg msg;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
534 aim_rxcallback_t userfunc;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
535
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
536 memset(&msg, 0, sizeof(msg));
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
537
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
538 msg.sender = aimbs_getle32(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
539 msg.year = aimbs_getle16(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
540 msg.month = aimbs_getle8(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
541 msg.day = aimbs_getle8(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
542 msg.hour = aimbs_getle8(&qbs);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
543 msg.minute = aimbs_getle8(&qbs);
4173
b66f960bfe60 [gaim-migrate @ 4403]
Mark Doliner <mark@kingant.net>
parents: 4154
diff changeset
544 msg.type = aimbs_getle8(&qbs);
b66f960bfe60 [gaim-migrate @ 4403]
Mark Doliner <mark@kingant.net>
parents: 4154
diff changeset
545 msg.flags = aimbs_getle8(&qbs);
4076
91c4bd698d39 [gaim-migrate @ 4291]
Mark Doliner <mark@kingant.net>
parents: 4075
diff changeset
546 msg.msglen = aimbs_getle16(&qbs);
91c4bd698d39 [gaim-migrate @ 4291]
Mark Doliner <mark@kingant.net>
parents: 4075
diff changeset
547 msg.msg = aimbs_getstr(&qbs, msg.msglen);
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
548
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
549 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
550 ret = userfunc(sess, rx, &msg);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
551
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
552 free(msg.msg);
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
553
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
554 } else if (cmd == 0x0042) {
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
555 aim_rxcallback_t userfunc;
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
556
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
557 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
558 ret = userfunc(sess, rx);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
559
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
560 } else if (cmd == 0x07da) { /* information */
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
561 fu16_t subtype;
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
562 struct aim_icq_info *info;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
563 aim_rxcallback_t userfunc;
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
564
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
565 subtype = aimbs_getle16(&qbs);
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
566 aim_bstream_advance(&qbs, 1); /* 0x0a */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
567
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
568 /* find other data from the same request */
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
569 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
570 if (!info) {
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
571 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
572 info->reqid = reqid;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
573 info->next = sess->icq_info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
574 sess->icq_info = info;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
575 }
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
576
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
577 switch (subtype) {
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
578 case 0x00a0: { /* hide ip status */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
579 /* nothing */
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
580 } break;
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
581
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
582 case 0x00aa: { /* password change status */
4664
eab1309693b8 [gaim-migrate @ 4975]
Mark Doliner <mark@kingant.net>
parents: 4625
diff changeset
583 /* nothing */
4617
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
584 } break;
858979ab3867 [gaim-migrate @ 4908]
Mark Doliner <mark@kingant.net>
parents: 4173
diff changeset
585
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
586 case 0x00c8: { /* general and "home" information */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
587 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
588 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
589 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
590 info->email = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
591 info->homecity = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
592 info->homestate = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
593 info->homephone = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
594 info->homefax = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
595 info->homeaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
596 info->mobile = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
597 info->homezip = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
598 info->homecountry = aimbs_getle16(&qbs);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
599 /* 0x0a 00 02 00 */
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
600 /* 1 byte timezone? */
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
601 /* 1 byte hide email flag? */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
602 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
603
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
604 case 0x00dc: { /* personal information */
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
605 info->age = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
606 info->unknown = aimbs_getle8(&qbs);
8902
cb3dd3a4c71c [gaim-migrate @ 9671]
Mark Doliner <mark@kingant.net>
parents: 7301
diff changeset
607 info->gender = aimbs_getle8(&qbs); /* Not specified=0x00, Female=0x01, Male=0x02 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
608 info->personalwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
609 info->birthyear = aimbs_getle16(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
610 info->birthmonth = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
611 info->birthday = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
612 info->language1 = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
613 info->language2 = aimbs_getle8(&qbs);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
614 info->language3 = aimbs_getle8(&qbs);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
615 /* 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
616 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
617
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
618 case 0x00d2: { /* work information */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
619 info->workcity = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
620 info->workstate = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
621 info->workphone = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
622 info->workfax = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
623 info->workaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
624 info->workzip = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
625 info->workcountry = aimbs_getle16(&qbs);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
626 info->workcompany = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
627 info->workdivision = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
628 info->workposition = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
629 aim_bstream_advance(&qbs, 2); /* 0x01 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
630 info->workwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
631 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
632
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
633 case 0x00e6: { /* additional personal information */
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
634 info->info = aimbs_getstr(&qbs, aimbs_getle16(&qbs)-1);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
635 } break;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
636
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
637 case 0x00eb: { /* email address(es) */
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
638 int i;
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
639 info->numaddresses = aimbs_getle16(&qbs);
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
640 info->email2 = (char **)calloc(info->numaddresses, sizeof(char *));
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
641 for (i = 0; i < info->numaddresses; i++) {
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
642 info->email2[i] = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
643 if (i+1 != info->numaddresses)
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
644 aim_bstream_advance(&qbs, 1); /* 0x00 */
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
645 }
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
646 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
647
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
648 case 0x00f0: { /* personal interests */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
649 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
650
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
651 case 0x00fa: { /* past background and current organizations */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
652 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
653
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
654 case 0x0104: { /* alias info */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
655 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
656 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
657 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
658 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); /* email address? */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
659 /* Then 0x00 02 00 */
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
660 } break;
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
661
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
662 case 0x010e: { /* unknown */
4625
819ba05f5b1b [gaim-migrate @ 4916]
Mark Doliner <mark@kingant.net>
parents: 4624
diff changeset
663 /* 0x00 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
664 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
665
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
666 case 0x019a: { /* simple info */
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
667 aim_bstream_advance(&qbs, 2);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
668 info->uin = aimbs_getle32(&qbs);
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
669 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
670 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
671 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
672 info->email = aimbs_getstr(&qbs, aimbs_getle16(&qbs));
4154
3468d666d3cc [gaim-migrate @ 4382]
Mark Doliner <mark@kingant.net>
parents: 4151
diff changeset
673 /* Then 0x00 02 00 00 00 00 00 */
4151
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
674 } break;
1a5dcfa1823e [gaim-migrate @ 4377]
Mark Doliner <mark@kingant.net>
parents: 4102
diff changeset
675 } /* End switch statement */
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
676
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
677 if (!(snac->flags & 0x0001)) {
4784
b1365291f002 [gaim-migrate @ 5104]
Mark Doliner <mark@kingant.net>
parents: 4759
diff changeset
678 if (subtype != 0x0104)
4759
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
679 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
680 ret = userfunc(sess, rx, info);
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
681
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
682 if (info->uin && info->nick)
1762496d502a [gaim-migrate @ 5076]
Mark Doliner <mark@kingant.net>
parents: 4664
diff changeset
683 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
684 ret = userfunc(sess, rx, info);
2742
6f527cbd899d [gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2733
diff changeset
685
4624
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
686 if (sess->icq_info == info) {
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
687 sess->icq_info = info->next;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
688 } else {
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
689 struct aim_icq_info *cur;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
690 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
691 if (cur->next)
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
692 cur->next = cur->next->next;
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
693 }
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
694 aim_icq_freeinfo(info);
a964972cb361 [gaim-migrate @ 4915]
Mark Doliner <mark@kingant.net>
parents: 4617
diff changeset
695 }
2706
e841b14b5b89 [gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2703
diff changeset
696 }
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
697
7167
6d3d8f11e765 [gaim-migrate @ 7734]
Mark Doliner <mark@kingant.net>
parents: 5345
diff changeset
698 aim_tlvlist_free(&tl);
2731
e9e624d8803e [gaim-migrate @ 2744]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 2706
diff changeset
699
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
700 return ret;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
701 }
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
702
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
703 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
704 {
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
705
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
706 if (snac->subtype == 0x0003)
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
707 return icqresponse(sess, mod, rx, snac, bs);
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
708
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
709 return 0;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
710 }
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
711
4830
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
712 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
713 {
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
714 struct aim_icq_info *del;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
715
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
716 while (sess->icq_info) {
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
717 del = sess->icq_info;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
718 sess->icq_info = sess->icq_info->next;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
719 aim_icq_freeinfo(del);
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
720 }
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
721
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
722 return;
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
723 }
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
724
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
725 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
726 {
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
727
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
728 mod->family = 0x0015;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
729 mod->version = 0x0001;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
730 mod->toolid = 0x0110;
4071
2532f1192da3 [gaim-migrate @ 4283]
Mark Doliner <mark@kingant.net>
parents: 3952
diff changeset
731 mod->toolversion = 0x047c;
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
732 mod->flags = 0;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
733 strncpy(mod->name, "icq", sizeof(mod->name));
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
734 mod->snachandler = snachandler;
4830
46fb754a3c10 [gaim-migrate @ 5155]
Mark Doliner <mark@kingant.net>
parents: 4784
diff changeset
735 mod->shutdown = icq_shutdown;
2703
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
736
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
737 return 0;
441b84ab7f4e [gaim-migrate @ 2716]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
738 }