Mercurial > pidgin
annotate libfaim/aim_msgcookie.c @ 1081:efcacae6acdb
[gaim-migrate @ 1091]
libfaim connects non-blocking
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 10 Nov 2000 22:49:02 +0000 |
parents | 595ac7759563 |
children | ed8855ae6632 |
rev | line source |
---|---|
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
1 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
2 * Cookie Caching stuff. Adam wrote this, apparently just some |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
3 * derivatives of n's SNAC work. I cleaned it up, added comments. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
4 * |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
5 * I'm going to rewrite this stuff eventually, honest. -jbm |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
6 * |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
7 */ |
338 | 8 |
9 /* | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
10 * I'm assuming that cookies are type-specific. that is, we can have |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
11 * "1234578" for type 1 and type 2 concurrently. if i'm wrong, then we |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
12 * lose some error checking. if we assume cookies are not type-specific and are |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
13 * wrong, we get quirky behavior when cookies step on each others' toes. |
338 | 14 */ |
15 | |
16 #include <faim/aim.h> | |
17 | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
18 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
19 * aim_cachecookie: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
20 * appends a cookie to the cookie list for sess. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
21 * - if cookie->cookie for type cookie->type is found, addtime is updated. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
22 * - copies cookie struct; you need to free() it afterwards; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
23 * - cookie->data is not copied, but passed along. don't free it. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
24 * - newcook->addtime is updated accordingly; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
25 * - cookie->type is just passed across. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
26 * |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
27 * returns -1 on error, 0 on success. */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
28 |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
29 faim_internal int aim_cachecookie(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
30 struct aim_msgcookie_t *cookie) |
338 | 31 { |
32 struct aim_msgcookie_t *newcook = NULL, *cur = NULL; | |
33 | |
34 if (!cookie) | |
35 return -1; | |
36 | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
37 if( (newcook = aim_checkcookie(sess, cookie->cookie, cookie->type)) ) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
38 newcook->addtime = time(NULL); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
39 if(cookie->data != newcook->data) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
40 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
41 printf("faim: cachecookie: matching cookie/type pair " |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
42 "%x%x%x%x%x%x%x%x/%x has different *data. free()ing cookie copy..\n", |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
43 cookie->cookie[0], cookie->cookie[1], cookie->cookie[2], |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
44 cookie->cookie[3], cookie->cookie[4], cookie->cookie[5], |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
45 cookie->cookie[6], cookie->cookie[7], cookie->type); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
46 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
47 free(cookie->data); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
48 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
49 return(0); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
50 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
51 |
338 | 52 if (!(newcook = malloc(sizeof(struct aim_msgcookie_t)))) |
53 return -1; | |
54 memcpy(newcook, cookie, sizeof(struct aim_msgcookie_t)); | |
55 newcook->addtime = time(NULL); | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
56 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
57 if(newcook->next) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
58 printf("faim: cachecookie: newcook->next isn't NULL ???\n"); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
59 |
338 | 60 newcook->next = NULL; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
61 |
338 | 62 cur = sess->msgcookies; |
63 | |
64 if (cur == NULL) { | |
65 sess->msgcookies = newcook; | |
66 return 0; | |
67 } | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
68 |
338 | 69 while (cur->next != NULL) |
70 cur = cur->next; | |
71 cur->next = newcook; | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
72 |
338 | 73 return 0; |
74 } | |
75 | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
76 /* |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
77 * aim_uncachecookie: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
78 * takes a cookie string and grabs the cookie struct associated with |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
79 * it. removes struct from chain. returns the struct if found, or |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
80 * NULL on not found. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
81 */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
82 |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
83 faim_internal struct aim_msgcookie_t *aim_uncachecookie(struct aim_session_t *sess, unsigned char *cookie, int type) |
338 | 84 { |
85 struct aim_msgcookie_t *cur; | |
86 | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
87 if (!cookie || !sess->msgcookies) |
338 | 88 return NULL; |
89 | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
90 cur = sess->msgcookies; |
338 | 91 |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
92 if ( (memcmp(cur->cookie, cookie, 8) == 0) && (cur->type == type) ) { |
338 | 93 sess->msgcookies = cur->next; |
94 return cur; | |
95 } | |
96 | |
97 while (cur->next) { | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
98 if ( (memcmp(cur->next->cookie, cookie, 8) == 0) && (cur->next->type == type) ) { |
338 | 99 struct aim_msgcookie_t *tmp; |
100 | |
101 tmp = cur->next; | |
102 cur->next = cur->next->next; | |
103 return tmp; | |
104 } | |
105 cur = cur->next; | |
106 } | |
107 return NULL; | |
108 } | |
109 | |
110 /* | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
111 * aim_purgecookies: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
112 * purge out old cookies |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
113 * |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
114 * finds old cookies, calls uncache on them. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
115 * |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
116 * this is highly inefficient, but It Works. and i don't feel like |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
117 * totally rewriting this. it might have some concurrency issues as |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
118 * well, if i rewrite it. |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
119 * |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
120 * i'll avoid the puns. |
338 | 121 */ |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
122 |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
123 faim_export int aim_purgecookies(struct aim_session_t *sess, int maxage) |
338 | 124 { |
125 struct aim_msgcookie_t *cur; | |
126 struct aim_msgcookie_t *remed = NULL; | |
127 time_t curtime; | |
128 | |
129 cur = sess->msgcookies; | |
130 | |
131 curtime = time(&curtime); | |
132 | |
133 while (cur) { | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
134 if ( (cur->addtime) > (curtime - maxage) ) { |
338 | 135 #if DEBUG > 1 |
136 printf("aimmsgcookie: WARNING purged obsolete message cookie %x%x%x%x %x%x%x%x\n", | |
137 cur->cookie[0], cur->cookie[1], cur->cookie[2], cur->cookie[3], | |
138 cur->cookie[4], cur->cookie[5], cur->cookie[6], cur->cookie[7]); | |
139 #endif | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
140 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
141 remed = aim_uncachecookie(sess, cur->cookie, cur->type); |
338 | 142 if (remed) { |
143 if (remed->data) | |
144 free(remed->data); | |
145 free(remed); | |
146 } | |
147 } | |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
148 |
338 | 149 cur = cur->next; |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
150 |
338 | 151 } |
152 | |
153 return 0; | |
154 } | |
155 | |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
156 faim_internal struct aim_msgcookie_t *aim_mkcookie(unsigned char *c, int type, void *data) |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
157 { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
158 struct aim_msgcookie_t *cookie; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
159 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
160 if(!c) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
161 return(NULL); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
162 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
163 if( (cookie = calloc(1, sizeof(struct aim_msgcookie_t))) == NULL) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
164 return(NULL); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
165 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
166 cookie->data = data; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
167 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
168 cookie->type = type; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
169 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
170 memcpy(cookie->cookie, c, 8); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
171 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
172 return(cookie); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
173 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
174 |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
175 faim_internal struct aim_msgcookie_t *aim_checkcookie(struct aim_session_t *sess, unsigned char *cookie, int type) |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
176 { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
177 struct aim_msgcookie_t *cur; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
178 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
179 if(!sess->msgcookies) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
180 return NULL; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
181 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
182 cur = sess->msgcookies; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
183 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
184 if( (memcmp(cur->cookie, cookie, 8) == 0) && (cur->type == type)) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
185 return(cur); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
186 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
187 while( (cur = cur->next) ) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
188 if( (memcmp(cur->cookie, cookie, 8) == 0) && (cur->type == type)) |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
189 return(cur); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
190 |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
191 return(NULL); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
192 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
193 |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
194 static int aim_freecookie(struct aim_msgcookie_t *cookie) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
195 return(0); |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
196 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
197 |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
503
diff
changeset
|
198 faim_internal int aim_msgcookie_gettype(int reqclass) { |
503
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
199 /* XXX: hokey-assed. needs fixed. */ |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
200 switch(reqclass) { |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
201 case AIM_CAPS_BUDDYICON: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
202 return AIM_COOKIETYPE_OFTICON; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
203 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
204 case AIM_CAPS_VOICE: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
205 return AIM_COOKIETYPE_OFTVOICE; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
206 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
207 case AIM_CAPS_IMIMAGE: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
208 return AIM_COOKIETYPE_OFTIMAGE; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
209 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
210 case AIM_CAPS_CHAT: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
211 return AIM_COOKIETYPE_CHAT; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
212 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
213 case AIM_CAPS_GETFILE: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
214 return AIM_COOKIETYPE_OFTGET; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
215 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
216 case AIM_CAPS_SENDFILE: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
217 return AIM_COOKIETYPE_OFTSEND; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
218 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
219 default: |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
220 return AIM_COOKIETYPE_UNKNOWN; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
221 break; |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
222 } |
6e318907bcce
[gaim-migrate @ 513]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
223 } |