annotate src/protocols/oscar/icon.c @ 6350:34c07f5f34a0

[gaim-migrate @ 6849] -Compile warning fixes from The Man (Paco-Paco) -2 memleak fixes from me. One of them leaked the size of a chat message when either sending or receiving, I forgot which (my bad!) -Hopefully make AIM correctly refetch your buddy list when AOL doesn't send it to you the first time -Maybe something else -Chocolate -Vanilla -Strawberry -Napoleon committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 31 Jul 2003 23:21:36 +0000
parents db5aa27cb345
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
1 /*
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
2 * Family 0x0010 - Server stored buddy icons
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
3 *
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
4 * Used for storing and retrieving your cute little buddy icon
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
5 * from the AIM servers.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
6 *
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
7 */
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
8
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
9 #define FAIM_INTERNAL
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
10 #include <aim.h>
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
11
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
12 /**
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
13 * Subtype 0x0002 - Upload your icon.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
14 *
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
15 * @param sess The oscar session.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
16 * @param conn The icon connection for this session.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
17 * @param icon The raw data of the icon image file.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
18 * @param iconlen Length of the raw data of the icon image file.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
19 * @return Return 0 if no errors, otherwise return the error number.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
20 */
5844
db5aa27cb345 [gaim-migrate @ 6275]
Mark Doliner <mark@kingant.net>
parents: 5842
diff changeset
21 faim_export int aim_icon_upload(aim_session_t *sess, const fu8_t *icon, fu16_t iconlen)
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
22 {
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
23 aim_conn_t *conn;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
24 aim_frame_t *fr;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
25 aim_snacid_t snacid;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
26
5842
dbed8c87f750 [gaim-migrate @ 6273]
Sean Egan <seanegan@gmail.com>
parents: 4889
diff changeset
27 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0010)) || !icon || !iconlen)
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
28 return -EINVAL;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
29
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
30 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 2 + 2+iconlen)))
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
31 return -ENOMEM;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
32 snacid = aim_cachesnac(sess, 0x0010, 0x0002, 0x0000, NULL, 0);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
33 aim_putsnac(&fr->data, 0x0010, 0x0002, 0x0000, snacid);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
34
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
35 /* The reference number for the icon */
5842
dbed8c87f750 [gaim-migrate @ 6273]
Sean Egan <seanegan@gmail.com>
parents: 4889
diff changeset
36 aimbs_put16(&fr->data, 1);
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
37
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
38 /* The icon */
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
39 aimbs_put16(&fr->data, iconlen);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
40 aimbs_putraw(&fr->data, icon, iconlen);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
41
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
42 aim_tx_enqueue(sess, fr);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
43
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
44 return 0;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
45 }
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
46
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
47 /**
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
48 * Subtype 0x0003 - Acknowledgement for uploading a buddy icon.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
49 *
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
50 * You get this honky after you upload a buddy icon.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
51 */
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
52 static int uploadack(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
53 {
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
54 int ret = 0;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
55 aim_rxcallback_t userfunc;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
56 fu16_t something, somethingelse;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
57 fu8_t onemorething;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
58
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
59 something = aimbs_get16(bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
60 somethingelse = aimbs_get16(bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
61 onemorething = aimbs_get8(bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
62
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
63 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
64 ret = userfunc(sess, rx);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
65
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
66 return ret;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
67 }
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
68
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
69 /**
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
70 * Subtype 0x0004 - Request someone's icon.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
71 *
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
72 * @param sess The oscar session.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
73 * @param conn The icon connection for this session.
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
74 * @param sn The screen name of the person who's icon you are requesting.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
75 * @param iconcsum The MD5 checksum of the icon you are requesting.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
76 * @param iconcsumlen Length of the MD5 checksum given above. Should be 10 bytes.
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
77 * @return Return 0 if no errors, otherwise return the error number.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
78 */
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
79 faim_export int aim_icon_request(aim_session_t *sess, const char *sn, const fu8_t *iconcsum, fu16_t iconcsumlen)
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
80 {
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
81 aim_conn_t *conn;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
82 aim_frame_t *fr;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
83 aim_snacid_t snacid;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
84
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
85 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0010)) || !sn || !strlen(sn) || !iconcsum || !iconcsumlen)
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
86 return -EINVAL;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
87
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
88 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 1+strlen(sn) + 4 + 1+iconcsumlen)))
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
89 return -ENOMEM;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
90 snacid = aim_cachesnac(sess, 0x0010, 0x0004, 0x0000, NULL, 0);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
91 aim_putsnac(&fr->data, 0x0010, 0x0004, 0x0000, snacid);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
92
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
93 /* Screen name */
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
94 aimbs_put8(&fr->data, strlen(sn));
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
95 aimbs_putraw(&fr->data, sn, strlen(sn));
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
96
4826
e6654fab588b [gaim-migrate @ 5151]
Mark Doliner <mark@kingant.net>
parents: 4805
diff changeset
97 /* Some numbers. You like numbers, right? */
e6654fab588b [gaim-migrate @ 5151]
Mark Doliner <mark@kingant.net>
parents: 4805
diff changeset
98 aimbs_put8(&fr->data, 0x01);
e6654fab588b [gaim-migrate @ 5151]
Mark Doliner <mark@kingant.net>
parents: 4805
diff changeset
99 aimbs_put16(&fr->data, 0x0001);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
100 aimbs_put8(&fr->data, 0x01);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
101
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
102 /* Icon string */
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
103 aimbs_put8(&fr->data, iconcsumlen);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
104 aimbs_putraw(&fr->data, iconcsum, iconcsumlen);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
105
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
106 aim_tx_enqueue(sess, fr);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
107
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
108 return 0;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
109 }
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
110
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
111 /**
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
112 * Subtype 0x0005 - Receive a buddy icon.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
113 *
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
114 * This is sent in response to a buddy icon request.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
115 */
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
116 static int parseicon(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
117 {
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
118 int ret = 0;
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
119 aim_rxcallback_t userfunc;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
120 char *sn;
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
121 fu16_t flags, iconlen;
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
122 fu8_t number, iconcsumlen, *iconcsum, *icon;
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
123
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
124 sn = aimbs_getstr(bs, aimbs_get8(bs));
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
125 flags = aimbs_get16(bs);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
126 number = aimbs_get8(bs);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
127 iconcsumlen = aimbs_get8(bs);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
128 iconcsum = aimbs_getraw(bs, iconcsumlen);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
129 iconlen = aimbs_get16(bs);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
130 icon = aimbs_getraw(bs, iconlen);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
131
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
132 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
4872
e6dbac19a8d5 [gaim-migrate @ 5202]
Nathan Walp <nwalp@pidgin.im>
parents: 4870
diff changeset
133 ret = userfunc(sess, rx, sn, iconcsum, iconcsumlen, icon, iconlen);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
134
4870
773135edda4a [gaim-migrate @ 5200]
Mark Doliner <mark@kingant.net>
parents: 4853
diff changeset
135 free(sn);
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
136 free(iconcsum);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
137 free(icon);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
138
4872
e6dbac19a8d5 [gaim-migrate @ 5202]
Nathan Walp <nwalp@pidgin.im>
parents: 4870
diff changeset
139 return ret;
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
140 }
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
141
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
142 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
143 {
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
144
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
145 if (snac->subtype == 0x0003)
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
146 return uploadack(sess, mod, rx, snac, bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
147 else if (snac->subtype == 0x0005)
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
148 return parseicon(sess, mod, rx, snac, bs);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
149
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
150 return 0;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
151 }
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
152
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
153 faim_internal int icon_modfirst(aim_session_t *sess, aim_module_t *mod)
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
154 {
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
155
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
156 mod->family = 0x0010;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
157 mod->version = 0x0001;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
158 mod->toolid = 0x0010;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
159 mod->toolversion = 0x0629;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
160 mod->flags = 0;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
161 strncpy(mod->name, "icon", sizeof(mod->name));
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
162 mod->snachandler = snachandler;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
163
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
164 return 0;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
165 }