annotate src/protocols/oscar/icon.c @ 5132:494b6b6a6ffa

[gaim-migrate @ 5495] I changed some zephyr stuff. I think it's funny. I made the get info box not show "Alias: (null)" for people without aliases, which I guess will fix a crash bug with zephyr on solaris, maybe. And I also gettexticised some strings. I thought I'd mention this in the change log because it's funny (that zephyr still exists). And to anyone who's wondering, NC State does have a zephyr realm set up, but not many people use it. I also mentioned the ICQ authorization thing. I figure some peeps might care. I bet the Care Bears care. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 14 Apr 2003 19:42:29 +0000
parents f7150929332b
children dbed8c87f750
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 num The reference number of the icon you are uploading.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
18 * @param icon The raw data of the icon image file.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
19 * @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
20 * @return Return 0 if no errors, otherwise return the error number.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
21 */
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
22 faim_export int aim_icon_upload(aim_session_t *sess, int num, const fu8_t *icon, fu16_t iconlen)
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
23 {
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
24 aim_conn_t *conn;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
25 aim_frame_t *fr;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
26 aim_snacid_t snacid;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
27
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
28 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0010)) || !num || !icon || !iconlen)
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
29 return -EINVAL;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
30
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
31 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
32 return -ENOMEM;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
33 snacid = aim_cachesnac(sess, 0x0010, 0x0002, 0x0000, NULL, 0);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
34 aim_putsnac(&fr->data, 0x0010, 0x0002, 0x0000, snacid);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
35
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
36 /* The reference number for the icon */
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
37 aimbs_put16(&fr->data, num);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
38
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
39 /* The icon */
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
40 aimbs_put16(&fr->data, iconlen);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
41 aimbs_putraw(&fr->data, icon, iconlen);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
42
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
43 aim_tx_enqueue(sess, fr);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
44
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
45 return 0;
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 /**
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
49 * Subtype 0x0003 - Acknowledgement for uploading a buddy icon.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
50 *
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
51 * You get this honky after you upload a buddy icon.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
52 */
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
53 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
54 {
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
55 int ret = 0;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
56 aim_rxcallback_t userfunc;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
57 fu16_t something, somethingelse;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
58 fu8_t onemorething;
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
59
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
60 something = aimbs_get16(bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
61 somethingelse = aimbs_get16(bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
62 onemorething = aimbs_get8(bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
63
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
64 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
65 ret = userfunc(sess, rx);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
66
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
67 return ret;
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
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
70 /**
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
71 * Subtype 0x0004 - Request someone's icon.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
72 *
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
73 * @param sess The oscar session.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
74 * @param conn The icon connection for this session.
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
75 * @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
76 * @param iconcsum The MD5 checksum of the icon you are requesting.
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
77 * @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
78 * @return Return 0 if no errors, otherwise return the error number.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
79 */
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
80 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
81 {
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
82 aim_conn_t *conn;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
83 aim_frame_t *fr;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
84 aim_snacid_t snacid;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
85
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
86 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
87 return -EINVAL;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
88
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
89 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
90 return -ENOMEM;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
91 snacid = aim_cachesnac(sess, 0x0010, 0x0004, 0x0000, NULL, 0);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
92 aim_putsnac(&fr->data, 0x0010, 0x0004, 0x0000, snacid);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
93
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
94 /* Screen name */
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
95 aimbs_put8(&fr->data, strlen(sn));
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
96 aimbs_putraw(&fr->data, sn, strlen(sn));
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
97
4826
e6654fab588b [gaim-migrate @ 5151]
Mark Doliner <mark@kingant.net>
parents: 4805
diff changeset
98 /* Some numbers. You like numbers, right? */
e6654fab588b [gaim-migrate @ 5151]
Mark Doliner <mark@kingant.net>
parents: 4805
diff changeset
99 aimbs_put8(&fr->data, 0x01);
e6654fab588b [gaim-migrate @ 5151]
Mark Doliner <mark@kingant.net>
parents: 4805
diff changeset
100 aimbs_put16(&fr->data, 0x0001);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
101 aimbs_put8(&fr->data, 0x01);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
102
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
103 /* Icon string */
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
104 aimbs_put8(&fr->data, iconcsumlen);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
105 aimbs_putraw(&fr->data, iconcsum, iconcsumlen);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
106
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
107 aim_tx_enqueue(sess, fr);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
108
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
109 return 0;
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 /**
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
113 * Subtype 0x0005 - Receive a buddy icon.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
114 *
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
115 * This is sent in response to a buddy icon request.
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
116 */
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
117 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
118 {
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
119 int ret = 0;
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
120 aim_rxcallback_t userfunc;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
121 char *sn;
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
122 fu16_t flags, iconlen;
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
123 fu8_t number, iconcsumlen, *iconcsum, *icon;
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
124
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
125 sn = aimbs_getstr(bs, aimbs_get8(bs));
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
126 flags = aimbs_get16(bs);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
127 number = aimbs_get8(bs);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
128 iconcsumlen = aimbs_get8(bs);
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
129 iconcsum = aimbs_getraw(bs, iconcsumlen);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
130 iconlen = aimbs_get16(bs);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
131 icon = aimbs_getraw(bs, iconlen);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
132
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
133 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
134 ret = userfunc(sess, rx, sn, iconcsum, iconcsumlen, icon, iconlen);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
135
4870
773135edda4a [gaim-migrate @ 5200]
Mark Doliner <mark@kingant.net>
parents: 4853
diff changeset
136 free(sn);
4853
fbfdacf7c611 [gaim-migrate @ 5180]
Mark Doliner <mark@kingant.net>
parents: 4826
diff changeset
137 free(iconcsum);
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
138 free(icon);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
139
4872
e6dbac19a8d5 [gaim-migrate @ 5202]
Nathan Walp <nwalp@pidgin.im>
parents: 4870
diff changeset
140 return ret;
4805
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
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
143 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
144 {
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
145
4889
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
146 if (snac->subtype == 0x0003)
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
147 return uploadack(sess, mod, rx, snac, bs);
f7150929332b [gaim-migrate @ 5219]
Mark Doliner <mark@kingant.net>
parents: 4872
diff changeset
148 else if (snac->subtype == 0x0005)
4805
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
149 return parseicon(sess, mod, rx, snac, bs);
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
150
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
151 return 0;
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
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
154 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
155 {
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
156
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
157 mod->family = 0x0010;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
158 mod->version = 0x0001;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
159 mod->toolid = 0x0010;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
160 mod->toolversion = 0x0629;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
161 mod->flags = 0;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
162 strncpy(mod->name, "icon", sizeof(mod->name));
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
163 mod->snachandler = snachandler;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
164
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
165 return 0;
a7e99eb2c0f2 [gaim-migrate @ 5125]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
166 }