Mercurial > pidgin.yaz
annotate src/protocols/oscar/icq.c @ 4617:858979ab3867
[gaim-migrate @ 4908]
Big Changes:
-Rewrote some of the perl stuff so perl scripts can change a few of their
parameters
-Receiving a file with AIM over oscar works pretty well
Now, the "nitty gritty":
Very minor change to prefs.c: In the plugins details tab, I changed "URL"
to "Web Site." I was just going to fix the tabbing, but silvestrij
suggested changing it to "Web site," and I thought that sounded good.
I think it fits better, too. I dunno, maybe that's just me.
"Get Capabilities" has stopped working for some reason. I'm just going to
blame AOL. It's really not important anyway, and some people wanted it
taken off. It is now #ifdef 0'ed out. I'll remove it completely if it
continues to no longer function.
I took out a few plugin_event calls from oscar.c and put them in core code.
"event_error" should be, uh, "evented" when there is an error signing on.
Hopefully no one was using this. It's really pretty useless. The parameter
is now the reason for not being able to connect rather than the archaic
toc error code.
I screwed around with how perl functions are called some. There was way the
hell too much malloc'ing going on here. I think all in all it's an
improvement, though I'm still not a big fan of how changes to parameters
propagate to the actual memory.
I really think it would be nice if the perl stuff was made into a C plugin.
It's just so much cleaner. Especially if someone wanted to write, say, a
python or tcl interpreter. That's how xchat2 does it. I just think that
would be really slick. Like butter. Or ice. Very unlike Velcro.
I added a "Change Password" Protocol Action for ICQ over oscar. This was
really pretty easy. I'd like to thank my housemate Andrew for complaining
a lot that having to use Windows ICQ to change his password was a pain.
I rewrote a lot of the oscar file transfer stuff to use Christian's new
xfer interface. This involved moving a few functions from ft.c to im.c,
where they belong. I also removed all the #if 0'ed getfile functions.
I'll be rewritting them soonish. Receiving a file should work perfectly,
aside from maybe a small memleak when stuff is canceled. Sending a file is
currently disabled. No ETA on when I'll have that working.
I renamed pretty much all of the functions in im.c so they have kind of a
scheme now. They should all be aim_im_bleh, since "im" is the family
name. There comes a time when you must break the crap out of any clients
that might be using libfaim in order to make stuff cleaner. Maybe.
I got rid of the snac destructor stuff for now. I'll probably add it back
later. I wasn't entirely comfortable with how it was done.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 26 Feb 2003 05:01:37 +0000 |
parents | b66f960bfe60 |
children | a964972cb361 |
rev | line source |
---|---|
2703 | 1 /* |
3952 | 2 * Family 0x0015 - Encapsulated ICQ. |
2703 | 3 * |
4 */ | |
5 | |
6 #define FAIM_INTERNAL | |
7 #include <aim.h> | |
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 |
4617 | 73 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
|
74 { |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
75 aim_conn_t *conn; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
76 aim_frame_t *fr; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
77 aim_snacid_t snacid; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
78 int bslen; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
79 |
4617 | 80 if (!passwd) |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
81 return -EINVAL; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
82 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
83 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
84 return -EINVAL; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
85 |
4617 | 86 bslen = 2+4+2+2+2+2+strlen(passwd)+1; |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
87 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
88 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
|
89 return -ENOMEM; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
90 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
91 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
92 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
93 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
94 /* For simplicity, don't bother using a tlvlist */ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
95 aimbs_put16(&fr->data, 0x0001); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
96 aimbs_put16(&fr->data, bslen); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
97 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
98 aimbs_putle16(&fr->data, bslen - 2); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
99 aimbs_putle32(&fr->data, atoi(sess->sn)); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
100 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */ |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
101 aimbs_putle16(&fr->data, snacid); /* eh. */ |
4617 | 102 aimbs_putle16(&fr->data, 0x042e); /* shrug. */ |
103 aimbs_putle16(&fr->data, strlen(passwd)+1); | |
104 aimbs_putraw(&fr->data, passwd, strlen(passwd)); | |
105 aimbs_putle8(&fr->data, '\0'); | |
106 | |
107 aim_tx_enqueue(sess, fr); | |
108 | |
109 return 0; | |
110 } | |
111 | |
112 faim_export int aim_icq_getallinfo(aim_session_t *sess, const char *uin) | |
113 { | |
114 aim_conn_t *conn; | |
115 aim_frame_t *fr; | |
116 aim_snacid_t snacid; | |
117 int bslen; | |
118 | |
119 if (!uin || uin[0] < '0' || uin[0] > '9') | |
120 return -EINVAL; | |
121 | |
122 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) | |
123 return -EINVAL; | |
124 | |
125 bslen = 2 + 4 + 2 + 2 + 2 + 4; | |
126 | |
127 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) | |
128 return -ENOMEM; | |
129 | |
130 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); | |
131 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); | |
132 | |
133 /* For simplicity, don't bother using a tlvlist */ | |
134 aimbs_put16(&fr->data, 0x0001); | |
135 aimbs_put16(&fr->data, bslen); | |
136 | |
137 aimbs_putle16(&fr->data, bslen - 2); | |
138 aimbs_putle32(&fr->data, atoi(sess->sn)); | |
139 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */ | |
140 aimbs_putle16(&fr->data, snacid); /* eh. */ | |
141 aimbs_putle16(&fr->data, 0x04b2); /* shrug. */ | |
142 aimbs_putle32(&fr->data, atoi(uin)); | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
143 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
144 aim_tx_enqueue(sess, fr); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
145 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
146 return 0; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
147 } |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
148 |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
149 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
|
150 { |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
151 aim_conn_t *conn; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
152 aim_frame_t *fr; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
153 aim_snacid_t snacid; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
154 int bslen; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
155 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
156 if (!uin || uin[0] < '0' || uin[0] > '9') |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
157 return -EINVAL; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
158 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
159 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
160 return -EINVAL; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
161 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
162 bslen = 2 + 4 + 2 + 2 + 2 + 4; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
163 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
164 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
|
165 return -ENOMEM; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
166 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
167 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
168 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
169 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
170 /* For simplicity, don't bother using a tlvlist */ |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
171 aimbs_put16(&fr->data, 0x0001); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
172 aimbs_put16(&fr->data, bslen); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
173 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
174 aimbs_putle16(&fr->data, bslen - 2); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
175 aimbs_putle32(&fr->data, atoi(sess->sn)); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
176 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */ |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
177 aimbs_putle16(&fr->data, snacid); /* eh. */ |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
178 aimbs_putle16(&fr->data, 0x051f); /* shrug. */ |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
179 aimbs_putle32(&fr->data, atoi(uin)); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
180 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
181 aim_tx_enqueue(sess, fr); |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
182 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
183 return 0; |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
184 } |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
185 |
4617 | 186 faim_export int aim_icq_sendxmlreq(aim_session_t *sess, const char *xml) |
4151 | 187 { |
188 aim_conn_t *conn; | |
189 aim_frame_t *fr; | |
190 aim_snacid_t snacid; | |
191 int bslen; | |
192 | |
4617 | 193 if (!xml || !strlen(xml)) |
4151 | 194 return -EINVAL; |
195 | |
196 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0015))) | |
197 return -EINVAL; | |
198 | |
4617 | 199 bslen = 2 + 10 + 2 + strlen(xml) + 1; |
4151 | 200 |
201 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + bslen))) | |
202 return -ENOMEM; | |
203 | |
204 snacid = aim_cachesnac(sess, 0x0015, 0x0002, 0x0000, NULL, 0); | |
205 aim_putsnac(&fr->data, 0x0015, 0x0002, 0x0000, snacid); | |
206 | |
207 /* For simplicity, don't bother using a tlvlist */ | |
208 aimbs_put16(&fr->data, 0x0001); | |
209 aimbs_put16(&fr->data, bslen); | |
210 | |
211 aimbs_putle16(&fr->data, bslen - 2); | |
212 aimbs_putle32(&fr->data, atoi(sess->sn)); | |
213 aimbs_putle16(&fr->data, 0x07d0); /* I command thee. */ | |
214 aimbs_putle16(&fr->data, snacid); /* eh. */ | |
4617 | 215 aimbs_putle16(&fr->data, 0x0998); /* shrug. */ |
216 aimbs_putle16(&fr->data, strlen(xml) + 1); | |
217 aimbs_putraw(&fr->data, xml, strlen(xml) + 1); | |
4151 | 218 |
219 aim_tx_enqueue(sess, fr); | |
220 | |
221 return 0; | |
222 } | |
223 | |
4617 | 224 /** |
225 * Subtype 0x0003 - Response to 0x0015/0x002, contains an ICQesque packet. | |
2703 | 226 */ |
227 static int icqresponse(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) | |
228 { | |
229 int ret = 0; | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
230 aim_tlvlist_t *tl; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
231 aim_tlv_t *datatlv; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
232 aim_bstream_t qbs; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
233 fu32_t ouruin; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
234 fu16_t cmdlen, cmd, reqid; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
235 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
236 if (!(tl = aim_readtlvchain(bs)) || !(datatlv = aim_gettlv(tl, 0x0001, 1))) { |
2733
eeac6ea7ade6
[gaim-migrate @ 2746]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2732
diff
changeset
|
237 aim_freetlvchain(&tl); |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
238 faimdprintf(sess, 0, "corrupt ICQ response\n"); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
239 return 0; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
240 } |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
241 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
242 aim_bstream_init(&qbs, datatlv->value, datatlv->length); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
243 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
244 cmdlen = aimbs_getle16(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
245 ouruin = aimbs_getle32(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
246 cmd = aimbs_getle16(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
247 reqid = aimbs_getle16(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
248 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
249 faimdprintf(sess, 1, "icq response: %d bytes, %ld, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid); |
2703 | 250 |
4075 | 251 if (cmd == 0x0041) { /* offline message */ |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
252 struct aim_icq_offlinemsg msg; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
253 aim_rxcallback_t userfunc; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
254 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
255 memset(&msg, 0, sizeof(msg)); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
256 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
257 msg.sender = aimbs_getle32(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
258 msg.year = aimbs_getle16(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
259 msg.month = aimbs_getle8(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
260 msg.day = aimbs_getle8(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
261 msg.hour = aimbs_getle8(&qbs); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
262 msg.minute = aimbs_getle8(&qbs); |
4173 | 263 msg.type = aimbs_getle8(&qbs); |
264 msg.flags = aimbs_getle8(&qbs); | |
4076 | 265 msg.msglen = aimbs_getle16(&qbs); |
266 msg.msg = aimbs_getstr(&qbs, msg.msglen); | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
267 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
268 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
|
269 ret = userfunc(sess, rx, &msg); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
270 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
271 free(msg.msg); |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
272 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
273 } else if (cmd == 0x0042) { |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
274 aim_rxcallback_t userfunc; |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
275 |
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
276 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
|
277 ret = userfunc(sess, rx); |
4151 | 278 |
279 } else if (cmd == 0x07da) { /* information */ | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
280 fu16_t subtype; |
4151 | 281 struct aim_icq_info *info; |
282 aim_rxcallback_t userfunc; | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
283 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
284 subtype = aimbs_getle16(&qbs); |
4151 | 285 info = (struct aim_icq_info *)malloc(sizeof(struct aim_icq_info)); |
286 memset(info, 0, sizeof(struct aim_icq_info)); | |
287 aim_bstream_advance(&qbs, 1); /* 0x0a */ | |
288 | |
289 switch (subtype) { | |
4617 | 290 case 0x00aa: { /* password change status */ |
291 aimbs_getle8(&qbs); /* 0x000a for success */ | |
292 } break; | |
293 | |
4151 | 294 case 0x00c8: { /* info summary (useful stuff) */ |
295 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
296 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
297 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
298 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); | |
299 info->homecity = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
300 info->homestate = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
301 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); | |
302 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); | |
303 info->homeaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
304 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); | |
305 info->homezip = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
306 info->homecountry = aimbs_getle16(&qbs); | |
307 } break; | |
308 | |
309 case 0x00dc: { /* personal web page */ | |
310 aim_bstream_advance(&qbs, 3); | |
311 info->personalwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
312 } break; | |
313 | |
314 case 0x00eb: { /* email address(es) */ | |
315 aim_bstream_advance(&qbs, 2); /* Number of email addresses? */ | |
316 info->email = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
317 } break; | |
318 | |
319 case 0x00d2: { /* work information */ | |
320 info->workcity = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
321 info->workstate = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
322 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); | |
323 aim_bstream_advance(&qbs, aimbs_getle16(&qbs)); | |
324 info->workaddr = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
325 info->workzip = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
326 info->workcountry = aimbs_getle16(&qbs); | |
327 info->workcompany = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
328 info->workdivision = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
329 info->workposition = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
330 aim_bstream_advance(&qbs, 2); /* Number of webpage addresses? */ | |
331 info->workwebpage = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
332 } break; | |
333 | |
334 case 0x00e6: { /* additional personal information */ | |
335 info->info = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
336 } break; | |
337 | |
338 case 0x00f0: { /* personal interests */ | |
339 } break; | |
340 | |
341 case 0x00fa: { /* past background and current organizations */ | |
342 } break; | |
343 | |
344 case 0x010e: { /* unknown */ | |
345 } break; | |
346 | |
347 case 0x019a: { /* simple info */ | |
348 aim_bstream_advance(&qbs, 2); | |
349 info->uin = aimbs_getle32(&qbs); | |
350 info->nick = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
351 info->first = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
352 info->last = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
353 info->email = aimbs_getstr(&qbs, aimbs_getle16(&qbs)); | |
4154 | 354 /* Then 0x00 02 00 00 00 00 00 */ |
4151 | 355 } break; |
356 } /* End switch statement */ | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
357 |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
358 if (subtype == 0x019a) { |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
359 if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_SIMPLEINFO))) |
4151 | 360 ret = userfunc(sess, rx, info); |
361 } else { | |
362 if ((userfunc = aim_callhandler(sess, rx->conn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_ALLINFO))) | |
363 ret = userfunc(sess, rx, info); | |
2742
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
364 } |
6f527cbd899d
[gaim-migrate @ 2755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2733
diff
changeset
|
365 |
4151 | 366 free(info->nick); |
367 free(info->first); | |
368 free(info->last); | |
369 free(info->email); | |
370 free(info->personalwebpage); | |
371 free(info->info); | |
372 free(info->homecity); | |
373 free(info->homestate); | |
374 free(info->homeaddr); | |
375 free(info->homezip); | |
376 free(info->workcity); | |
377 free(info->workstate); | |
378 free(info->workaddr); | |
379 free(info->workzip); | |
380 free(info->workcompany); | |
381 free(info->workdivision); | |
382 free(info->workposition); | |
383 free(info->workwebpage); | |
384 free(info); | |
2706
e841b14b5b89
[gaim-migrate @ 2719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2703
diff
changeset
|
385 } |
2703 | 386 |
2732
efa3e7115cb5
[gaim-migrate @ 2745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2731
diff
changeset
|
387 aim_freetlvchain(&tl); |
2731
e9e624d8803e
[gaim-migrate @ 2744]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2706
diff
changeset
|
388 |
2703 | 389 return ret; |
390 } | |
391 | |
392 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) | |
393 { | |
394 | |
395 if (snac->subtype == 0x0003) | |
396 return icqresponse(sess, mod, rx, snac, bs); | |
397 | |
398 return 0; | |
399 } | |
400 | |
401 faim_internal int icq_modfirst(aim_session_t *sess, aim_module_t *mod) | |
402 { | |
403 | |
404 mod->family = 0x0015; | |
405 mod->version = 0x0001; | |
406 mod->toolid = 0x0110; | |
4071 | 407 mod->toolversion = 0x047c; |
2703 | 408 mod->flags = 0; |
409 strncpy(mod->name, "icq", sizeof(mod->name)); | |
410 mod->snachandler = snachandler; | |
411 | |
412 return 0; | |
413 } |