comparison src/server.c @ 764:a566fc987db9

[gaim-migrate @ 774] apply default fonts and colors to an away message committer: Tailor Script <tailor@pidgin.im>
author Todd Kulesza <fflewddur>
date Fri, 25 Aug 2000 04:17:06 +0000
parents 870fcc64a709
children bf31bf916f53
comparison
equal deleted inserted replaced
763:4aeb969c70c9 764:a566fc987db9
626 serv_touch_idle(); 626 serv_touch_idle();
627 } 627 }
628 628
629 629
630 630
631
632 void serv_got_im(char *name, char *message, int away) 631 void serv_got_im(char *name, char *message, int away)
633 { 632 {
634 struct conversation *cnv; 633 struct conversation *cnv;
635 int is_idle = -1; 634 int is_idle = -1;
636 int new_conv = 0; 635 int new_conv = 0;
637 636
638 #ifdef GAIM_PLUGINS 637 #ifdef GAIM_PLUGINS
639 GList *c = callbacks; 638 GList *c = callbacks;
640 struct gaim_callback *g; 639 struct gaim_callback *g;
641 void (*function)(char **, char **, void *); 640 void (*function)(char **, char **, void *);
656 g_snprintf(name, strlen(name) + 1, "%s", angel); 655 g_snprintf(name, strlen(name) + 1, "%s", angel);
657 g_free(angel); 656 g_free(angel);
658 #endif 657 #endif
659 658
660 if ((general_options & OPT_GEN_TIK_HACK) && awaymessage && 659 if ((general_options & OPT_GEN_TIK_HACK) && awaymessage &&
661 !strcmp(message, ">>>Automated Message: Getting Away Message<<<")) { 660 !strcmp(message, ">>>Automated Message: Getting Away Message<<<"))
661 {
662 serv_send_im(name, awaymessage->message, 1); 662 serv_send_im(name, awaymessage->message, 1);
663 return; 663 return;
664 } 664 }
665 665
666 cnv = find_conversation(name); 666 cnv = find_conversation(name);
667 667
668 if (general_options & OPT_GEN_SEND_LINKS) { 668 if (general_options & OPT_GEN_SEND_LINKS) {
669 linkify_text(message); 669 linkify_text(message);
670 } 670 }
671 671
672 if (away) away = WFLAG_AUTO; 672 if (away)
673 away = WFLAG_AUTO;
673 674
674 if (awaymessage != NULL) { 675 if (awaymessage != NULL) {
675 if (!(general_options & OPT_GEN_DISCARD_WHEN_AWAY)) { 676 if (!(general_options & OPT_GEN_DISCARD_WHEN_AWAY)) {
676 if (cnv == NULL) { 677 if (cnv == NULL) {
677 new_conv = 1; 678 new_conv = 1;
699 } 700 }
700 701
701 702
702 703
703 704
704 if (awaymessage != NULL) { 705 if (awaymessage != NULL) {
705 time_t t; 706 time_t t;
706 char tmpmsg[BUF_LEN]; 707 char tmpmsg[BUF_LEN];
707 708
708 time(&t); 709 time(&t);
709 710
710 711
711 if ((cnv == NULL) || (t - cnv->sent_away) < 120) 712 if ((cnv == NULL) || (t - cnv->sent_away) < 120)
712 return; 713 return;
713 714
714 cnv->sent_away = t; 715 cnv->sent_away = t;
715 716
716 if (is_idle) 717 if (is_idle)
717 is_idle = -1; 718 is_idle = -1;
718 719
720 /* apply default fonts and colors */
721 stylize(awaymessage->message, MSG_LEN);
722
719 strcpy(tmpmsg, awaymessage->message); 723 strcpy(tmpmsg, awaymessage->message);
720 escape_text(tmpmsg); 724 escape_text(tmpmsg);
721 escape_message(tmpmsg); 725 escape_message(tmpmsg);
722 serv_send_im(name, away_subs(tmpmsg, name), 1); 726 serv_send_im(name, away_subs(tmpmsg, name), 1);
723 727
724 if (is_idle == -1) 728 if (is_idle == -1)
725 is_idle = 1; 729 is_idle = 1;
726 730
727 if (cnv != NULL) 731 if (cnv != NULL)
728 write_to_conv(cnv, away_subs(awaymessage->message, name), WFLAG_SEND | WFLAG_AUTO, NULL); 732 write_to_conv(cnv, away_subs(awaymessage->message, name), WFLAG_SEND | WFLAG_AUTO, NULL);
729 } 733 }
730 } 734 }
731 735
732 736
733 737
734 void serv_got_update(char *name, int loggedin, int evil, time_t signon, time_t idle, int type, u_short caps) 738 void serv_got_update(char *name, int loggedin, int evil, time_t signon, time_t idle, int type, u_short caps)