Mercurial > pidgin
comparison src/server.c @ 1981:7739e648a28a
[gaim-migrate @ 1991]
hi luigiwalser
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 10 Jun 2001 00:45:43 +0000 |
parents | 24aed1c31342 |
children | 815997c7d4f1 |
comparison
equal
deleted
inserted
replaced
1980:5b79252ea95c | 1981:7739e648a28a |
---|---|
386 } | 386 } |
387 | 387 |
388 /* woo. i'm actually going to comment this function. isn't that fun. make sure to follow along, kids */ | 388 /* woo. i'm actually going to comment this function. isn't that fun. make sure to follow along, kids */ |
389 void serv_got_im(struct gaim_connection *gc, char *name, char *message, int away, time_t mtime) | 389 void serv_got_im(struct gaim_connection *gc, char *name, char *message, int away, time_t mtime) |
390 { | 390 { |
391 char *buffy; | |
392 char *angel; | |
393 int plugin_return; | |
394 | |
391 struct conversation *cnv; | 395 struct conversation *cnv; |
392 int new_conv = 0; | 396 int new_conv = 0; |
397 | |
398 /* we should update the conversation window buttons and menu, if it exists. */ | |
399 cnv = find_conversation(name); | |
400 if (cnv) | |
401 set_convo_gc(cnv, gc); | |
402 /* we do the new_conv check here in case any plugins decide to create it */ | |
403 else | |
404 new_conv = 1; | |
393 | 405 |
394 /* plugin stuff. we pass a char ** but we don't want to pass what's been given us | 406 /* plugin stuff. we pass a char ** but we don't want to pass what's been given us |
395 * by the prpls. so we create temp holders and pass those instead. it's basically | 407 * by the prpls. so we create temp holders and pass those instead. it's basically |
396 * just to avoid segfaults. */ | 408 * just to avoid segfaults. */ |
397 char *buffy = g_strdup(message); | 409 buffy = g_strdup(message); |
398 char *angel = g_strdup(name); | 410 angel = g_strdup(name); |
399 int plugin_return = plugin_event(event_im_recv, gc, &angel, &buffy, 0); | 411 plugin_return = plugin_event(event_im_recv, gc, &angel, &buffy, 0); |
400 | 412 |
401 if (!buffy || !angel || plugin_return) { | 413 if (!buffy || !angel || plugin_return) { |
402 if (buffy) | 414 if (buffy) |
403 g_free(buffy); | 415 g_free(buffy); |
404 if (angel) | 416 if (angel) |
418 char *tmpmsg = stylize(awaymessage->message, MSG_LEN); | 430 char *tmpmsg = stylize(awaymessage->message, MSG_LEN); |
419 serv_send_im(gc, name, tmpmsg, 1); | 431 serv_send_im(gc, name, tmpmsg, 1); |
420 g_free(tmpmsg); | 432 g_free(tmpmsg); |
421 return; | 433 return; |
422 } | 434 } |
423 | |
424 /* we should update the conversation window buttons and menu, if it exists. */ | |
425 cnv = find_conversation(name); | |
426 if (cnv) | |
427 set_convo_gc(cnv, gc); | |
428 | 435 |
429 /* if you can't figure this out, stop reading right now. | 436 /* if you can't figure this out, stop reading right now. |
430 * "we're not worthy! we're not worthy!" */ | 437 * "we're not worthy! we're not worthy!" */ |
431 if (general_options & OPT_GEN_SEND_LINKS) | 438 if (general_options & OPT_GEN_SEND_LINKS) |
432 linkify_text(message); | 439 linkify_text(message); |
495 /* ok, so we're not ignoring it. make sure the conversation exists and is | 502 /* ok, so we're not ignoring it. make sure the conversation exists and is |
496 * updated (partly handled above already), play the receive sound (sound.c | 503 * updated (partly handled above already), play the receive sound (sound.c |
497 * will take care of not playing while away), and then write it to the | 504 * will take care of not playing while away), and then write it to the |
498 * convo window. */ | 505 * convo window. */ |
499 if (cnv == NULL) { | 506 if (cnv == NULL) { |
500 new_conv = 1; | |
501 cnv = new_conversation(name); | 507 cnv = new_conversation(name); |
502 set_convo_gc(cnv, gc); | 508 set_convo_gc(cnv, gc); |
503 } | 509 } |
504 if (new_conv && (sound_options & OPT_SOUND_FIRST_RCV)) | 510 if (new_conv && (sound_options & OPT_SOUND_FIRST_RCV)) |
505 play_sound(FIRST_RECEIVE); | 511 play_sound(FIRST_RECEIVE); |
548 } else { | 554 } else { |
549 /* we're not away. this is easy. if the convo window doesn't exist, create and update | 555 /* we're not away. this is easy. if the convo window doesn't exist, create and update |
550 * it (if it does exist it was updated earlier), then play a sound indicating we've | 556 * it (if it does exist it was updated earlier), then play a sound indicating we've |
551 * received it and then display it. easy. */ | 557 * received it and then display it. easy. */ |
552 if (cnv == NULL) { | 558 if (cnv == NULL) { |
553 new_conv = 1; | |
554 cnv = new_conversation(name); | 559 cnv = new_conversation(name); |
555 set_convo_gc(cnv, gc); | 560 set_convo_gc(cnv, gc); |
556 } | 561 } |
557 if (new_conv && (sound_options & OPT_SOUND_FIRST_RCV)) | 562 if (new_conv && (sound_options & OPT_SOUND_FIRST_RCV)) |
558 play_sound(FIRST_RECEIVE); | 563 play_sound(FIRST_RECEIVE); |