comparison src/conversation.c @ 5213:1cf4eb75e3ee

[gaim-migrate @ 5583] More debug_printf -> gaim_debug. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 26 Apr 2003 07:15:59 +0000
parents fefad67de2c7
children 799f9585988a
comparison
equal deleted inserted replaced
5212:740303e8425b 5213:1cf4eb75e3ee
161 gaim_im_set_type_again(GAIM_IM(conv), TRUE); 161 gaim_im_set_type_again(GAIM_IM(conv), TRUE);
162 162
163 /* XXX Somebody add const stuff! */ 163 /* XXX Somebody add const stuff! */
164 serv_send_typing(gc, (char *)name, TYPED); 164 serv_send_typing(gc, (char *)name, TYPED);
165 165
166 debug_printf("typed...\n"); 166 gaim_debug(GAIM_DEBUG_MISC, "conversation", "typed...\n");
167 } 167 }
168 168
169 return FALSE; 169 return FALSE;
170 } 170 }
171 171
267 char imgtag[1024]; 267 char imgtag[1024];
268 268
269 id++; 269 id++;
270 270
271 if (stat(img_filename, &st) != 0) { 271 if (stat(img_filename, &st) != 0) {
272 debug_printf("Could not stat %s\n", 272 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
273 (char *)img_filename); 273 "Could not stat image %s\n",
274 img_filename);
275
274 continue; 276 continue;
275 } 277 }
276 278
277 /* 279 /*
278 * Here we check to make sure the user still wants to send 280 * Here we check to make sure the user still wants to send
288 "<IMG SRC=\"file://%s\" ID=\"%d\" " 290 "<IMG SRC=\"file://%s\" ID=\"%d\" "
289 "DATASIZE=\"%d\">", 291 "DATASIZE=\"%d\">",
290 filename, id, (int)st.st_size); 292 filename, id, (int)st.st_size);
291 293
292 if (strstr(buffy, imgtag) == 0) { 294 if (strstr(buffy, imgtag) == 0) {
293 debug_printf("Not sending image: %s\n", img_filename); 295 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
296 "Not sending image: %s\n", img_filename);
294 continue; 297 continue;
295 } 298 }
296 299
297 if (!binary) { 300 if (!binary) {
298 length = strlen(buffy) + strlen("<BINARY></BINARY>"); 301 length = strlen(buffy) + strlen("<BINARY></BINARY>");
312 length += strlen(imgtag) + st.st_size + strlen("</DATA>"); 315 length += strlen(imgtag) + st.st_size + strlen("</DATA>");
313 316
314 bigbuf = g_realloc(bigbuf, length + 1); 317 bigbuf = g_realloc(bigbuf, length + 1);
315 318
316 if ((imgfile = fopen(img_filename, "r")) == NULL) { 319 if ((imgfile = fopen(img_filename, "r")) == NULL) {
317 debug_printf("Could not open %s\n", img_filename); 320 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
321 "Could not open image %s\n", img_filename);
318 continue; 322 continue;
319 } 323 }
320 324
321 strncpy(bigbuf + offset, imgtag, strlen(imgtag) + 1); 325 strncpy(bigbuf + offset, imgtag, strlen(imgtag) + 1);
322 326
392 396
393 g_free(buf2); 397 g_free(buf2);
394 g_free(buf); 398 g_free(buf);
395 399
396 if (err < 0) { 400 if (err < 0) {
397 if (err == -E2BIG) 401 if (err == -E2BIG) {
398 do_error_dialog(_("Unable to send message. " 402 do_error_dialog(_("Unable to send message. "
399 "The message is too large."), NULL, 403 "The message is too large."), NULL,
400 GAIM_ERROR); 404 GAIM_ERROR);
401 else if (err == -ENOTCONN) 405 }
402 debug_printf("Not yet connected.\n"); 406 else if (err == -ENOTCONN) {
403 else 407 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
408 "Not yet connected.\n");
409 }
410 else {
404 do_error_dialog(_("Unable to send message."), NULL, GAIM_ERROR); 411 do_error_dialog(_("Unable to send message."), NULL, GAIM_ERROR);
412 }
405 } 413 }
406 else { 414 else {
407 if (err > 0 && (away_options & OPT_AWAY_BACK_ON_IM)) { 415 if (err > 0 && (away_options & OPT_AWAY_BACK_ON_IM)) {
408 if (awaymessage != NULL) { 416 if (awaymessage != NULL) {
409 do_im_back(); 417 do_im_back();
691 /* Get the list item for this conversation at its current index. */ 699 /* Get the list item for this conversation at its current index. */
692 l = g_list_nth(gaim_window_get_conversations(win), index); 700 l = g_list_nth(gaim_window_get_conversations(win), index);
693 701
694 if (l == NULL) { 702 if (l == NULL) {
695 /* Should never happen. */ 703 /* Should never happen. */
696 debug_printf("Misordered conversations list in window %p\n", win); 704 gaim_debug(GAIM_DEBUG_ERROR, "conversation",
705 "Misordered conversations list in window %p\n", win);
697 706
698 return; 707 return;
699 } 708 }
700 709
701 conv = (struct gaim_conversation *)l->data; 710 conv = (struct gaim_conversation *)l->data;