Mercurial > pidgin.yaz
comparison src/conversation.c @ 4895:9e50494f63a1
[gaim-migrate @ 5227]
IM image support.
javabsp did most of the hard work, I just cleaned it up and fixed the bugs ;-)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 26 Mar 2003 06:19:44 +0000 |
parents | 249382064693 |
children | bfcf72c5a930 |
comparison
equal
deleted
inserted
replaced
4894:eea963dcd1ed | 4895:9e50494f63a1 |
---|---|
251 | 251 |
252 if (buffy != NULL) { | 252 if (buffy != NULL) { |
253 int imflags = 0; | 253 int imflags = 0; |
254 | 254 |
255 if (conv->u.im->images != NULL) { | 255 if (conv->u.im->images != NULL) { |
256 int id = 1, offset = 0; | 256 int id = 0, offset = 0; |
257 char *bigbuf = NULL; | 257 char *bigbuf = NULL; |
258 GSList *tmplist; | 258 GSList *tmplist; |
259 | 259 |
260 for (tmplist = conv->u.im->images; | 260 for (tmplist = conv->u.im->images; |
261 tmplist != NULL; | 261 tmplist != NULL; |
264 char *img_filename = (char *)tmplist->data; | 264 char *img_filename = (char *)tmplist->data; |
265 FILE *imgfile; | 265 FILE *imgfile; |
266 char *filename, *c; | 266 char *filename, *c; |
267 struct stat st; | 267 struct stat st; |
268 char imgtag[1024]; | 268 char imgtag[1024]; |
269 | |
270 id++; | |
269 | 271 |
270 if (stat(img_filename, &st) != 0) { | 272 if (stat(img_filename, &st) != 0) { |
271 debug_printf("Could not stat %s\n", | 273 debug_printf("Could not stat %s\n", |
272 (char *)img_filename); | 274 (char *)img_filename); |
273 continue; | 275 continue; |
326 | 328 |
327 strncpy(bigbuf + offset, "</DATA>", | 329 strncpy(bigbuf + offset, "</DATA>", |
328 strlen("</DATA>") + 1); | 330 strlen("</DATA>") + 1); |
329 | 331 |
330 offset += strlen("</DATA>"); | 332 offset += strlen("</DATA>"); |
331 id++; | |
332 } | 333 } |
333 | 334 |
334 if (binary) { | 335 if (binary) { |
335 strncpy(bigbuf + offset, "</BINARY>", | 336 strncpy(bigbuf + offset, "</BINARY>", |
336 strlen("<BINARY>") + 1); | 337 strlen("<BINARY>") + 1); |
352 tempy = tempy->next) { | 353 tempy = tempy->next) { |
353 | 354 |
354 g_free(tempy->data); | 355 g_free(tempy->data); |
355 } | 356 } |
356 | 357 |
357 g_slist_free(tempy); | 358 g_slist_free(conv->u.im->images); |
358 conv->u.im->images = NULL; | 359 conv->u.im->images = NULL; |
359 | 360 |
360 if (binary) | 361 if (binary) |
361 gaim_im_write(im, NULL, bigbuf, length, | 362 gaim_im_write(im, NULL, bigbuf, length, |
362 WFLAG_SEND, time(NULL)); | 363 WFLAG_SEND, time(NULL)); |