comparison src/server.c @ 2313:bd9d403fb15b

[gaim-migrate @ 2323] more room committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 20 Sep 2001 01:23:04 +0000
parents a87ca0aa1840
children b53cd5b63a99
comparison
equal deleted inserted replaced
2312:766603034af8 2313:bd9d403fb15b
422 message = buffy; 422 message = buffy;
423 423
424 /* TiK, using TOC, sends an automated message in order to get your away message. Now, 424 /* TiK, using TOC, sends an automated message in order to get your away message. Now,
425 * this is one of the biggest hacks I think I've seen. But, in order to be nice to 425 * this is one of the biggest hacks I think I've seen. But, in order to be nice to
426 * TiK, we're going to give users the option to ignore it. */ 426 * TiK, we're going to give users the option to ignore it. */
427 if ((general_options & OPT_GEN_TIK_HACK) && gc->away && strlen(gc->away) && 427 if ((away_options & OPT_AWAY_TIK_HACK) && gc->away && strlen(gc->away) &&
428 !strcmp(message, ">>>Automated Message: Getting Away Message<<<")) { 428 !strcmp(message, ">>>Automated Message: Getting Away Message<<<")) {
429 char *tmpmsg = stylize(awaymessage->message, MSG_LEN); 429 char *tmpmsg = stylize(awaymessage->message, MSG_LEN);
430 serv_send_im(gc, name, tmpmsg, IM_FLAG_AWAY); 430 serv_send_im(gc, name, tmpmsg, IM_FLAG_AWAY);
431 g_free(tmpmsg); 431 g_free(tmpmsg);
432 g_free(name); 432 g_free(name);
434 return; 434 return;
435 } 435 }
436 436
437 /* if you can't figure this out, stop reading right now. 437 /* if you can't figure this out, stop reading right now.
438 * "we're not worthy! we're not worthy!" */ 438 * "we're not worthy! we're not worthy!" */
439 if (general_options & OPT_GEN_SEND_LINKS) 439 if (convo_options & OPT_CONVO_SEND_LINKS)
440 linkify_text(message); 440 linkify_text(message);
441 441
442 /* um. when we call write_to_conv with the message we received, it's nice to pass whether 442 /* um. when we call write_to_conv with the message we received, it's nice to pass whether
443 * or not it was an auto-response. so if it was an auto-response, we set the appropriate 443 * or not it was an auto-response. so if it was an auto-response, we set the appropriate
444 * flag. this is just so prpls don't have to know about WFLAG_* (though some do anyway) */ 444 * flag. this is just so prpls don't have to know about WFLAG_* (though some do anyway) */
461 /* either we're going to queue it or not. Because of the way awayness currently 461 /* either we're going to queue it or not. Because of the way awayness currently
462 * works, this is fucked up. it's possible for an account to be away without the 462 * works, this is fucked up. it's possible for an account to be away without the
463 * imaway dialog being shown. in fact, it's possible for *all* the accounts to be 463 * imaway dialog being shown. in fact, it's possible for *all* the accounts to be
464 * away without the imaway dialog being shown. so in order for this to be queued 464 * away without the imaway dialog being shown. so in order for this to be queued
465 * properly, we have to make sure that the imaway dialog actually exists, first. */ 465 * properly, we have to make sure that the imaway dialog actually exists, first. */
466 if (!cnv && clistqueue && (general_options & OPT_GEN_QUEUE_WHEN_AWAY)) { 466 if (!cnv && clistqueue && (away_options & OPT_AWAY_QUEUE)) {
467 /* alright, so we're going to queue it. neat, eh? :) so first we create 467 /* alright, so we're going to queue it. neat, eh? :) so first we create
468 * something to store the message, and add it to our queue. Then we update 468 * something to store the message, and add it to our queue. Then we update
469 * the away dialog to indicate that we've queued something. */ 469 * the away dialog to indicate that we've queued something. */
470 struct queued_message *qm; 470 struct queued_message *qm;
471 471
495 } 495 }
496 } else { 496 } else {
497 /* ok, so we're not queuing it. well then, we'll try to handle it normally. 497 /* ok, so we're not queuing it. well then, we'll try to handle it normally.
498 * Some people think that ignoring it is a perfectly acceptible way to handle 498 * Some people think that ignoring it is a perfectly acceptible way to handle
499 * it. i think they're on crack, but hey, that's why it's optional. */ 499 * it. i think they're on crack, but hey, that's why it's optional. */
500 if (general_options & OPT_GEN_DISCARD_WHEN_AWAY) { 500 if (away_options & OPT_AWAY_DISCARD) {
501 g_free(name); 501 g_free(name);
502 g_free(message); 502 g_free(message);
503 return; 503 return;
504 } 504 }
505 505
519 write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime); 519 write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime);
520 } 520 }
521 521
522 /* regardless of whether we queue it or not, we should send an auto-response. That is, 522 /* regardless of whether we queue it or not, we should send an auto-response. That is,
523 * of course, unless the horse.... no wait. */ 523 * of course, unless the horse.... no wait. */
524 if ((general_options & OPT_GEN_NO_AUTO_RESP) || !strlen(gc->away)) { 524 if ((away_options & OPT_AWAY_NO_AUTO_RESP) || !strlen(gc->away)) {
525 g_free(name); 525 g_free(name);
526 g_free(message); 526 g_free(message);
527 return; 527 return;
528 } 528 }
529 529
547 qar->sent_away = t; 547 qar->sent_away = t;
548 548
549 /* apply default fonts and colors */ 549 /* apply default fonts and colors */
550 tmpmsg = stylize(gc->away, MSG_LEN); 550 tmpmsg = stylize(gc->away, MSG_LEN);
551 serv_send_im(gc, name, away_subs(tmpmsg, alias), IM_FLAG_AWAY); 551 serv_send_im(gc, name, away_subs(tmpmsg, alias), IM_FLAG_AWAY);
552 if (!cnv && clistqueue && (general_options & OPT_GEN_QUEUE_WHEN_AWAY)) { 552 if (!cnv && clistqueue && (away_options & OPT_AWAY_QUEUE)) {
553 struct queued_message *qm; 553 struct queued_message *qm;
554 qm = g_new0(struct queued_message, 1); 554 qm = g_new0(struct queued_message, 1);
555 g_snprintf(qm->name, sizeof(qm->name), "%s", name); 555 g_snprintf(qm->name, sizeof(qm->name), "%s", name);
556 qm->message = g_strdup(away_subs(tmpmsg, alias)); 556 qm->message = g_strdup(away_subs(tmpmsg, alias));
557 qm->gc = gc; 557 qm->gc = gc;
615 strcpy(who, normalize(name)); 615 strcpy(who, normalize(name));
616 616
617 while (cnv) { 617 while (cnv) {
618 cv = (struct conversation *)cnv->data; 618 cv = (struct conversation *)cnv->data;
619 if (!g_strcasecmp(who, normalize(cv->name))) { 619 if (!g_strcasecmp(who, normalize(cv->name))) {
620 if (display_options & OPT_DISP_ONE_WINDOW) { 620 if (im_options & OPT_IM_ONE_WINDOW) {
621 set_convo_tab_label(cv, b->name); 621 set_convo_tab_label(cv, b->name);
622 } else { 622 } else {
623 g_snprintf(cv->name, sizeof(cv->name), "%s", name); 623 g_snprintf(cv->name, sizeof(cv->name), "%s", name);
624 if (find_log_info(name) || (logging_options & OPT_LOG_ALL)) 624 if (find_log_info(name) || (logging_options & OPT_LOG_ALL))
625 g_snprintf(who, 63, LOG_CONVERSATION_TITLE, name); 625 g_snprintf(who, 63, LOG_CONVERSATION_TITLE, name);
719 gtk_widget_realize(d); 719 gtk_widget_realize(d);
720 aol_icon(d->window); 720 aol_icon(d->window);
721 721
722 label = gtk_label_new(buf2); 722 label = gtk_label_new(buf2);
723 gtk_widget_show(label); 723 gtk_widget_show(label);
724 close = gtk_button_new_with_label("Close"); 724 close = picture_button(d, _("Close"), cancel_xpm);
725 if (display_options & OPT_DISP_COOL_LOOK)
726 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE);
727 gtk_widget_show(close); 725 gtk_widget_show(close);
728 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), label, FALSE, FALSE, 5); 726 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), label, FALSE, FALSE, 5);
729 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5); 727 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), close, FALSE, FALSE, 5);
730 728
731 gtk_window_set_title(GTK_WINDOW(d), "Warned"); 729 gtk_window_set_title(GTK_WINDOW(d), "Warned");
913 return; 911 return;
914 912
915 buf = g_malloc(MAX(strlen(message) * 2, 8192)); 913 buf = g_malloc(MAX(strlen(message) * 2, 8192));
916 strcpy(buf, message); 914 strcpy(buf, message);
917 915
918 if (general_options & OPT_GEN_SEND_LINKS) { 916 if (convo_options & OPT_CONVO_SEND_LINKS)
919 linkify_text(buf); 917 linkify_text(buf);
920 }
921 918
922 if (whisper) 919 if (whisper)
923 w = WFLAG_WHISPER; 920 w = WFLAG_WHISPER;
924 else 921 else
925 w = 0; 922 w = 0;